TagChunk class

Represents a placeholder tag in a tree pattern. A tag can have any of the following forms.

  • [expr]: An unlabeled placeholder for a parser rule [expr].
  • [ID]: An unlabeled placeholder for a token of type [ID].
  • {@code e:expr}: A labeled placeholder for a parser rule [expr].
  • {@code id:ID}: A labeled placeholder for a token of type [ID].

This class does not perform any validation on the tag or label names aside from ensuring that the tag is a non-null, non-empty string.

Inheritance

Constructors

TagChunk(String tag, {String? label})
Construct a new instance of TagChunk using the specified label and tag.

Properties

hashCode int
The hash code for this object.
no setterinherited
label String?
The label assigned to this chunk, or null if no label is assigned to the chunk.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tag String
The tag for the chunk.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
This method returns a text representation of the tag chunk. Labeled tags are returned in the form {@code label:tag}, and unlabeled tags are returned as just the tag name.
override

Operators

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