| java.lang.Object de.uka.ilkd.key.pp.PositionTable
All known Subclasses: de.uka.ilkd.key.pp.ModalityPositionTable, de.uka.ilkd.key.pp.InitialPositionTable,
PositionTable | public class PositionTable (Code) | | A PositionTable describes the start and end positions of substrings
of a String in order to get a PosInSequent from an int describing a
position in a string representing a Term or a Sequent, etc. A
PositionTable therefore represents a table consisting of two
columns of type int (start and end position) and a reference to
another PositionTable representing the position information for
that substring. A PositionTable is valid (in order to support
efficient putting of new entries to the table and an efficient
search for a Position), if the last entry that has been set is (s,
e, x) and the next entry is (s', e', x') with s'>e.
Positions are reckoned with start positions inclusive and
end positions exclusive. Start and end positions are relative
to each subterm.
|
Method Summary | |
public Range | firstStatementRangeForIndex(int index) Returns the character range of the first java statement in a
program modality for the `lowest' subtable that includes
index in its range. | public PositionTable | getChild(int i) | public Range | getFirstStatementRange() Returns the character range of the first java statement in a
program modality for thisposition table. | protected PosInSequent | getSequentPIS(ListOfInteger posList, SequentPrintFilter filter) Returns a PosInSequent for a given position list,
but without filling in the bounds. | protected ListOfInteger | pathForIndex(int index) Returns the path to the `lowest' position table that includes
index in its range. | public Range | rangeForIndex(int index, int length) Returns the character range of the `lowest' subtable that
includes index in its range.
Parameters: index - the character index to search for. Parameters: length - the length of the whole string correspondingto this position table. | public Range | rangeForPath(ListOfInteger path, int length) Returns the character range for the subtable indicated
by the given integer list. | public void | setEnd(int end, PositionTable child) | public void | setStart(int start) | public String | toString() |
endPos | protected int[] endPos(Code) | | |
startPos | protected int[] startPos(Code) | | |
PositionTable | public PositionTable(int rows)(Code) | | creates a new PositionTable with the number of subterms (or number of
ConstrainedFormula in a Semisequent, or the number of Semisequents in a
Sequent, etc.)
Parameters: rows - the number of direct sub-elements in the term whoseposition information is represented by the constructed object. |
firstStatementRangeForIndex | public Range firstStatementRangeForIndex(int index)(Code) | | Returns the character range of the first java statement in a
program modality for the `lowest' subtable that includes
index in its range. If the lowest subtable
does not correspond to a program modality, it returns null.
|
getChild | public PositionTable getChild(int i)(Code) | | Return of the children of this PositionTable
|
getFirstStatementRange | public Range getFirstStatementRange()(Code) | | Returns the character range of the first java statement in a
program modality for thisposition table. If this
is not a program modality, returns null. Note that this
will be overridden in the subclass
ModalityPositionTable .
|
getSequentPIS | protected PosInSequent getSequentPIS(ListOfInteger posList, SequentPrintFilter filter)(Code) | | Returns a PosInSequent for a given position list,
but without filling in the bounds. It is assumed
that this is a position table which has one child table for
every formula in the printed sequent, and that
posList begins which the number of the formula.
The returned PosInSequent will refer to (a subterm of) one
of the constrained formulae in the sequent.
Parameters: posList - the position list that navigates throughthe position tables. Parameters: filter - the sequent print filter from that was used toprint the sequent |
pathForIndex | protected ListOfInteger pathForIndex(int index)(Code) | | Returns the path to the `lowest' position table that includes
index in its range.
|
rangeForIndex | public Range rangeForIndex(int index, int length)(Code) | | Returns the character range of the `lowest' subtable that
includes index in its range.
Parameters: index - the character index to search for. Parameters: length - the length of the whole string correspondingto this position table. Needed in case itturns out the index belongs to the top level. |
rangeForPath | public Range rangeForPath(ListOfInteger path, int length)(Code) | | Returns the character range for the subtable indicated
by the given integer list.
|
setEnd | public void setEnd(int end, PositionTable child)(Code) | | sets end in the position table to the next free end entry in the
position
table and sets the given PositionTable as child of the sub-element
finished by putting this end position
Parameters: end - char position that ends the sub-element started by the corresponding start entry in the position table Parameters: child - PositionTable for the sub-element from start to end |
setStart | public void setStart(int start)(Code) | | sets start in the position table to the next free start entry in the
position table
Parameters: start - char position that starts a sub-element |
toString | public String toString()(Code) | | returns a String representation of the position table
|
|
|