LanguageDefinition class final

A language described as a set of named lexer states.

Every state is an ordered list of LexRules; the first rule that matches at the current position wins. The state named root is the initial state. Multi-line constructs (block comments, triple-quoted strings) are modelled by rules that switch to another state and back.

Constructors

LanguageDefinition({required String name, required Map<String, List<LexRule>> states, List<String> aliases = const []})
Creates a language definition.
const

Properties

aliases → List<String>
Other names that select this language, e.g. js for javascript.
final
hashCode → int
The hash code for this object.
no setterinherited
name → String
The canonical, lower-case name, e.g. dart.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
states → Map<String, List<LexRule>>
The lexer states, keyed by name. Must contain root.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited