parrotcode: a Lua 5.1 grammar in PGE | |
Contents | Language Implementations | Lua |
lua.pg - a Lua 5.1 grammar in PGE
The grammar rules are according to the original Lua parser as defined lparser.c in the lua distribution.
Operator precedence is implemented using an optable.
Helper rules will match a specific token, otherwise a syntax error is generated. These rules make the grammar more readable, so the calls to syntax_error() are not all over the grammar, but only in these rules.
A string can be either a single-quoted, double-quoted or a long string. Long strings are parsed using a custom parsing method.
Klaas-Jan Stol <parrotcode@gmail.com>
|