meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
include [2020/02/22 00:07] – [Wrinkles with Code Injection] revusky | include [2020/12/18 08:40] – revusky | ||
---|---|---|---|
Line 19: | Line 19: | ||
Thus, JavaCC 21 introduces a setting called **DEFAULT_LEXICAL_STATE**. That means that any lexical specifications where the lexical state is unspecified are in that state. Thus, a JSON grammar would likely have something like this at the top: | Thus, JavaCC 21 introduces a setting called **DEFAULT_LEXICAL_STATE**. That means that any lexical specifications where the lexical state is unspecified are in that state. Thus, a JSON grammar would likely have something like this at the top: | ||
- | options { | + | |
- | | + | DEFAULT_LEXICAL_STATE=" |
- | } | + | |
| | ||
In that case, any grammar for a language that wants to handle embedded JSON data would presumably define its own " | In that case, any grammar for a language that wants to handle embedded JSON data would presumably define its own " | ||
Line 34: | Line 34: | ||
INJECT(**PARSER_CLASS**) : | INJECT(**PARSER_CLASS**) : | ||
- | { | ||
- | ... | ||
- | } | ||
{ | { | ||
... | ... | ||
Line 44: | Line 41: | ||
INJECT(**LEXER_CLASS**) : | INJECT(**LEXER_CLASS**) : | ||
- | { | ||
- | ... | ||
- | } | ||
{ | { | ||
... | ... | ||
Line 54: | Line 48: | ||
INJECT(JSONParser) : | INJECT(JSONParser) : | ||
- | { | ||
- | ... | ||
- | } | ||
{ | { | ||
... | ... |