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 ZbnfParseResultItempublic java.lang.String getParsedText()
ZbnfParseResultItemgetParsedText in interface ZbnfParseResultItempublic double getParsedFloat()
ZbnfParseResultItemgetParsedFloat in interface ZbnfParseResultItempublic long getParsedInteger()
ZbnfParseResultItemgetParsedInteger in interface ZbnfParseResultItempublic java.lang.String getParsedString()
ZbnfParseResultItemgetParsedString in interface ZbnfParseResultItempublic int getInputLine()
ZbnfParseResultItemgetInputLine in interface ZbnfParseResultItempublic int getInputColumn()
ZbnfParseResultItemgetInputColumn in interface ZbnfParseResultItempublic java.lang.String getInputFile()
ZbnfParseResultItemgetInputFile in interface ZbnfParseResultItempublic boolean isComponent()
isComponent in interface ZbnfParseResultItempublic ZbnfSyntaxPrescript getComponentSyntax()
getComponentSyntax in interface ZbnfParseResultItempublic boolean isInteger()
ZbnfParseResultItemisInteger in interface ZbnfParseResultItempublic boolean isFloat()
ZbnfParseResultItemisFloat in interface ZbnfParseResultItempublic boolean isString()
ZbnfParseResultItemisString in interface ZbnfParseResultItempublic boolean isTerminalSymbol()
ZbnfParseResultItemisTerminalSymbol in interface ZbnfParseResultItempublic boolean isIdentifier()
ZbnfParseResultItemisIdentifier in interface ZbnfParseResultItempublic boolean isOnlySemantic()
ZbnfParseResultItemisOnlySemantic in interface ZbnfParseResultItempublic int isRepeat()
ZbnfParseResultItemisRepeat in interface ZbnfParseResultItempublic int isRepetition()
ZbnfParseResultItemisRepetition in interface ZbnfParseResultItempublic int xxxisAlternative()
public java.lang.String getKindOf()
public java.lang.String getDescription()
ZbnfParseResultItemgetDescription in interface ZbnfParseResultItemjava.lang.String getText()
protected ZbnfParserStore.ParseResultItemImplement clone()
clone in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic ZbnfParseResultItem nextSkipIntoComponent(ZbnfParseResultItem parent)
nextSkipIntoComponent in interface ZbnfParseResultItemparent - 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 ZbnfParseResultItemparent - 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 ZbnfParseResultItempublic java.lang.String getSuperItemType()
public boolean isOption()
ZbnfParseResultItemisOption in interface ZbnfParseResultItempublic java.util.Iterator<ZbnfParseResultItem> iteratorChildren()
ZbnfParseResultItemiteratorChildren in interface ZbnfParseResultItemprivate 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)
ZbnfParseResultItemgetChildString in interface ZbnfParseResultItempublic java.util.Iterator<ZbnfParseResultItem> iterChildren()
SortedTreeiterChildren in interface SortedTree<ZbnfParseResultItem>public java.util.Iterator<ZbnfParseResultItem> iterChildren(java.lang.String key)
SortedTreeiterChildren 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()
SortedTreelistChildren in interface SortedTree<ZbnfParseResultItem>public java.util.List<ZbnfParseResultItem> listChildren(java.lang.String key)
SortedTreelistChildren in interface SortedTree<ZbnfParseResultItem>key - The key of the demanded child. The implementation may have extra possibilities, see getChild(String).public ZbnfParseResultItem firstChild()
ZbnfParseResultItemfirstChild in interface ZbnfParseResultItempublic ZbnfParseResultItem next()
ZbnfParseResultItemnext in interface ZbnfParseResultItemvoid 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 ZbnfParseResultItembegin - 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()