1

this may be a very simple question but I am struggling heavily just matching the pipe character in my Grammar File. My grammar involves the following:

pipeCommand : call (PIPE call)+
            ;

where call can match any string not including '|'. I have also defined PIPE as:

PIPE : '|';

When testing my the grammar using with the input echo | test, I receive the error:

line 1:5 mismatched input '|' expecting '|'

I am unable to find anything so far to solve the problem. Is this a problem with lexing modes or I am completely wrong? Many thanks in advance.

Largecooler21
  • 147
  • 3
  • 12
  • 1
    There is a rule before your `|` rule that too matches the pipe char. Similar to this: https://stackoverflow.com/questions/31254455/antlr-mismatched-input – Bart Kiers Nov 02 '21 at 05:44

0 Answers0