Move support for embedded languages into dedicated grammars
Status: Beta
Brought to you by:
kdeschut
Cfr. discussion on ticket [#39].
The idea for is to set up separate grammars/parsers for the embedded languages such as CICS and SQL, using whichever technology is most appropriate, and then link to those from within the Cobol grammar. Syntactically it could look something like this:
EXEC SQL (--SQLGrammar.sqlStatement--> END-EXEC) END-EXEC
So, skip up to the END-EXEC token, and then try parsing the skipped tokens as an sqlStatement defined by an SQLGrammar.
Possibly a nice bonus feature is that you can choose whether or not you want a given embedded language to get parsed. If not we can just fall back to the existing semantics of skipping.
Diff:
This has been started, but is missing some syntactic sugar to make it nicer.
All missing syntactic sugar was added, wasn't it?
No, there are some hand-written forwarding methods in CobolBaseGrammar to make up for the missing syntax.
Added syntax in [r384]. E.g.
Related
Commit: [r384]