Built-in Function
Four things are matched so often that APM builds them in. They are functions, not actions you declare: write the name, with no parentheses.
Action |
Matches |
|---|---|
|
one space or tab |
|
one line break |
|
the end of a line: a line break, or the end of the input |
|
the end of the input, matching zero width |
line := <A:Z>+ . eol;
last := <A:Z>+ . eof;
eol and eof
eol succeeds at a line break or at the end of the input, and consumes the
line break when that is what it found. eof succeeds only where there is
nothing left, and consumes nothing — it is a check on position, not a match on
text.
So eol is what a line-oriented grammar wants, and eof is how you insist the
whole input was used.