Commit 1619fb46 authored by Brad King's avatar Brad King
Browse files

cmFortranParser: Simplify grammar by skipping unknown statements

Our Fortran grammar is a bare minimum to extract dependencies.
Other statement syntax can be ignored, so simply skip to the
end of unrecognized statements.  This allows some of our existing
productions to be dropped.
parent f506489d
This diff is collapsed.
......@@ -102,14 +102,7 @@ static bool cmFortranParserIsKeyword(const char* word,
code: /* empty */ | code stmt;
stmt: keyword_stmt | assignment_stmt;
assignment_stmt:
WORD ASSIGNMENT_OP other EOSTMT {
free($1);
}
keyword_stmt:
stmt:
WORD EOSTMT {
if (cmFortranParserIsKeyword($1, "interface")) {
cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
......@@ -212,12 +205,8 @@ keyword_stmt:
cmFortranParser* parser = cmFortran_yyget_extra(yyscanner);
cmFortranParser_RuleEndif(parser);
}
| WORD GARBAGE other EOSTMT {
free($1);
}
| GARBAGE other EOSTMT
| EOSTMT
| error
| error EOSTMT /* tolerate unknown statements until their end */
;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment