Negative lookaheads in Grammar-Kit

305 Views Asked by At

Is there a way to do a negative lookahead in Grammar-kit?

Example: I have two tokens defined A and B and would like the define the a rule that matches A if it is not followed by B.

I tried to find it in this grammar, but I am not able to read it.

1

There are 1 best solutions below

0
On BEST ANSWER

Grammar-Kit is based on PEG (Parsing Expression Grammars).

  • Positive lookahead: &XXX
  • Negative lookahead: !XXX