I need to parse the command shell such as:
cp /home/test /home/test2
My problem is in the correct path parsing.
I defined a rule (I can not use a token as path but I need to define it in the parser):
path : ('/' ID)+;
with
ID: (A.. Z | a.. z) +;
WS: (' ') {$channel = HIDDEN;};
I need to keep the token WS hidden, but this gives me the problem that the 2 paths in this example are considered as a single path.
How can I solve this problem?
Thanks