18%option never-interactive
19%option prefix="constexpYY"
21%option reentrant bison-bridge
22%option extra-type="struct constexpYY_state *"
Private interface between Parser (constexp.y) and Lexer (constexp.l)
33#include "ce_parse.hpp"
38#define YY_NO_UNISTD_H 1
45#define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size,yyscanner);
49#define LEX_NO_INPUT_FILENAME
static int yyread(char *buf, int max_size, yyscan_t yyscanner)
static const char * stateToString(int state)
static const char * getLexerFILE()
54CONSTSUFFIX ([uU][lL]?[lL]?)|([lL][lL]?[uU]?)
59"?" {
return TOK_QUESTIONMARK; }
60":" {
return TOK_COLON; }
61"||" {
return TOK_OR; }
62"&&" {
return TOK_AND; }
63"|" {
return TOK_BITWISEOR; }
64"^" {
return TOK_BITWISEXOR; }
65"&" {
return TOK_AMPERSAND; }
66"!=" {
return TOK_NOTEQUAL; }
67"==" {
return TOK_EQUAL; }
68"<" {
return TOK_LESSTHAN; }
69">" {
return TOK_GREATERTHAN; }
70"<=" {
return TOK_LESSTHANOREQUALTO; }
71">=" {
return TOK_GREATERTHANOREQUALTO; }
72"<<" {
return TOK_SHIFTLEFT; }
73">>" {
return TOK_SHIFTRIGHT; }
74"+" {
return TOK_PLUS; }
75"-" {
return TOK_MINUS; }
76"*" {
return TOK_STAR; }
77"/" {
return TOK_DIVIDE; }
78"%" {
return TOK_MOD; }
79"~" {
return TOK_TILDE; }
80"!" {
return TOK_NOT; }
81"(" {
return TOK_LPAREN; }
82")" {
return TOK_RPAREN; }
83"'"(([^\'\n\r\\]+)|(\\(([ntvbrfa\\?'\"])|([0-9]+)|([xX][0-9a-fA-F]+))))"'" {
84 yyextra->strToken=yytext;
870[0-7]*{CONSTSUFFIX}? { yyextra->strToken=yytext;
90[1-9][0-9]*{CONSTSUFFIX}? { yyextra->strToken=yytext;
91 return TOK_DECIMALINT;
93(0x|0X)[0-9a-fA-F]+{CONSTSUFFIX}? { yyextra->strToken=yytext+2;
94 return TOK_HEXADECIMALINT;
96(0b|0B)[01]+{CONSTSUFFIX}? { yyextra->strToken=yytext+2;
99(([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+))([eE]([\-\+])?[0-9]+)?([fFlL])? {
100 yyextra->strToken=yytext;
return TOK_FLOAT;
102([0-9]+[eE])([\-\+])?[0-9]+([fFlL])? {
103 yyextra->strToken=yytext;
return TOK_FLOAT;
112 struct yyguts_t *yyg =
static_cast<struct yyguts_t*
>(yyscanner);
114 while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
116 *buf = yyextra->inputString[yyextra->inputPosition++] ;
131 constexpYYlex_init_extra(&
p->constexpYY_extra, &
p->yyscanner);
136 constexpYYlex_destroy(
p->yyscanner);
141 struct yyguts_t *yyg = (
struct yyguts_t*)
p->yyscanner;
147 yyextra->constExpFileName = fileName;
148 yyextra->constExpLineNr = lineNr;
149 yyextra->orgString = orgStr;
150 yyextra->inputString = s;
151 yyextra->inputPosition = 0;
152 constexpYYrestart( yyin,
p->yyscanner );
160 bool result =
static_cast<long>(yyextra->resultValue)!=0;
169#include "constexp.l.h"
std::unique_ptr< Private > p
bool parse(const char *fileName, int line, const std::string &expression, const std::string &orgExpression)
static bool isFlagSet(const DebugMask mask)
static int yyread(yyscan_t yyscanner, char *buf, int max_size)
int constexpYYwrap(yyscan_t)
int constexpYYparse(yyscan_t)
struct constexpYY_state constexpYY_extra