public class ProgramElementName extends Name implements TerminalProgramElement, Label, ReferenceSuffix, MethodName
Modifier and Type | Field and Description |
---|---|
private Comment[] |
comments |
private NameCreationInfo |
creationInfo |
private java.lang.String |
qualifierString |
private java.lang.String |
shortName |
Constructor and Description |
---|
ProgramElementName(java.lang.String name)
create a new name
|
ProgramElementName(java.lang.String name,
Comment[] c)
create a new name
|
ProgramElementName(java.lang.String name,
NameCreationInfo creationInfo) |
ProgramElementName(java.lang.String name,
NameCreationInfo creationInfo,
Comment[] c) |
ProgramElementName(java.lang.String n,
java.lang.String q) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
boolean |
equalsModRenaming(SourceElement se,
NameAbstractionTable nat)
equals modulo renaming is described in the corresponding
comment in class SourceElement.
|
Comment[] |
getComments()
Get comments.
|
NameCreationInfo |
getCreationInfo() |
Position |
getEndPosition()
Returns the end position of the primary token of this element.
|
SourceElement |
getFirstElement()
to be compatible to a ProgramElement
|
SourceElement |
getFirstElementIncludingBlocks()
Finds the source element that occurs first in the source.
|
SourceElement |
getLastElement()
to be compatible to a ProgramElement
|
PositionInfo |
getPositionInfo()
complete position information
|
java.lang.String |
getProgramName() |
java.lang.String |
getQualifier() |
Position |
getRelativePosition()
Returns the relative position (number of blank heading lines and
columns) of the primary token of this element.
|
Position |
getStartPosition()
Returns the start position of the primary token of this element.
|
int |
hashCode() |
MatchConditions |
match(SourceData source,
MatchConditions matchCond)
matches the source "text" (@link SourceData#getSource()) against the pattern represented
by this object.
|
void |
prettyPrint(PrettyPrinter w)
Pretty print.
|
void |
visit(Visitor v)
calls the corresponding method of a visitor in order to
perform some action/transformation on this element
|
private final java.lang.String qualifierString
private final java.lang.String shortName
private final NameCreationInfo creationInfo
private final Comment[] comments
public ProgramElementName(java.lang.String name)
name
- the String with the name of the program elementpublic ProgramElementName(java.lang.String name, Comment[] c)
name
- the String with the name of the program elementpublic ProgramElementName(java.lang.String name, NameCreationInfo creationInfo)
public ProgramElementName(java.lang.String name, NameCreationInfo creationInfo, Comment[] c)
public ProgramElementName(java.lang.String n, java.lang.String q)
public Comment[] getComments()
ProgramElement
getComments
in interface Label
getComments
in interface ProgramElement
public SourceElement getFirstElement()
getFirstElement
in interface Label
getFirstElement
in interface SourceElement
SourceElement.getStartPosition()
public SourceElement getFirstElementIncludingBlocks()
SourceElement
getFirstElementIncludingBlocks
in interface SourceElement
SourceElement.getStartPosition()
public SourceElement getLastElement()
getLastElement
in interface Label
getLastElement
in interface SourceElement
SourceElement.getEndPosition()
public void prettyPrint(PrettyPrinter w) throws java.io.IOException
SourceElement
prettyPrint
in interface Label
prettyPrint
in interface SourceElement
w
- a pretty printer.java.io.IOException
- occasionally thrown.public void visit(Visitor v)
visit
in interface Label
visit
in interface SourceElement
v
- the Visitorpublic Position getStartPosition()
getFirstElement()
.getStartPosition
in interface Label
getStartPosition
in interface SourceElement
public Position getEndPosition()
getLastElement()
.getEndPosition
in interface Label
getEndPosition
in interface SourceElement
public Position getRelativePosition()
getFirstElement()
.getRelativePosition
in interface Label
getRelativePosition
in interface SourceElement
public PositionInfo getPositionInfo()
SourceElement
getPositionInfo
in interface SourceElement
public boolean equalsModRenaming(SourceElement se, NameAbstractionTable nat)
equalsModRenaming
in interface SourceElement
public java.lang.String getQualifier()
public java.lang.String getProgramName()
public NameCreationInfo getCreationInfo()
public MatchConditions match(SourceData source, MatchConditions matchCond)
ProgramElement
MatchConditions
with
the found instantiations of the schemavariables. If the match
failed, null is returned instead.match
in interface ProgramElement
source
- the SourceData with the program element to matchmatchCond
- the MatchConditions found up to this point