miho / VMF-Text

Powerful Grammar-based Language Modeling Framework
Apache License 2.0
10 stars 0 forks source link

Error if labeling a simple . #8

Open miho opened 4 years ago

miho commented 4 years ago

parser rules that label a simple ., e.g., myLabel=. cause compile error in generated code since terminal symbol is not recognized properly.

Example:


textToExpand:

    (definitions+=MACRO_DEFS | calls+=MACRO_CALL | ignored+='\\##(call)>' | ignored+='\\<##(call)' | ignored+=.)*

    EOF
;

For a label called myLabel the generated code contains the following hint:

/*FIXME: TYPE IS UNDEFINED! ruleText='myLabel+=.' */

miho commented 4 years ago

Since ANTLR4 generates broken code for such a grammar, we will forbid labeling . for now. This needs further investigation.