diff options
author | Brad King <brad.king@kitware.com> | 2016-09-05 15:22:30 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-09-08 13:40:02 (GMT) |
commit | 1619fb46a88accd1e6864f0c9de27ae2fd46541a (patch) | |
tree | 3ef06b414a3f0a5cf1d7c42bcd44147145958027 /Source/cmFortranParser.y | |
parent | f506489d1ed222761f9ce752144a458290020e55 (diff) | |
download | CMake-1619fb46a88accd1e6864f0c9de27ae2fd46541a.zip CMake-1619fb46a88accd1e6864f0c9de27ae2fd46541a.tar.gz CMake-1619fb46a88accd1e6864f0c9de27ae2fd46541a.tar.bz2 |
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.
Diffstat (limited to 'Source/cmFortranParser.y')
-rw-r--r-- | Source/cmFortranParser.y | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/Source/cmFortranParser.y b/Source/cmFortranParser.y index f8d461e..686d2f4 100644 --- a/Source/cmFortranParser.y +++ b/Source/cmFortranParser.y @@ -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 */ ; |