static class ZbnfParserStore.ParseResultItemImplement extends java.lang.Object implements ZbnfParseResultItem
Modifier and Type | Class and Description |
---|---|
(package private) static class |
ZbnfParserStore.ParseResultItemImplement.IteratorImpl |
Modifier and Type | Field and Description |
---|---|
(package private) ZbnfSyntaxPrescript |
elementSyntax
Reference to the syntax which has determined this element, used for semantic naming etc.
|
(package private) long |
end
The position from-to of the associated input
|
(package private) int |
idxOwn
The index of the element itself inside the outer->items - arraylist.
|
(package private) boolean |
isAdded
Set to true if the item is added from a additional list to the main list.
|
(package private) int |
kind
Kind of entry.
|
(package private) int |
nrofAlternative
Nr of the founded alternative.
|
(package private) static ZbnfSyntaxPrescript |
null_syntaxElement
Replacement for a non existing parentSyntaxElement instead null-reference.
|
(package private) int |
offsetAfterEnd
The offset to the next item behind the items of this complex morphem
|
(package private) ZbnfParserStore.ParseResultItemImplement |
parent
The item which is the parent (contains a offsetAfterEnd with includes this position).
|
(package private) double |
parsedFloatNumber |
(package private) long |
parsedIntegerNumber |
(package private) java.lang.String |
parsedString
The string matching to the parsed
|
(package private) java.lang.String |
sFile
The file or adequate resource from which this result comes from.
|
(package private) java.lang.String |
sInput
The text from input at the position
|
(package private) int |
srcColumn
The line and column and the position in the source nr for debugging
|
(package private) int |
srcLine
The line and column and the position in the source nr for debugging
|
(package private) long |
srcPos |
(package private) java.lang.String |
sSemantic
The action to invoke.
|
(package private) long |
start
The position from-to of the associated input
|
(package private) ZbnfParserStore |
store
The explicit reference to the store to which the item is member of.
|
(package private) java.lang.String |
syntaxIdent
The syntax identifications which has produced the stored result.
|
(package private) SortedTreeNode<ZbnfParseResultItem> |
treeNodeRepresentation |
(package private) XmlNode |
treeNodeXml |
Constructor and Description |
---|
ParseResultItemImplement(ZbnfParserStore store,
java.lang.String sSemantic,
ZbnfParseResultItem parent,
java.lang.String syntax,
ZbnfSyntaxPrescript elementSyntax,
ZbnfSyntaxPrescript componentSyntax) |
Modifier and Type | Method and Description |
---|---|
private void |
buildTreeNodeRepresentation() |
protected ZbnfParserStore.ParseResultItemImplement |
clone() |
ZbnfSyntaxPrescript |
componentSyntax() |
ZbnfParseResultItem |
firstChild()
Gets the first child of a component.
|
ZbnfParseResultItem |
getChild(java.lang.String key)
Gets the named child or null.
|
java.lang.String |
getChildString(java.lang.String key)
Returns the String content of the given child or null, if no such child is found.
|
ZbnfSyntaxPrescript |
getComponentSyntax() |
java.lang.String |
getDescription()
Returns a short description for report, error report, from the current item.
|
protected int |
getIdx() |
protected int |
getIdxAfterComponent() |
int |
getInputColumn()
returns the column of the input line while parsing.
|
java.lang.String |
getInputFile()
returns the file of the input line while parsing.
|
int |
getInputLine()
returns the line of the input line while parsing.
|
java.lang.String |
getKindOf() |
int |
getNrofAlternative()
Gets the number of the alternative.
|
ZbnfParseResultItem |
getParent() |
double |
getParsedFloat()
Returns the parsed float value if isFloat() returns true.
|
long |
getParsedInteger()
Returns the parsed integer value if isInteger() returns true.
|
java.lang.String |
getParsedString()
Returns the parsed string if isString() returns true.
|
java.lang.String |
getParsedText()
Returns the input text at the parsed area of this result.
|
java.lang.String |
getSemantic()
Gets the semantic of the item.
|
java.lang.String |
getSuperItemType()
This is the super type to store the result.
|
(package private) java.lang.String |
getText()
Returns a text information proper to use for XML if it is a leaf node.
|
boolean |
isComponent()
For example also {
|
boolean |
isFloat()
Tests if the actual item represents a parsed float number.
|
boolean |
isIdentifier()
Tests if the actual item represents an identifier.
|
boolean |
isInteger()
Tests if the actual item represents a parsed integer number.
|
boolean |
isOnlySemantic()
Tests if the actual item represents a entry describes only semantic.
|
boolean |
isOption()
Tests if the actual item represents an entry describes a option construct of something.
|
int |
isRepeat()
Tests if the actual item represents an entry describes a repetition of something.
|
int |
isRepetition()
Tests if the actual item represents an entry describes a repetition of something.
|
boolean |
isString()
Tests if the actual item represents a parsed string.
|
boolean |
isTerminalSymbol()
Tests if the actual item represents a parsed terminal symbol.
|
java.util.Iterator<ZbnfParseResultItem> |
iteratorChildren()
Creates an iterator and returns it reference for the actual item to iterate to its childs.
|
java.util.Iterator<ZbnfParseResultItem> |
iterChildren()
Returns an iterator through the list of all children of the node.
|
java.util.Iterator<ZbnfParseResultItem> |
iterChildren(java.lang.String key)
Returns an iterator through the list of all children with the given key.
|
java.util.List<ZbnfParseResultItem> |
listChildren()
Returns a List of all children of the node.
|
java.util.List<ZbnfParseResultItem> |
listChildren(java.lang.String key)
Returns a List of all children with the given key.
|
ZbnfParseResultItem |
next()
Gets the next item or component followed by the current item or component in the current tree level.
|
ZbnfParseResultItem |
next(ZbnfParseResultItem parent)
Implements from ParseResultItem
|
private ZbnfParseResultItem |
next(ZbnfParseResultItem parent,
int offset)
Implements from ParseResultItem
|
ZbnfParseResultItem |
nextSkipIntoComponent(ZbnfParseResultItem parent)
Implements from ParseResultItem
|
(package private) void |
setSrcLineColumnFileInParent(long begin,
long end,
int srcLine,
int srcColumn,
java.lang.String srcFile)
Sets information about the source of parsing in the parent result item, that is a component item usually.
|
private void |
stop()
It's a debug helper.
|
ZbnfSyntaxPrescript |
syntaxItem()
Adds an item in the parents, that is a component item usually.
|
java.lang.String |
toString() |
int |
xxxisAlternative() |
ZbnfParserStore store
#ParserStore.add(ZbnfParserStore)
.
Because it should be to changeable, a non static class ParseResultItemImplement
with its implicit reference to the outer class ParserStore
is a failure, in this case the implicit reference to the outer class
can't be changed.ZbnfParserStore.ParseResultItemImplement parent
final java.lang.String sSemantic
final ZbnfSyntaxPrescript elementSyntax
static final ZbnfSyntaxPrescript null_syntaxElement
java.lang.String sInput
int kind
int nrofAlternative
java.lang.String parsedString
long parsedIntegerNumber
double parsedFloatNumber
int idxOwn
boolean isAdded
int offsetAfterEnd
ZbnfParserStore.setAlternativeAndOffsetToEnd(int, int)
.
This is done on end of each nested parsing for the appropriate component.
Recursively then all values are correct on finishing the parent components.long start
long end
int srcLine
int srcColumn
long srcPos
java.lang.String sFile
java.lang.String syntaxIdent
SortedTreeNode<ZbnfParseResultItem> treeNodeRepresentation
XmlNode treeNodeXml
ParseResultItemImplement(ZbnfParserStore store, java.lang.String sSemantic, ZbnfParseResultItem parent, java.lang.String syntax, ZbnfSyntaxPrescript elementSyntax, ZbnfSyntaxPrescript componentSyntax)
public java.lang.String getSemantic()
getSemantic
in interface ZbnfParseResultItem
public java.lang.String getParsedText()
ZbnfParseResultItem
getParsedText
in interface ZbnfParseResultItem
public double getParsedFloat()
ZbnfParseResultItem
getParsedFloat
in interface ZbnfParseResultItem
public long getParsedInteger()
ZbnfParseResultItem
getParsedInteger
in interface ZbnfParseResultItem
public java.lang.String getParsedString()
ZbnfParseResultItem
getParsedString
in interface ZbnfParseResultItem
public int getInputLine()
ZbnfParseResultItem
getInputLine
in interface ZbnfParseResultItem
public int getInputColumn()
ZbnfParseResultItem
getInputColumn
in interface ZbnfParseResultItem
public java.lang.String getInputFile()
ZbnfParseResultItem
getInputFile
in interface ZbnfParseResultItem
public boolean isComponent()
isComponent
in interface ZbnfParseResultItem
public ZbnfSyntaxPrescript getComponentSyntax()
getComponentSyntax
in interface ZbnfParseResultItem
public boolean isInteger()
ZbnfParseResultItem
isInteger
in interface ZbnfParseResultItem
public boolean isFloat()
ZbnfParseResultItem
isFloat
in interface ZbnfParseResultItem
public boolean isString()
ZbnfParseResultItem
isString
in interface ZbnfParseResultItem
public boolean isTerminalSymbol()
ZbnfParseResultItem
isTerminalSymbol
in interface ZbnfParseResultItem
public boolean isIdentifier()
ZbnfParseResultItem
isIdentifier
in interface ZbnfParseResultItem
public boolean isOnlySemantic()
ZbnfParseResultItem
isOnlySemantic
in interface ZbnfParseResultItem
public int isRepeat()
ZbnfParseResultItem
isRepeat
in interface ZbnfParseResultItem
public int isRepetition()
ZbnfParseResultItem
isRepetition
in interface ZbnfParseResultItem
public int xxxisAlternative()
public java.lang.String getKindOf()
public java.lang.String getDescription()
ZbnfParseResultItem
getDescription
in interface ZbnfParseResultItem
java.lang.String getText()
protected ZbnfParserStore.ParseResultItemImplement clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public ZbnfParseResultItem nextSkipIntoComponent(ZbnfParseResultItem parent)
nextSkipIntoComponent
in interface ZbnfParseResultItem
parent
- The item that is the first item of a component.
If null, than no test of parent occurs.public ZbnfParseResultItem next(ZbnfParseResultItem parent)
next
in interface ZbnfParseResultItem
parent
- The item that is the first item of a component.
If null, than no test of parent occurs.private ZbnfParseResultItem next(ZbnfParseResultItem parent, int offset)
private void stop()
protected int getIdx()
protected int getIdxAfterComponent()
public int getNrofAlternative()
getNrofAlternative
in interface ZbnfParseResultItem
public java.lang.String getSuperItemType()
public boolean isOption()
ZbnfParseResultItem
isOption
in interface ZbnfParseResultItem
public java.util.Iterator<ZbnfParseResultItem> iteratorChildren()
ZbnfParseResultItem
iteratorChildren
in interface ZbnfParseResultItem
private void buildTreeNodeRepresentation()
public ZbnfParseResultItem getParent()
getParent
in interface SortedTree<ZbnfParseResultItem>
public ZbnfParseResultItem getChild(java.lang.String key)
getChild
in interface SortedTree<ZbnfParseResultItem>
key
- Name or path. The key can address more as one key in tree-depth,
separated with slash. '/' This feature is since 2010-06-02
implements SortedTree.getChild(java.lang.String)
public java.lang.String getChildString(java.lang.String key)
ZbnfParseResultItem
getChildString
in interface ZbnfParseResultItem
public java.util.Iterator<ZbnfParseResultItem> iterChildren()
SortedTree
iterChildren
in interface SortedTree<ZbnfParseResultItem>
public java.util.Iterator<ZbnfParseResultItem> iterChildren(java.lang.String key)
SortedTree
iterChildren
in interface SortedTree<ZbnfParseResultItem>
key
- The key of the demanded child. The implementation may have extra possibilities, see getChild(String).public java.util.List<ZbnfParseResultItem> listChildren()
SortedTree
listChildren
in interface SortedTree<ZbnfParseResultItem>
public java.util.List<ZbnfParseResultItem> listChildren(java.lang.String key)
SortedTree
listChildren
in interface SortedTree<ZbnfParseResultItem>
key
- The key of the demanded child. The implementation may have extra possibilities, see getChild(String).public ZbnfParseResultItem firstChild()
ZbnfParseResultItem
firstChild
in interface ZbnfParseResultItem
public ZbnfParseResultItem next()
ZbnfParseResultItem
next
in interface ZbnfParseResultItem
void setSrcLineColumnFileInParent(long begin, long end, int srcLine, int srcColumn, java.lang.String srcFile)
#addInParent(long, long, int, int, String)
to the source information.
The information are only set if the parent contains null for the source file. Elsewhere the information
was set already by any of the previous result items of this component, more exactly the first one.parent
- begin
- The begin position of the parsed String for this component.end
- The end of parsed StringsrcLine
- The line in source on begin of parsed String.srcColumn
- The column in source on begin of parsed String.srcFile
- The path to the source file.public ZbnfSyntaxPrescript syntaxItem()
setSrcLineColumnFileInParent(long, long, int, int, String)
.
The information are only set if the parent contains null for the source file. Elsewhere the information
was set already by any of the previous result items of this component, more exactly the first one.syntaxItem
in interface ZbnfParseResultItem
begin
- The begin position of the parsed String for this component.end
- The end of parsed StringsrcLine
- The line in source on begin of parsed String.srcColumn
- The column in source on begin of parsed String.srcFile
- The path to the source file.public ZbnfSyntaxPrescript componentSyntax()