• Home
  • Raw
  • Download

Lines Matching refs:yylex

211 * Lexical::                 You must supply a function `yylex'
218 The Lexical Analyzer Function `yylex'
220 * Calling Convention:: How `yyparse' calls `yylex'.
221 * Token Values:: How `yylex' must return the semantic value
223 * Token Locations:: How `yylex' must return the text location
282 * Yacc Library:: Yacc-compatible `yylex' and `main'.
295 * C++ Scanner Interface:: Exchanges between yylex and parse
1610 int yylex (void);
1855 The Lexical Analyzer Function `yylex': Lexical.
1869 as the lexical analyzer function `yylex', the error reporting function
1903 The Lexical Analyzer Function `yylex': Lexical.). It could also
1947 You need to declare the lexical analyzer `yylex' and the error printer
2029 int yylex (void);
2050 The forward declarations for `yylex' and `yyerror' are needed
2245 Function `yylex': Lexical.
2261 number. In this example, therefore, `NUM' becomes a macro for `yylex'
2284 yylex (void)
2358 grammar file. The definitions of `yylex', `yyerror' and `main' go at
2374 additional functions in the grammar file (`yylex', `yyerror' and
2431 int yylex (void);
2465 The functions `yylex', `yyerror' and `main' can be the same as before.
2571 int yylex (void);
2664 yylex (void)
2740 they are only single-character literals. The lexical analyzer `yylex'
2786 int yylex (void);
2992 The function `yylex' must now recognize variables, numeric values,
3004 operators in `yylex'.
3009 yylex (void)
3502 definition of `yyparse'. For example, the definitions of `yylex' and
3504 before being used, you often need to declare functions like `yylex' and
3528 represented in the Bison parser by a numeric code, and the `yylex'
3570 end-of-input (*note Calling Convention for `yylex': Calling
3607 The value returned by `yylex' is always one of the terminal symbols,
3610 same way in the definition of `yylex'. The numeric code for a
3612 character, so `yylex' can use the identical value to generate the
3615 type becomes a C macro in the parser implementation file, so `yylex'
3617 make sense in terminal symbols.) *Note Calling Convention for `yylex':
3620 If `yylex' is defined in a separate file, you need to arrange for the
3634 The `yylex' function and Bison must use a consistent character set
3647 In particular, `yylex' should never return this value. The default
4548 that the function `yylex' (if it is in this file) can use the name NAME
4594 `yylex' function can use the token name or the literal string to obtain
5009 statically allocated variables for communication with `yylex',
5020 is used for the lexical analyzer function `yylex'. *Note Calling
5082 status = yypush_parse (ps, yylex (), NULL);
5097 yychar = yylex ();
5221 the definition of `yylex' in a separate source file, because
5222 `yylex' typically needs to be able to refer to the above-mentioned
5428 reentrant. This changes the signature for `yylex' (*note Pure
5545 The parser namespace is `foo' and `yylex' is referenced as
5681 The renamed symbols include `yyparse', `yylex', `yyerror',
5704 parser implementation file, thus the "original" names (`yylex',
5761 * Lexical:: You must supply a function `yylex'
5917 4.6 The Lexical Analyzer Function `yylex'
5920 The "lexical analyzer" function, `yylex', recognizes tokens from the
5925 In simple programs, `yylex' is often defined at the end of the Bison
5926 grammar file. If `yylex' is defined in a separate source file, you
5935 * Calling Convention:: How `yyparse' calls `yylex'.
5936 * Token Values:: How `yylex' must return the semantic value
5938 * Token Locations:: How `yylex' must return the text location
5947 4.6.1 Calling Convention for `yylex'
5950 The value that `yylex' returns must be the positive numeric code for
5956 the proper numeric code for that token type. So `yylex' can use the
5961 token type. So `yylex' can simply return that character code, possibly
5969 yylex (void)
5983 utility can be used without change as the definition of `yylex'.
5986 `yylex' can determine the token type codes for them:
5989 literal string tokens, `yylex' can use these symbolic names like
5991 the grammar file has no effect on `yylex'.
5993 * `yylex' can find the multicharacter token in the `yytname' table.
6028 if the type is `int' (the default), you might write this in `yylex':
6047 then the code in `yylex' might look like this:
6062 then you must provide this information in `yylex'. The function
6064 in the global variable `yylloc'. So `yylex' must store the proper data
6085 passed as arguments to `yylex'. You must declare them as shown here,
6089 yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
6099 this case, omit the second argument; `yylex' will be called with only
6102 If you wish to pass the additional parameter data to `yylex', use
6107 `yylex' argument declaration.
6115 int yylex (int *nastiness);
6119 int yylex (YYSTYPE *lvalp, int *nastiness);
7016 As long as the token `"bogus"' is never generated by `yylex', the added
7206 * Delayed `yylex' invocations.
7212 does not bother to invoke `yylex' to fetch the next token before
7215 Bison-generated parser invokes `yylex' for a token: immediately
7222 designing `yylex' and the grammar file. That is, if the behavior
7223 of `yylex' can influence or be influenced by the semantic actions
7225 of the next `yylex' invocation until after those reductions is
7227 stack that `yylex' uses to determine what token to return. Thus,
7228 the delay might be necessary to ensure that `yylex' does not look
7234 When the parser fetches a new token by invoking `yylex', it checks
7256 However, the default accept action does not delay any `yylex'
7712 `IDENTIFIER' and `TYPENAME'. When `yylex' finds an identifier, it
7789 int yylex (void);
7808 Here we assume that `yylex' looks at the value of `hexflag'; when it is
7814 Prologue: Prologue.). You must also write the code in `yylex' to obey
8490 * Each time the parser calls `yylex', what kind of token was read.
8737 * Yacc Library:: Yacc-compatible `yylex' and `main'.
9113 * C++ Scanner Interface:: Exchanges between yylex and parse
9402 The parser invokes the scanner by calling `yylex'. Contrary to C
9407 -- Method on parser: int yylex (semantic_type* YYLVAL, location_type*
9477 signature of `yylex' to be defined in the macro `YY_DECL', and the C++
9483 yylex (yy::calcxx_parser::semantic_type* yylval, \
9720 /* By default yylex returns int, we use token_type.
9740 time `yylex' is invoked, the begin position is moved onto the end
10071 -- Method on Lexer: int yylex ()
10082 `yylex' returned, and the first position beyond it. These methods
10089 Return the semantic value of the last token that yylex returned.
10292 The exceptions thrown by the `yylex' method of the lexer, a
10409 yylex ();
10479 char *fst = (yylex (), yylval);
10480 char *snd = (yylex (), yylval);
10560 the first `%%' is copied verbatim in the top of the generated `yylex'
10863 `yylex' should accept. *Note Calling Conventions for Pure
10882 `yylex', `yyerror', `yynerrs', `yylval', `yychar', `yydebug', and
10946 `yylex' are mapped. It cannot be used in the grammar, rather, use
11027 -- Function: yylex
11030 `yylex': Lexical.
11034 extra arguments) for `yyparse' to pass to `yylex'. The use of this
11039 External variable in which `yylex' should place the line and column
11041 variable within `yyparse', and its address is passed to `yylex'.)
11053 External variable in which `yylex' should place the semantic value
11055 variable within `yyparse', and its address is passed to `yylex'.)
11257 one. *Note The Lexical Analyzer Function `yylex': Lexical.
12248 * delayed yylex invocations: Default Reductions. (line 17)
12610 * yylex <1>: Lexical. (line 6)
12611 * yylex: Table of Symbols. (line 328)
12612 * yylex on Lexer: Java Scanner Interface.
12614 * yylex on parser: C++ Scanner Interface.