L [a-zA-Z_]
H [a-fA-F0-9]
E [Ee][+-]?{D}+
+P [Pp][+-]?{D}+
FS (f|F|l|L|i|I|j|J)*
IS (u|U|l|L|i|I|j|J)*
IDENT {L}({L}|{D})*
+%option nounput
+
%{
import "ecdefs"
#define YYLTYPE Location
YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH];
File fileStack[MAX_INCLUDE_DEPTH];
char sourceFileStack[MAX_INCLUDE_DEPTH][MAX_LOCATION];
-public void SetSomeSourceFileStack(char * fileName, int index) { strcpy(sourceFileStack[index], fileName); }
+public void SetSomeSourceFileStack(const char * fileName, int index) { strcpy(sourceFileStack[index], fileName); }
YYLTYPE locStack[MAX_INCLUDE_DEPTH];
AccessMode declModeStack[MAX_INCLUDE_DEPTH];
int include_stack_ptr = 0;
"_stdcall" { return(EXT_DECL); }
"stdcall" { return(EXT_DECL); }
"__restrict" { return(EXT_DECL); }
-"__const" { return(EXT_DECL); }
+"__const" { return(CONST /*EXT_DECL*/); }
"__restrict__" { return(EXT_DECL); }
"public" { return(PUBLIC); }
"private" { return(PRIVATE); }
"dbindex" { return(DBINDEX); }
"database_open" { return(DATABASE_OPEN); }
-("::"|(({IDENT}"&"?"::")*)){IDENT}? { return(check_type()); } // {L}({L}|{D})* { return(check_type()); } // ("::"|(({IDENT}"::")*)){IDENT} { return(check_type()); } // {L}({L}|{D})* { return(check_type()); }
+("::"?(({IDENT}"&"?"::")*)){IDENT}? { return(check_type()); } // {L}({L}|{D})* { return(check_type()); } // ("::"|(({IDENT}"::")*)){IDENT} { return(check_type()); } // {L}({L}|{D})* { return(check_type()); }
0[xX]{H}+{IS}? { return(CONSTANT); }
+
+0[xX]{H}+{P}{FS}? { return(CONSTANT); }
+0[xX]{H}*"."{H}+({P})?{FS}? { return(CONSTANT); }
+0[xX]{H}+"."{H}*({P})?{FS}? { return(CONSTANT); }
+
0{D}+{IS}? { return(CONSTANT); }
{D}+{IS}? { return(CONSTANT); }
L?'(\\.|[^\\'])+' { return(CONSTANT); }
{D}*"."{D}+({E})?{FS}? { return(CONSTANT); }
{D}+"."{D}*({E})?{FS}? { return(CONSTANT); }
-L?\"(\\.|[^\\"])*\" { return(STRING_LITERAL); }
+\"(\\.|[^\\"])*\" { return(STRING_LITERAL); }
+L\"(\\.|[^\\"])*\" { return(WIDE_STRING_LITERAL); }
"..." { return(ELLIPSIS); }
">>=" { return(RIGHT_ASSIGN); }
private:
-yywrap()
+int yywrap()
{
return(1);
}
int commentCPP()
{
- int c, last = 0;
+ int c; //, last = 0;
for(;;)
{
c = input();
yylloc.end.charPos++;
yylloc.end.pos++;
}
- last = c;
+ //last = c;
}
yylloc.start = yylloc.end;
return 0;
if ( include_stack_ptr >= MAX_INCLUDE_DEPTH )
{
- fprintf( stderr, $"Includes nested too deeply" );
+ fprintf( stderr, "%s", $"Includes nested too deeply" );
exit( 1 );
}
yy_switch_to_buffer( yy_create_buffer( fileInput, YY_BUF_SIZE ) );
BEGIN(INITIAL);
}
- else
- printf("");
}
}
return 0;