ID being anything except Newlines creating problems [message #1698680] |
Wed, 17 June 2015 08:55 |
Anton Bergman Messages: 34 Registered: June 2015 |
Member |
|
|
In my grammar, I want ID's to be any character, except it has to be on a single line of code.
I also want some kind of string, which would be any following of characters and it can be on several lines.
My terminals so far looks like this:
terminal NEWLINE : ('\r'? '\n');
terminal ID : !(NEWLINE);
This alone creates a lot of errors:
error(100): ../org.xtext.plantuml/src-gen/org/xtext/parser/antlr/internal/InternalPlantuml.g:0:0: syntax error: buildnfa: <AST>:2074:16: unexpected AST node: ?
error(100): ../org.xtext.plantuml/src-gen/org/xtext/parser/antlr/internal/InternalPlantuml.g:0:0: syntax error: buildnfa: <AST>: expecting EOA, found '<empty tree>'
error(139): ../org.xtext.plantuml/src-gen/org/xtext/parser/antlr/internal/InternalPlantuml.g:2076:11: set complement is empty
error(208): ../org.xtext.plantuml/src-gen/org/xtext/parser/antlr/internal/InternalPlantuml.g:2076:1: The following token definitions can never be matched because prior tokens match the same input: RULE_ID
error(100): ../org.xtext.plantuml.ui/src-gen/org/xtext/ui/contentassist/antlr/internal/InternalPlantuml.g:0:0: syntax error: buildnfa: <AST>:4841:16: unexpected AST node: ?
error(100): ../org.xtext.plantuml.ui/src-gen/org/xtext/ui/contentassist/antlr/internal/InternalPlantuml.g:0:0: syntax error: buildnfa: <AST>: expecting EOA, found '<empty tree>'
error(139): ../org.xtext.plantuml.ui/src-gen/org/xtext/ui/contentassist/antlr/internal/InternalPlantuml.g:4843:11: set complement is empty
error(208): ../org.xtext.plantuml.ui/src-gen/org/xtext/ui/contentassist/antlr/internal/InternalPlantuml.g:4843:1: The following token definitions can never be matched because prior tokens match the same input: RULE_ID
Also when I try to add some kind of multiline string I get a lot of different errors. How would one do this in an easy way?
Thanks!
[Updated on: Wed, 17 June 2015 08:56] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02839 seconds