|
Aprepro
5.0x
|
#include <apr_scanner.h>


Public Member Functions | |
| Scanner (Aprepro &aprepro_yyarg, std::istream *in=nullptr, std::ostream *out=nullptr) | |
| ~Scanner () override | |
| void | add_include_file (const std::string &filename, bool must_exist) |
| int | yywrap () override |
| void | yyerror (const char *s) |
| void | LexerOutput (const char *buf, int size) override |
| int | LexerInput (char *buf, int max_size) override |
| virtual Parser::token_type | lex (Parser::semantic_type *yylval) |
| char * | rescan (char *string) |
| char * | execute (char *string) |
| char * | if_handler (double x) |
| char * | elseif_handler (double x) |
| char * | switch_handler (double x) |
| char * | case_handler (double x) |
| void | set_debug (bool b) |
| void | save_history_string () |
Public Member Functions inherited from SEAMSFlexLexer | |
| SEAMSFlexLexer (std::istream *arg_yyin=nullptr, std::ostream *arg_yyout=nullptr) | |
| ~SEAMSFlexLexer () override | |
| void | yy_switch_to_buffer (struct yy_buffer_state *new_buffer) override |
| struct yy_buffer_state * | yy_create_buffer (std::istream *file, int size) override |
| void | yy_delete_buffer (struct yy_buffer_state *b) override |
| void | yyrestart (std::istream *input_file) override |
| void | yypush_buffer_state (struct yy_buffer_state *new_buffer) |
| void | yypop_buffer_state () |
| int | yylex () override |
| void | switch_streams (std::istream *new_in, std::ostream *new_out=nullptr) override |
Public Member Functions inherited from FlexLexer | |
| FlexLexer () | |
| virtual | ~FlexLexer () |
| const char * | YYText () const |
| int | YYLeng () const |
| int | yylex (std::istream *new_in, std::ostream *new_out=nullptr) |
| int | lineno () const |
| int | debug () const |
| void | set_debug (int flag) |
Public Attributes | |
| class Aprepro & | aprepro |
Friends | |
| class | Parser |
Scanner is a derived class to add some extra function to the scanner class. Flex itself creates a class named yyFlexLexer, which is renamed using macros to SEAMSFlexLexer. However we change the context of the generated yylex() function to be contained within the Scanner class. This is required because the yylex() defined in SEAMSFlexLexer has no parameters.
|
explicit |
Create a new scanner object. The streams arg_yyin and arg_yyout default to cin and cout, but that assignment is only made when initializing in yylex().
|
override |
Required for virtual functions
| void SEAMS::Scanner::add_include_file | ( | const std::string & | filename, |
| bool | must_exist | ||
| ) |
| char * SEAMS::Scanner::case_handler | ( | double | x | ) |
| char * SEAMS::Scanner::elseif_handler | ( | double | x | ) |
| char * SEAMS::Scanner::execute | ( | char * | string | ) |
| char * SEAMS::Scanner::if_handler | ( | double | x | ) |
|
virtual |
This is the main lexing function. It is generated by flex according to the macro declaration YY_DECL above. The generated bison parser then calls this virtual function to fetch new tokens.
|
overridevirtual |
Reimplemented from SEAMSFlexLexer.
|
overridevirtual |
Reimplemented from SEAMSFlexLexer.
| char * SEAMS::Scanner::rescan | ( | char * | string | ) |
| void SEAMS::Scanner::save_history_string | ( | ) |
| void SEAMS::Scanner::set_debug | ( | bool | b | ) |
Enable debug output (via arg_yyout) if compiled into the scanner.
| char * SEAMS::Scanner::switch_handler | ( | double | x | ) |
| void SEAMS::Scanner::yyerror | ( | const char * | s | ) |
|
overridevirtual |
Reimplemented from SEAMSFlexLexer.
|
friend |
| class Aprepro& SEAMS::Scanner::aprepro |