Class SymbolNode
java.lang.Object
org.pipservices3.expressions.tokenizers.generic.SymbolNode
- Direct Known Subclasses:
SymbolRootNode
-
Constructor Summary
ConstructorsConstructorDescriptionSymbolNode
(SymbolNode parent, int character) Constructs a SymbolNode with the given parent, representing the given character. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDescendantLine
(String value, TokenType tokenType) Add a line of descendants that represent the characters in the given string.ancestry()
Show the symbol this node represents.deepestRead
(IScanner scanner) Find the descendant that takes as many characters as possible from the input.ensureChildWithChar
(int value) Find or create a child for the given character.findChildWithChar
(int value) Find a child with the given character.boolean
getValid()
void
setTokenType
(TokenType value) void
setValid
(boolean value) unreadToValid
(IScanner scanner) Unwind to a valid node; this node is "valid" if its ancestry represents a complete symbol.
-
Constructor Details
-
SymbolNode
Constructs a SymbolNode with the given parent, representing the given character.- Parameters:
parent
- This node's parentcharacter
- This node's associated character.
-
-
Method Details
-
ensureChildWithChar
Find or create a child for the given character.- Parameters:
value
-- Throws:
Exception
-
addDescendantLine
Add a line of descendants that represent the characters in the given string.- Parameters:
value
-tokenType
-- Throws:
Exception
-
deepestRead
Find the descendant that takes as many characters as possible from the input.- Parameters:
scanner
-
-
findChildWithChar
Find a child with the given character.- Parameters:
value
-
-
unreadToValid
Unwind to a valid node; this node is "valid" if its ancestry represents a complete symbol. If this node is not valid, put back the character and ask the parent to unwind.- Parameters:
scanner
-
-
getValid
public boolean getValid() -
setValid
public void setValid(boolean value) -
getTokenType
-
setTokenType
-
ancestry
Show the symbol this node represents.- Returns:
- The symbol this node represents.
-