updated errok placements
This commit is contained in:
2
Makefile
2
Makefile
@ -4,7 +4,7 @@ FLEX := flex
|
|||||||
BISON = bison
|
BISON = bison
|
||||||
|
|
||||||
CFLAGS := -ggdb
|
CFLAGS := -ggdb
|
||||||
BISONFLAGS := -d
|
BISONFLAGS := -d -Wcounterexamples
|
||||||
|
|
||||||
LEX := src/lexicalStructure.lex
|
LEX := src/lexicalStructure.lex
|
||||||
YACC := src/grammar.y
|
YACC := src/grammar.y
|
||||||
|
@ -106,7 +106,6 @@
|
|||||||
|
|
||||||
program:
|
program:
|
||||||
prototype_or_definition_list
|
prototype_or_definition_list
|
||||||
| error { yyerrok; }
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
@ -116,7 +115,8 @@ prototype_or_definition_list:
|
|||||||
| definition prototype_or_definition_list
|
| definition prototype_or_definition_list
|
||||||
| prototype
|
| prototype
|
||||||
| definition
|
| definition
|
||||||
| error { yyerrok; }
|
| prototype error { yyerrok; }
|
||||||
|
| definition error { yyerrok; }
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
@ -124,8 +124,6 @@ prototype_or_definition_list:
|
|||||||
prototype:
|
prototype:
|
||||||
L_PAREN EXTERNAL R_PAREN FUNCTION ID COLON ID
|
L_PAREN EXTERNAL R_PAREN FUNCTION ID COLON ID
|
||||||
|
|
||||||
| error { yyerrok; }
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
@ -356,8 +354,6 @@ idlist:
|
|||||||
printdebug("tag is %d", getAdInfoType(entry));
|
printdebug("tag is %d", getAdInfoType(entry));
|
||||||
}
|
}
|
||||||
|
|
||||||
| error { yyerrok; }
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
@ -406,8 +402,6 @@ sblock:
|
|||||||
R_BRACE
|
R_BRACE
|
||||||
{$$ = $5;}
|
{$$ = $5;}
|
||||||
|
|
||||||
| error { yyerrok; }
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
@ -427,7 +421,6 @@ dblock:
|
|||||||
}
|
}
|
||||||
declaration_list R_BRACKET
|
declaration_list R_BRACKET
|
||||||
|
|
||||||
| error { yyerrok; }
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -436,8 +429,7 @@ dblock:
|
|||||||
declaration_list:
|
declaration_list:
|
||||||
declaration SEMI_COLON declaration_list
|
declaration SEMI_COLON declaration_list
|
||||||
| declaration
|
| declaration
|
||||||
|
| error SEMI_COLON { yyerrok; } declaration_list //only perform error recovery once we see semi-colon
|
||||||
| error { yyerrok; }
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -478,8 +470,6 @@ declaration:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
| error { yyerrok; }
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
@ -497,8 +487,6 @@ id_or_types:
|
|||||||
$$ = (TableNode*)$1;
|
$$ = (TableNode*)$1;
|
||||||
}
|
}
|
||||||
|
|
||||||
| error { yyerrok; }
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
@ -550,6 +538,7 @@ compound_statement statement_list {
|
|||||||
| simple_statement SEMI_COLON {
|
| simple_statement SEMI_COLON {
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
}
|
}
|
||||||
|
| error SEMI_COLON { yyerrok; } statement_list { $$ = $4; }
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -631,8 +620,8 @@ simple_statement:
|
|||||||
|
|
||||||
|
|
||||||
| RETURN expression {$$ = getTypeEntry((TableNode*)$2);}
|
| RETURN expression {$$ = getTypeEntry((TableNode*)$2);}
|
||||||
|
|simple_statement error {yyerrok; printdebug("error in simple statement");}
|
||||||
|
|
||||||
| error { yyerrok; }
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -641,7 +630,6 @@ simple_statement:
|
|||||||
rec_op:
|
rec_op:
|
||||||
DOT
|
DOT
|
||||||
|
|
||||||
| error { yyerrok; }
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -653,7 +641,6 @@ ablock:
|
|||||||
printdebug("ablock is %d", $$);
|
printdebug("ablock is %d", $$);
|
||||||
}
|
}
|
||||||
|
|
||||||
| error { yyerrok; }
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -674,7 +661,6 @@ argument_list:
|
|||||||
$$ = 1; printdebug("[ARGUMENT_LIST] argument list is %d", $$);
|
$$ = 1; printdebug("[ARGUMENT_LIST] argument list is %d", $$);
|
||||||
}
|
}
|
||||||
|
|
||||||
| error { yyerrok; }
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -873,8 +859,6 @@ expression:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
| error { yyerrok; }
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
//UPDATED $$ for tablenodes to this point
|
//UPDATED $$ for tablenodes to this point
|
||||||
@ -1058,7 +1042,6 @@ assignable:
|
|||||||
printdebug("[ASSIGNABLE - RULE 3] record = name: %s | field = %s", getName((TableNode*)($1)), getName((TableNode*)$3));
|
printdebug("[ASSIGNABLE - RULE 3] record = name: %s | field = %s", getName((TableNode*)($1)), getName((TableNode*)$3));
|
||||||
}
|
}
|
||||||
|
|
||||||
| error { yyerrok; }
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -1075,7 +1058,6 @@ memOp:
|
|||||||
printdebug("release expression");
|
printdebug("release expression");
|
||||||
}
|
}
|
||||||
|
|
||||||
| error { yyerrok; }
|
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -1260,3 +1242,4 @@ void yyerror(const char *err) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user