
2 Mar
2011
2 Mar
'11
8:14 a.m.
Thank you all for the responses. Here's an example: As I alrerady said, I tried to parse the MMIXAL assembly language. Each instruction has up to three operands, looking like this: @+4 (Jump for bytes forward) "foo" (the string foo" '0'>>(1+2) etc. A string literal may contain anything but a newline, (there are no escape codes or similar). But when I add a check for a newline, the parser just fails and the next one is tried. This is undesired, as I want to return an error like "unexpected newline" instead. How is this handled in other parsers?