Keywords
Every word APML spells out, grouped by what it is for.
All of them are reserved. A keyword cannot be the name of an action, an alias, a variable, a semvar, a scope, a binding-power table, a linked module or a capture label.
node_id = "x"; # refused: 'node_id' is a reserved word
node_ident = "x"; # fine -- containing a keyword is not being one
Module & Parsers
|
names this module |
|
calls into another module |
Entry Point
|
the block holding the start grammar |
Primitive
|
one character, whatever it is |
Built-in Functions
|
space, line break, end of line, end of input |
Configuration
|
settings for the whole grammar |
|
settings for one declaration |
Variable
|
declare a text or number variable |
Semantic Predicate
|
a set the grammar builds and matches against |
|
empty a set |
|
a depth the input moves |
|
a scope’s two edges |
|
read a name as though it were already declared |
Abstract Syntax Tree
|
a node nothing matched |
|
rename what an action is saved as |
Text Functions
|
the namespace they live under |
|
any order, one of, ignoring case |
Result Functions
|
equals, does not equal, contains |
|
narrow to a section of what matched |
|
characters, value, repetitions |
|
the earliest member of a semvar |
System Functions
|
stop the whole parse |
Logic
|
the operators, written as words |
Values
|
one and zero |
Units & Control
|
members in any order |
|
with a counter: repeat until this matches ( |
|
branch on a test or on whether something parses |
|
a name for a literal value |
|
an operator precedence table |
|
bind a bodiless action to your C code |
Note
Nothing forces reservation. APM is scannerless, so perm only reads as a
keyword before a [, and the parser could tell the two uses apart perfectly
well. It is reserved because the reader is not a parser — a grammar in which
part is sometimes a result function and sometimes a rule is one nobody can
skim.
See also
The original APG used @<name> commands precisely to avoid reserved words.
APM took the opposite trade: familiar keywords, and a short list of names you
cannot use. See Overview.