ReadonlyidThe id of this node in its set. Corresponds to the term ids used in the parser.
ReadonlynameThe name of the node type. Not necessarily unique, but if the grammar was written properly, different node types with the same name within a node set should play the same semantic role.
StaticnoneAn empty dummy node type to use when no actual type is available.
When true, this node type doesn't correspond to a user-declared named node, for example because it is used to cache repetition.
Indicates whether this is an error node.
True when this node is produced by a skip rule.
True when this is the top node of a grammar.
Returns true when this node's name or one of its groups matches the given string.
StaticdefineDefine a node type.
Optionalerror?: booleanWhether this node counts as an error node.
The ID of the node type. When this type is used in a set, the ID must correspond to its index in the type array.
Optionalname?: stringThe name of the node type. Leave empty to define an anonymous node.
Optionalprops?: readonly ([NodeProp<any>, any] | NodePropSource)[]Node props to assign to the type. The value given for any given prop should correspond to the prop's type.
Optionalskipped?: booleanWhether this node is a skipped node.
Optionaltop?: booleanWhether this is a top node.
StaticmatchCreate a function from node types to arbitrary values by
specifying an object whose property names are node or
group names. Often useful with
NodeProp.add. You can put multiple
names, separated by spaces, in a single property name to map
multiple node names to a single value.
Each node in a syntax tree has a node type associated with it.