Remove 'state' keyword from compiler (bug 4572, r=dvander).

This commit is contained in:
Ryan Stecker 2013-12-28 08:42:50 -05:00
parent bdbc3c3b58
commit b749bbf42b
4 changed files with 32 additions and 53 deletions

View File

@ -293,7 +293,7 @@ typedef struct s_stringpair {
*/
#define tFIRST 256 /* value of first multi-character operator */
#define tMIDDLE 280 /* value of last multi-character operator */
#define tLAST 333 /* value of last multi-character match-able token */
#define tLAST 332 /* value of last multi-character match-able token */
/* multi-character operators */
#define taMULT 256 /* *= */
#define taDIV 257 /* /= */
@ -350,40 +350,39 @@ typedef struct s_stringpair {
#define tRETURN 307
#define tSIZEOF 308
#define tSLEEP 309
#define tSTATE 310
#define tSTATIC 311
#define tSTOCK 312
#define tSTRUCT 313
#define tSWITCH 314
#define tTAGOF 315
#define tTHEN 316
#define tWHILE 317
#define tSTATIC 310
#define tSTOCK 311
#define tSTRUCT 312
#define tSWITCH 313
#define tTAGOF 314
#define tTHEN 315
#define tWHILE 316
/* compiler directives */
#define tpASSERT 318 /* #assert */
#define tpDEFINE 319
#define tpELSE 320 /* #else */
#define tpELSEIF 321 /* #elseif */
#define tpEMIT 322
#define tpENDIF 323
#define tpENDINPUT 324
#define tpENDSCRPT 325
#define tpERROR 326
#define tpFILE 327
#define tpIF 328 /* #if */
#define tINCLUDE 329
#define tpLINE 330
#define tpPRAGMA 331
#define tpTRYINCLUDE 332
#define tpUNDEF 333
#define tpASSERT 317 /* #assert */
#define tpDEFINE 318
#define tpELSE 319 /* #else */
#define tpELSEIF 320 /* #elseif */
#define tpEMIT 321
#define tpENDIF 322
#define tpENDINPUT 323
#define tpENDSCRPT 324
#define tpERROR 325
#define tpFILE 326
#define tpIF 327 /* #if */
#define tINCLUDE 328
#define tpLINE 329
#define tpPRAGMA 330
#define tpTRYINCLUDE 331
#define tpUNDEF 332
/* semicolon is a special case, because it can be optional */
#define tTERM 334 /* semicolon or newline */
#define tENDEXPR 335 /* forced end of expression */
#define tTERM 333 /* semicolon or newline */
#define tENDEXPR 334 /* forced end of expression */
/* other recognized tokens */
#define tNUMBER 336 /* integer number */
#define tRATIONAL 337 /* rational number */
#define tSYMBOL 338
#define tLABEL 339
#define tSTRING 340
#define tNUMBER 335 /* integer number */
#define tRATIONAL 336 /* rational number */
#define tSYMBOL 337
#define tLABEL 338
#define tSTRING 339
#define tEXPR 341 /* for assigment to "lastst" only (see SC1.C) */
#define tENDLESS 342 /* endless loop, for assigment to "lastst" only */
#define tEMPTYBLOCK 343 /* empty blocks for AM bug 4825 */

View File

@ -5730,10 +5730,6 @@ static void statement(int *lastindent,int allow_decl)
dosleep();
lastst=tSLEEP;
break;
case tSTATE:
dostate();
lastst=tSTATE;
break;
case tCONST:
decl_const(sLOCAL);
break;

View File

@ -1852,7 +1852,7 @@ char *sc_tokens[] = {
"assert", "*begin", "break", "case", "cellsof", "chars", "const", "continue", "default",
"defined", "do", "else", "*end", "enum", "exit", "for", "forward", "funcenum", "functag", "goto",
"if", "native", "new", "decl", "operator", "public", "return", "sizeof",
"sleep", "state", "static", "stock", "struct", "switch", "tagof", "*then", "while",
"sleep", "static", "stock", "struct", "switch", "tagof", "*then", "while",
"#assert", "#define", "#else", "#elseif", "#emit", "#endif", "#endinput",
"#endscript", "#error", "#file", "#if", "#include", "#line", "#pragma",
"#tryinclude", "#undef",

View File

@ -1703,22 +1703,6 @@ static int hier2(value *lval)
while (paranthese--)
needtoken(')');
return FALSE;
case tSTATE: {
constvalue *automaton;
constvalue *state;
if (sc_getstateid(&automaton,&state)) {
assert(automaton!=NULL);
assert((automaton->index==0 && automaton->name[0]=='\0') || automaton->index>0);
loadreg(automaton->value,sALT);
assert(state!=NULL);
ldconst(state->value,sPRI);
ob_eq();
clear_value(lval);
lval->ident=iEXPRESSION;
lval->tag=pc_addtag("bool");
} /* if */
return FALSE;
} /* case */
default:
lexpush();
lvalue=hier1(lval);