HPlogo HP C/HP-UX Programmer's Guide: HP 9000 Computers > Chapter 7 Using C Programming Tools

HP Specific Features of lex and yacc

» 

Technical documentation

Complete book in PDF

 » Table of Contents

The following native language support features have been added to the HP C lex and yacc tools:

  • LC_CTYPE and LC_MESSAGES environment variable support in lex - Determines the size of the characters and language in which messages are displayed while you use lex.

  • -m command line option for lex - Specifies that multibyte characters may be used anywhere single byte characters are allowed. You can intermix both 8-bit and 16-bit multibyte characters in regular expressions if you enable the -m command line option.

  • -w command line option for lex - Includes all features in -m and returns data in the form of the wchar_t data type.

  • %l <locale> directive for lex - Specifies the locale at the beginning of the definitions section. Any valid locale recognized by the setlocale function can be used. This directive is similar to using the LC_CTYPE environment variable. To receive wchar_t support with %l, use the -w command line option.

  • LC_CTYPE environment variable support in yacc - Determines the native language set used by yacc and enables multibyte character sets. Multibyte characters can appear in token names, on terminal symbols, strings, comments, or anywhere ASCII characters can appear, except as separators or special characters.

  • If you see the diagnostic message yacc stack overflow, then add the macro

    #define __RUNTIME_YYMAXDEPTH

    at the beginning of the user subroutine section in the .y file.

© Hewlett-Packard Development Company, L.P.