added config files
This commit is contained in:
parent
e0b407f8fb
commit
fd2d08fb24
7 changed files with 90 additions and 54 deletions
19
src/lexer.l
19
src/lexer.l
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
%option reentrant noyywrap nounput
|
||||
|
||||
%{
|
||||
|
|
@ -12,24 +11,12 @@
|
|||
|
||||
%}
|
||||
|
||||
/* your definitions here */
|
||||
|
||||
/* your definitions end */
|
||||
|
||||
%%
|
||||
|
||||
%{
|
||||
loc.step();
|
||||
%}
|
||||
|
||||
/* your rules here */
|
||||
|
||||
/* use this structure to pass the Token :
|
||||
* return yy::parser::make_TokenName(loc)
|
||||
* if the token has a type you can pass it's value
|
||||
* as the first argument. as an example we put
|
||||
* the rule to return token function.
|
||||
*/
|
||||
|
||||
function {return yy::Parser::make_FUNCTION(loc);}
|
||||
|
||||
|
|
@ -37,10 +24,4 @@ function {return yy::Parser::make_FUNCTION(loc);}
|
|||
|
||||
. {std::cerr << loc << ": " << "token error" << std::endl; exit(1);}
|
||||
|
||||
|
||||
/* if you didn't define #define yyterminate() at beginnign, you will need
|
||||
this rule to match the end of file */
|
||||
/* <<EOF>> {return yy::Parser::make_END(loc);} */
|
||||
/* your rules end */
|
||||
|
||||
%%
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue