meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
include [2020/04/25 18:15] – external edit 127.0.0.1include [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="JSON"; +    DEFAULT_LEXICAL_STATE="JSON"; 
-    }+
          
 In that case, any grammar for a language that wants to handle embedded JSON data would presumably define its own "default" lexical state, and when it wants to embedded JSON data, would have to make an explicit switch to that JSON lexical state that is the *default* in the included grammar. In that case, any grammar for a language that wants to handle embedded JSON data would presumably define its own "default" lexical state, and when it wants to embedded JSON data, would have to make an explicit switch to that JSON lexical state that is the *default* in the included grammar.
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) :
-    { 
-       ... 
-    } 
     {     {
        ...        ...