Changeset 468
- Timestamp:
- 02/08/16 21:15:53 (9 years ago)
- Location:
- cpp/frams/vm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/vm/framscript.l
r394 r468 23 23 %% 24 24 25 \$[0-9a-fA-F]+ {int i; sscanf(yytext+1,"%x",&i); framscriptlval.setInt(i); return CONSTANT;} 26 0x[0-9a-fA-F]+ {int i; sscanf(yytext+2,"%x",&i); framscriptlval.setInt(i); return CONSTANT;} 27 [0-9]+\.[0-9]* {framscriptlval.setDouble(atof(yytext)); return CONSTANT;} 28 [0-9]+ {framscriptlval.setInt(atoi(yytext)); return CONSTANT;} 29 [0-9]+\.[0-9]*[eE][+-]?[0-9]+ {framscriptlval.setDouble(atof(yytext)); return CONSTANT;} 30 [0-9]+*[eE][+-]?[0-9]+ {framscriptlval.setDouble(atof(yytext)); return CONSTANT;} 25 [0-9]+\.[0-9]* | 26 [0-9]+\.[0-9]*[eE][+-]?[0-9]+ | 27 [0-9]+*[eE][+-]?[0-9]+ {if (framscriptlval.parseNumber(yytext,TDouble)==(yytext+yyleng)) return CONSTANT; else { trctx.err->printf("Invalid floating point number: '%s', ",SString(yytext,yyleng).c_str()); return INVALID_NUMBER;} } 28 29 [0-9]+ | 30 0x[0-9a-fA-F]+ {if (framscriptlval.parseNumber(yytext,TInt)==(yytext+yyleng)) return CONSTANT; else { trctx.err->printf("Invalid integer: '%s', ",SString(yytext,yyleng).c_str()); return INVALID_NUMBER;} } 31 31 32 "null" {framscriptlval.setEmpty(); return CONSTANT;} 32 33 \"([^\\\"]|\\.)*\" {framscriptlval.setString(SString(yytext+1,yyleng-2));return CONSTANT;} -
cpp/frams/vm/framscript.y
r466 r468 37 37 38 38 %token CONSTANT 39 %token INVALID_NUMBER 39 40 40 41 %nonassoc ASSIGN_ADD ASSIGN_SUB ASSIGN_MUL ASSIGN_DIV ASSIGN_MOD
Note: See TracChangeset
for help on using the changeset viewer.