Lines Matching full:scanner
332 * C++ Scanner Interface:: Exchanges between yylex and parse
346 * Calc++ Scanner:: A pure C++ Flex scanner
355 * Java Scanner Interface:: Specifying the scanner for the parser
6066 call it. The function is sometimes referred to as a lexical scanner.
7719 fetches a new token from the scanner so that it can determine the next
7732 a token from the scanner because no lookahead is needed to determine the
7776 file I/O, the lexical analysis performed by the scanner, and the user's
8080 once again commence. The next symbol returned by the lexical scanner is
8397 useless tokens are preserved, since they might be used by the scanner (note
9079 Then the parser calls the scanner.
9662 * C++ Scanner Interface:: Exchanges between yylex and parse
9946 use @code{yy::parser::token::FOO}. The scanner can use
9948 (@pxref{Calc++ Scanner}).
9984 @node C++ Scanner Interface
9985 @subsection C++ Scanner Interface
9990 The parser invokes the scanner by calling @code{yylex}. Contrary to C
10009 We will use a Lex scanner, and more precisely, a Flex scanner, to
10010 demonstrate the various interaction. A hand written scanner is
10017 * Calc++ Scanner:: A pure C++ Flex scanner
10042 To support a pure interface with the parser (and the scanner) the
10102 To encapsulate the coordination with the Flex scanner, it is useful to
10107 // Handling the scanner.
10221 The driver is passed by reference to the parser and to the scanner.
10357 @node Calc++ Scanner
10358 @subsubsection Calc++ Scanner
10360 The Flex scanner first includes the driver declaration, then the
10363 @comment file: calc++-scanner.ll
10391 Finally we enable the scanner tracing features.
10393 @comment file: calc++-scanner.ll
10401 @comment file: calc++-scanner.ll
10417 @comment file: calc++-scanner.ll
10438 @comment file: calc++-scanner.ll
10471 Finally, because the scanner related driver's member function depend
10472 on the scanner's data, it is simpler to implement them in this file.
10474 @comment file: calc++-scanner.ll
10534 * Java Scanner Interface:: Specifying the scanner for the parser
10701 interface, @code{Lexer} (see @ref{Java Scanner Interface}). Other than
10724 Build a new parser object using the specified scanner. There are no
10727 If the scanner is defined by @code{%code lexer}, this constructor is
10728 declared @code{protected} and is called automatically with a scanner
10756 @node Java Scanner Interface
10757 @subsection Java Scanner Interface
10763 with a scanner: the scanner may be defined by @code{%code lexer}, or
10764 defined elsewhere. In either case, the scanner has to implement the
10767 In the first case, the body of the scanner class is placed in
10769 parser constructor to the scanner constructor, specify them with
10773 In the second case, the scanner has to implement the @code{Lexer} interface,
10779 In both cases, the scanner has to implement the following methods.
10887 Print an error message using the @code{yyerror} method of the scanner
10939 scanner. If there is no such block, the scanner can be any class
10940 that implements the appropriate interface (@pxref{Java Scanner
10968 @xref{Java Scanner Interface}.
11006 @xref{Java Scanner Interface}.
11044 @xref{Java Scanner Interface}.
11222 Lex-generated scanner to discard its current buffer and switch to the
11226 Flex-generated scanner needs to read from several input streams to
11231 If your Flex-generated scanner uses start conditions (@pxref{Start
11233 also want to reset the scanner's state, i.e., go back to the initial
11247 of the scanner. Consider the following Lex code:
11357 Now the difficult part is ensuring that the scanner will send these
11358 tokens first. If your scanner is hand-written, that should be
11359 straightforward. If your scanner is generated by Lex, them there is
11363 available in the scanner (e.g., a global variable or using
11635 meant for the scanner. @xref{Decl Summary}.
12149 @item Lexical analyzer (scanner)