C# Class Antlr4.Runtime.Tree.Pattern.TagChunk

Represents a placeholder tag in a tree pattern.
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 .
  • e:expr : A labeled placeholder for a parser rule expr .
  • 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: Chunk
Datei anzeigen Open project: antlr/antlr4 Class Usage Examples

Private Properties

Property Type Description

Public Methods

Method Description
TagChunk ( string tag ) : System

Construct a new instance of TagChunk using the specified tag and no label.

TagChunk ( string label, string tag ) : System

Construct a new instance of TagChunk using the specified label and tag.

ToString ( ) : string

This method returns a text representation of the tag chunk.

This method returns a text representation of the tag chunk. Labeled tags are returned in the form label:tag , and unlabeled tags are returned as just the tag name.

Method Details

TagChunk() public method

Construct a new instance of TagChunk using the specified tag and no label.
/// IllegalArgumentException /// if /// /// is /// /// or /// empty. ///
public TagChunk ( string tag ) : System
tag string /// The tag, which should be the name of a parser rule or token /// type. ///
return System

TagChunk() public method

Construct a new instance of TagChunk using the specified label and tag.
/// IllegalArgumentException /// if /// /// is /// /// or /// empty. ///
public TagChunk ( string label, string tag ) : System
label string /// The label for the tag. If this is /// /// , the /// /// represents an unlabeled tag. ///
tag string /// The tag, which should be the name of a parser rule or token /// type. ///
return System

ToString() public method

This method returns a text representation of the tag chunk.
This method returns a text representation of the tag chunk. Labeled tags are returned in the form label:tag , and unlabeled tags are returned as just the tag name.
public ToString ( ) : string
return string