SyntheticTemplateAst class abstract

An AST node that was created programmatically (not from parsed source).

Synthetic ASTs are useful for:

  • Error fallback (parser can add nodes that were missing but expected)
  • Testing (i.e. comparing actual parsed nodes to expected synthetic ones)
  • Transformation (modifying an AST tree that originally was parsed)
Implemented types

Constructors

SyntheticTemplateAst()
Create a synthetic AST that has no origin from parsed source.
const
SyntheticTemplateAst.from(TemplateAst? origin)
Create a synthetic AST that originated from another AST node.
const

Properties

beginToken NgToken?
First token that was used to form this AST.
no setteroverride
childNodes List<StandaloneTemplateAst>
Child nodes, if any.
no setteroverride
endToken NgToken?
Last token that was used to form this AST.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
isParent bool
Whether this node is capable of containing children and does.
no setteroverride
isStandalone bool
Whether this node needs to be 'attached' to another node to be valid.
no setteroverride
isSynthetic bool
Whether this node did not truly originate from the parsed source.
final
origin TemplateAst?
What AST node this node originated from (before transformation); optional.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sourceSpan → SourceSpan
Segment of source text from which the AST was parsed from.
no setteroverride
sourceUrl String?
no setteroverride

Methods

accept<R, C>(TemplateAstVisitor<R, C> visitor, [C context]) → R?
Have the visitor start visiting this node.
inherited
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