Glossary
- AST
Abstract syntax tree, the intermediary representation created after parsing.
- Grammar
A set of productions used to specify the structure of a language.
- Grammar Production
A substitution rule with a head (non-terminal) and a body (sequence of terminals/non-terminals).
- Grammar Variables [1]
Variables created based on the symbols used in a grammar production. These can be terminal variables or non-terminal variables. If the same symbol is used multiple times, then the variable will be a list of the occurrences.
- Lexer
A program used to break an input string up into syntactic units called tokens.
- Non-terminal
A symbol used to represent a set of strings that can be generated by reducing it according to grammar productions.
- Non-terminal Variable [1]
A function for a specific non-terminal that can be used to traverse the AST. This function will execute and return a value from the code block with the same name.
- Panic-mode
An error recovery strategy that pops symbols off the parsing stack until a state with a special error token is reached (by using the error token in grammar productions). At this point any invalid token is discarded until the next valid token can be shifted onto the stack or the grammar production can be reduced.
- Parser
A program used to verify the structure of a sequence of tokens, and create an intermediary representation such as an AST
- System Configuration [1]
The directory located at
~/.serlwhich is used to store system-wide languages and environments.- Terminal
A concrete symbol used within the syntax of a language.
- Terminal Variable [1]
A tuple of regex captures for a specific token with the first element being the entire token match. This tuple object also has access to the
linenoandcolproperty which represent the line number and column of the token in source (1-indexed).- Token
Synonymous with terminal, but usually with some notion of type.
- Token Expansion [1]
The name of the procedure called to substitute token patterns referenced in other tokens by their token identifier.
See Compilers: Principles, Techniques, and Tools to learn more terminology and methods relating to language compilers.
Footnotes