parrotcode: A PIR grammar for PGE. | |
Contents | Language Implementations | PIR |
pir.pg - A PIR grammar for PGE.
TODO:
1. fix Heredocs parsing
2. Test and fix things
The comma to separate the sub pragmas is optional.
This one is not sure yet
Local declarations can be done using .sym
or .local
in normal context. In macro context however, only .sym
is allowed, and the .local
keyword indicates a label declaration.
Const definitions, a check is done for the constant type and the type of the constant value.
In order to be able to parse macro identifiers, before the macro body is parsed, some rules are redefined. After parsing the macro body, they are restored.
this is a token, because no spaces are allowed between the id and the colon.
In a macro, a target can also be a macro_id
match the set of a newline and possible indention space 1 or more times this is necessary to be able to skip fully white lines (with some spaces/tabs in it). However, therefore it is also necessary to put the comments skipping here as well.
PIR directives, PASM instructions and the Parrot datatypes (int, string, num, pmc) are keywords, and must not be used as identifiers.
TODO: put this in <%pir_directive> PIR directives
|