InternedGreen<E, Tok, Syn> class
final
Runs inner and interns its produced green through the parse-scoped
GreenCache, replacing the value with the canonical instance so
structurally-equal greens across the parse collapse to one heap object.
Opt-in via the internToken / internTree combinators. Same
one-case-one-handler integration as Memo: the interpreter reads the
cache from ParserState; no other parser case threads it.
Constructors
-
InternedGreen(Parser<
E, GreenNode< inner)Tok, Syn> > -
Creates an interning wrapper.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
inner
→ Parser<
E, GreenNode< Tok, Syn> > -
The parser whose produced green is interned.
final
- isSimple → bool
-
True if this parser cannot consume input on failure.
Used to skip save/restore in Many/Choice/Or loops.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
interpretWith(
Result< E, GreenNode< run<T0, S0> >T0, S0>(InternedGreen< ) → Result<E, T0, S0> )E, GreenNode< Tok, Syn> > -
Dispatch to the interpreter with
Tok/Synreified. Mirrors the pattern used by Mapped/Zip/Pratt: routing through this instance method keeps the receiver's generic parameters at runtime, so the handler produces aResult<E, GreenNode<Tok, Syn>>with the precise types rather thanGreenNode<dynamic, dynamic>(which would not cast back under Dart's invariant generics). -
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