public abstract class JavaNonTerminalProgramElement extends JavaProgramElement implements NonTerminalProgramElement
NonTerminalProgramElement.
taken from COMPOST and changed to achieve an immutable structureJavaProgramElement.NameAbstractionTableDisabled| Constructor and Description |
|---|
JavaNonTerminalProgramElement() |
JavaNonTerminalProgramElement(ExtList list)
Java program element.
|
JavaNonTerminalProgramElement(ExtList children,
PositionInfo pos) |
JavaNonTerminalProgramElement(PositionInfo pos) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
compatibleBlockSize(int pos,
int max)
used by @link matchChildren to decide if a found match is valid or if there are remaining
source elements that have not been matched (in which case the match failed)
|
protected int |
computeHashCode() |
boolean |
equals(java.lang.Object o) |
boolean |
equalsModRenaming(SourceElement se,
NameAbstractionTable nat)
commented in interface SourceElement.
|
protected int |
getArrayPos(ImmutableArray<ProgramElement> arr,
ProgramElement el)
returns the index of element el in array arr
|
MatchConditions |
match(SourceData source,
MatchConditions matchCond)
matches the source "text" (@link SourceData#getSource()) against the pattern represented
by this object.
|
protected MatchConditions |
matchChildren(SourceData source,
MatchConditions matchCond,
int offset)
matches successively all children of this current node.
|
getComments, hashCode, prettyPrint, prettyPrintMain, reuseSignaturegetEndPosition, getFirstElement, getFirstElementIncludingBlocks, getLastElement, getParentClass, getPositionInfo, getRelativePosition, getStartPosition, setParentClass, toSource, toString, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetChildAt, getChildCountgetCommentsgetEndPosition, getFirstElement, getFirstElementIncludingBlocks, getLastElement, getPositionInfo, getRelativePosition, getStartPosition, prettyPrint, visitpublic JavaNonTerminalProgramElement()
public JavaNonTerminalProgramElement(ExtList list)
list - as ExtList with children of the nodepublic JavaNonTerminalProgramElement(PositionInfo pos)
public JavaNonTerminalProgramElement(ExtList children, PositionInfo pos)
protected int getArrayPos(ImmutableArray<ProgramElement> arr, ProgramElement el)
arr - the array where the element is looked forel - the element to look forpublic boolean equalsModRenaming(SourceElement se, NameAbstractionTable nat)
equalsModRenaming in interface SourceElementequalsModRenaming in class JavaProgramElementpublic boolean equals(java.lang.Object o)
equals in class JavaProgramElementprotected int computeHashCode()
computeHashCode in class JavaProgramElementpublic MatchConditions match(SourceData source, MatchConditions matchCond)
ProgramElementMatchConditions with
the found instantiations of the schemavariables. If the match
failed, null is returned instead.match in interface ProgramElementmatch in class JavaProgramElementsource - the SourceData with the program element to matchmatchCond - the MatchConditions found up to this pointprotected boolean compatibleBlockSize(int pos,
int max)
protected MatchConditions matchChildren(SourceData source, MatchConditions matchCond, int offset)
source.getSource(). The call
source.next has to be done in the @link ProgramElement#match method
of the currently matched child in case of a successful match. This is
not done here (rationale: schemavariables matching on lists can be
implemented easy).source - the SourceData with the children to be matchedmatchCond - the MatchConditions found so faroffset - the int denoting the index of the child to start with