I'm trying to parse with ANTLR 4 a line like this:
circle 'my circle' : posx = '800'; posy = '640';
I want to able to parse it without taking care of spaces, tabs and new line in it, eg:
circle'my circle':posx='800';posy='640';
or
circle
'my circle':
posx='800'; posy=
'640'
My grammar at the moment is:
grammar Circle;
prog
: statement*
;
statement
: circle
;
circle
: INDENT? 'circle' '\'' VALUES '\'' ':' params
;
params
: param+
;
param
: ARG '=' '\'' VALUES '\'' ';'
;
INDENT : [ \t]+;
VALUES : ARG (ARG)* ;
ARG : [a-zA-Z0-9]+;
WS : [ \t\n\r]+ -> skip;
Anyway trying to parse this:
circle 'my circle' : posx='800'; posy = '640';
I got:
line 1:5 mismatched input ' ' expecting '''
Any idea about how to fix the grammar to parse the line text above skipping spaces, tabs, returns in the middle of the line?