It gives error "mismatched charachter 'n' expections 's'" at int. It want me to write isOptional instead of int. I've tried changed '"isOptional"' to '"optional"' in the grammar, which fixes the issue. But I'm curious about why I get the error, and why changing the keyword fixes it. Any ideas?]]>M D2021-03-02T17:49:21-00:00Re: Mismatched character
https://www.eclipse.org/forums/index.php/mv/msg/1107140/1838640/#msg_1838640
'"isOptional"' vs '"' 'int' '"'
e.g.
Object:
'{' '"name"' ':' '"' name = STRING '"' ','
'"type"' ':' '"object"' ','
'"isOptional"' ':' value = BOOLEAN ','
'"dataType"' ':' dataType = PREDEFINED_TYPE '}'
;
terminal PREDEFINED_TYPE:
'"' ('String' | 'int' | 'float' | 'boolean')'"'
;]]>Christian Dietrich2021-03-02T18:37:19-00:00Re: Mismatched character
https://www.eclipse.org/forums/index.php/mv/msg/1107140/1838645/#msg_1838645
Why exactly can it not not differ '"isOptional"' vs '"' 'int' '"'?]]>M D2021-03-02T20:18:39-00:00Re: Mismatched character
https://www.eclipse.org/forums/index.php/mv/msg/1107140/1838649/#msg_1838649
The file is Lexed completely first
Thus when the Lexer see
"i it goes the "isOptional path as it is greedy and won't create two tokens one for " and one for int ]]>Christian Dietrich2021-03-03T04:26:55-00:00Re: Mismatched character
https://www.eclipse.org/forums/index.php/mv/msg/1107140/1838670/#msg_1838670
I've encountered another problem. I try to make it so the user can define their own types. dataType can then either be a predefined type or an already defined type.
If I do the following, I get a "NullPointerException: null" at the beginning of the grammar. You know why?
terminal STRING: "'" ( '\\' . /* 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' */ | !('\\'|"'") )* "'";]]>M D2021-03-03T11:03:57-00:00Re: Mismatched character
https://www.eclipse.org/forums/index.php/mv/msg/1107140/1838800/#msg_1838800
M D2021-03-05T08:47:39-00:00Re: Mismatched character
https://www.eclipse.org/forums/index.php/mv/msg/1107140/1838801/#msg_1838801
without a stacktrace hard to jude