  | 
  
    User Guide
    
   | 
 
 
 
 
Go to the documentation of this file.
   20     : trace_scanner(strace)
 
   21     , trace_parser(ptrace) {}
 
   32     return parser->parse() == 0;
 
   37     std::ifstream in(filename.c_str());
 
   48     std::istringstream iss(input);
 
   53     std::cerr << m << 
'\n';
 
   62     std::cerr << l << 
" : " << m << 
'\n';
 
   66     std::istringstream in(text);
 
   70         auto sym = 
lexer->next_token();
 
   72         if (
token_type == CParser::by_type(CParser::token::END).type_get()) {
 
  
 
Represent Lexer/Scanner class for C (11) language parsing.
 
bool parse_string(const std::string &input)
parser c provided as string (used for testing)
 
encapsulates code generation backend implementations
 
bool parse_stream(std::istream &in)
parse c file provided as istream
 
bool parse_file(const std::string &filename)
 
std::string streamname
file or input stream name (used by scanner for position), see todo
 
static void error(const std::string &m)
 
bool trace_scanner
enable debug output in the flex scanner
 
std::unique_ptr< CParser > parser
pointer to the parser instance being used
 
std::vector< std::string > tokens
all tokens encountered
 
bool trace_parser
enable debug output in the bison parser
 
std::unique_ptr< CLexer > lexer
pointer to the lexer instance being used
 
TokenType token_type(const std::string &name)
Return token type for given token name.
 
void scan_string(const std::string &text)
 
void add_token(const std::string &)