Hello,
I have been working on creating a DCG gammar for protobuf syntax (BNFs). and want to implement a look ahead rule, where a grammar rule looks to identify a keyword on the current line (i.e. up until the next semi colon).
I noticed that some seem to use phrase but its unclear to me how phrase can access the current unconsumed tail, also what head to use in phrase is not so clear.
E.g. i want to look ahead if a line includes the keyword “syntax” or “package” …
all comments are much appreciated,
Dan