Package one.empty3.library1.tree
Class StringAnalyzer1.Token
java.lang.Object
one.empty3.library1.tree.StringAnalyzer1.Token
- Enclosing class:
StringAnalyzer1
Represents a token in a parsing process.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
action()
Executes the action associated with the token, if it is not null.void
addToken
(StringAnalyzer1.Token token) Retrieves the action associated with the token.protected boolean
Determines whether the current operation was successful or not.int
int
Parses the input string starting from the given position and skips over any blank spaces.protected int
processNext
(String input, int position) Processes the next token in the input string starting from the given position.void
setSuccessful
(boolean successful) Sets the success state of the current operation.int
skipBlanks
(String input, int position) Skips over any blank spaces in the input string starting from the given position.toString()
-
Field Details
-
action
-
aClass
-
method
-
variable
-
-
Constructor Details
-
Token
public Token()
-
-
Method Details
-
addToken
-
nextToken
-
nextToken
-
setAction
-
skipBlanks
Skips over any blank spaces in the input string starting from the given position.- Parameters:
input
- the input stringposition
- the starting position- Returns:
- the new position after skipping the blank spaces
-
parse
Parses the input string starting from the given position and skips over any blank spaces.- Parameters:
input
- the input stringposition
- the starting position- Returns:
- the new position after skipping the blank spaces
-
isSuccessful
protected boolean isSuccessful()Determines whether the current operation was successful or not.- Returns:
- true if the operation was successful, false otherwise
-
setSuccessful
public void setSuccessful(boolean successful) Sets the success state of the current operation.- Parameters:
successful
- the flag indicating whether the operation was successful
-
getAction
Retrieves the action associated with the token.- Returns:
- the action associated with the token
-
action
public void action()Executes the action associated with the token, if it is not null. -
processNext
Processes the next token in the input string starting from the given position.- Parameters:
input
- the input stringposition
- the starting position- Returns:
- the new position after processing the next token
-
toString
-
getNextToken
-