/* * espresso.flex * Lexical analyzer source code file (flex input file) */ /* * Don't remove anything from this first section */ %option noyywrap %{ // string table package #include "StringTab.h" // need the following to compile with bison-generated espresso.tab.h #include "parser.h" // the following file contains the token declarations, // and the def of YYSTYPE. // the bison program automatically creates this file from a bison input file #include "espresso.tab.h" // things that both lextest and the flex output file need to know about #include "lexer.h" /* * Add any additional C++ delarations/definitions here if necessary */ %} /* example of a regular definition (define a named regular expression) */ EQUALS == %% /* * an example flex rule. the rules have the form: * pattern {action} * * uses pattern defined above; * EQUALS in action is a symbol defined * in espresso.tab.h */ {EQUALS} { return EQUALS; } %% // initLexer(): this is a hook for you to add any other initialization code. // This will get called by the driver before the first call to yylex(). // You probably will not need to modify this function. void initLexer() { }