diff options
author | marha <marha@users.sourceforge.net> | 2010-11-19 15:19:19 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-11-19 15:19:19 +0000 |
commit | d12ad2fa1165573df95c857ce59f582f964b7cee (patch) | |
tree | 8d5546283940c928290a23c50748b3f5c431ef06 /tools/bison++/Example/MyScanner.l | |
parent | bd5413c3a7e500fa8c8ccd68a33d2fcc4c172e28 (diff) | |
parent | 12f606ce06ef926f366a03079c5e3107c23f18af (diff) | |
download | vcxsrv-d12ad2fa1165573df95c857ce59f582f964b7cee.tar.gz vcxsrv-d12ad2fa1165573df95c857ce59f582f964b7cee.tar.bz2 vcxsrv-d12ad2fa1165573df95c857ce59f582f964b7cee.zip |
svn merge ^/branches/released .
Diffstat (limited to 'tools/bison++/Example/MyScanner.l')
-rw-r--r-- | tools/bison++/Example/MyScanner.l | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/bison++/Example/MyScanner.l b/tools/bison++/Example/MyScanner.l new file mode 100644 index 000000000..fd9dde78f --- /dev/null +++ b/tools/bison++/Example/MyScanner.l @@ -0,0 +1,31 @@ +%{ +#ifndef FLEXFIX +#define FLEXFIX YY_MyParser_STYPE *val +#define FLEXFIX2 val +#endif +#include "MyParser.h" // Make sure the flexer can communicate with bison++ + //using return values +%} + +digit [0-9] +integer [1-9]{digit}* +ws [ \t\n]+ +%% +{ws} { /* no action */ } +{integer} { val->num = atoi(yytext); return MyParser::INTEGER; } +"AND" {return(MyParser::AND);} +"OR" {return(MyParser::OR);} +"NOT" {return(MyParser::NOT);} +"TRUE" {val->statement=true; return MyParser::BOOLEAN; } +"FALSE" {val->statement=false; return MyParser::BOOLEAN; } +"-" {return(MyParser::MINUS);} +"+" {return(MyParser::PLUS);} +"(" {return(MyParser::LPARA);} +")" {return(MyParser::RPARA);} + +<<EOF>> { yyterminate();} +%% +int yywrap() +{ + return(1); +}
\ No newline at end of file |