class TagChunk extends Chunk
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.| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
label
This is the backing field for
getLabel(). |
private java.lang.String |
tag
This is the backing field for
getTag(). |
| Constructor and Description |
|---|
TagChunk(java.lang.String tag)
Construct a new instance of
TagChunk using the specified tag and
no label. |
TagChunk(java.lang.String label,
java.lang.String tag)
Construct a new instance of
TagChunk using the specified label
and tag. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getLabel()
Get the label, if any, assigned to this chunk.
|
java.lang.String |
getTag()
Get the tag for this chunk.
|
java.lang.String |
toString()
This method returns a text representation of the tag chunk.
|
private final java.lang.String tag
getTag().private final java.lang.String label
getLabel().public TagChunk(java.lang.String tag)
TagChunk using the specified tag and
no label.tag - The tag, which should be the name of a parser rule or token
type.java.lang.IllegalArgumentException - if tag is null or
empty.public TagChunk(java.lang.String label,
java.lang.String tag)
TagChunk using the specified label
and tag.label - The label for the tag. If this is null, the
TagChunk represents an unlabeled tag.tag - The tag, which should be the name of a parser rule or token
type.java.lang.IllegalArgumentException - if tag is null or
empty.public final java.lang.String getTag()
public final java.lang.String getLabel()
null if no label is
assigned to the chunk.public java.lang.String toString()
label:tag, and unlabeled tags are
returned as just the tag name.toString in class java.lang.Object