Expand description
The grammar feature union forms (docs/grammar/feature-union.md).
One table describes every expression kind, every operation of the scanner
and action language and every grammar declaration the feature union adds,
and the native listing, links and JSON codecs read and write them from
that table, so the serializations stay in step with each other and with
js/src/grammar-feature-forms.js.
Structs§
- Feature
Form - One feature expression form or one operation: a head word and its field
values, in the order of
FEATURE_EXPRESSION_FORMSorOPERATION_FORMS. - Grammar
Declarations - The grammar-level declarations of the feature union.
- Grammar
Macro - A macro declaration:
macro NAME(P, ...) = EXPRESSION. - Grammar
Scanner - An external scanner declaration.
- Rule
Attributes - The optional parts of a rule the feature union adds.
Enums§
- Byte
Class Item - One item of a byte class.
- Feature
Expr - An expression of the grammar feature union.
- Field
Type - The type of one field of a feature form or an operation.
- Field
Value - The value of one field of a feature form or an operation.
- Operation
Category - Whether an operation is a statement, a condition or a value.
- Precedence
Entry - One entry of a precedence order: a named precedence or a rule, whose productions it ranks.
- Unicode
Class Item - One item of a character class that names Unicode properties.
Constants§
- FEATURE_
EXPRESSION_ FORMS - The expression kinds the feature union adds, with their fields in listing order.
- MATCHING_
MODES - The ways a grammar may match: generalized (every alternative), PEG (first and greedy) or longest (generalized, ties going to the longer token).
- MAX_
INTEGER_ DIGITS - The longest integer a form may spell, in decimal digits.
- OPERATION_
FORMS - The operation language of external scanners, semantic actions and predicates, with each operation’s category and fields in listing order.
- SETTLING_
STEPS - The steps that settle two parses of one text that end alike, as a
grammar’s
(settling STEP ...)declares them.
Functions§
- check_
integer - Checks the text of an integer field: an optional
-and at most 15 digits. - class_
expression - A character class: a plain
GrammarExpr::CharClasswhen every item is a character or a range, otherwise aFeatureExpr::UnicodeClass. - default_
settling - The settling of a grammar that declares none, by its matching.
- feature_
expression_ fields - The fields of the feature expression form
head, when it is one. - operation_
form - The category and fields of the operation
head, when it is one. - settling_
problem - Why
stepsis no settling, orNone: every step is known and given once, and exactly the last one settles a tie.
Type Aliases§
- Form
Fields - The fields of one form, as
(key, type)pairs in listing order. - Operation
- One operation of the scanner and action language.