Class StringAnalyzer1.Token

java.lang.Object
one.empty3.library1.tree.StringAnalyzer1.Token
Enclosing class:
StringAnalyzer1

public abstract class StringAnalyzer1.Token extends Object
Represents a token in a parsing process.
  • Field Details

    • action

      protected Action action
    • aClass

      protected Class aClass
    • method

      protected Method method
    • variable

      protected Variable variable
  • Constructor Details

    • Token

      public Token()
  • Method Details

    • addToken

      public void addToken(StringAnalyzer1.Token token)
    • nextToken

      public int nextToken(String input, int position)
    • nextToken

      public StringAnalyzer1.Token nextToken()
    • setAction

      public StringAnalyzer1.Token setAction(Action action)
    • skipBlanks

      public int skipBlanks(String input, int position)
      Skips over any blank spaces in the input string starting from the given position.
      Parameters:
      input - the input string
      position - the starting position
      Returns:
      the new position after skipping the blank spaces
    • parse

      public int parse(String input, int position)
      Parses the input string starting from the given position and skips over any blank spaces.
      Parameters:
      input - the input string
      position - 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

      public Action 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

      protected int processNext(String input, int position)
      Processes the next token in the input string starting from the given position.
      Parameters:
      input - the input string
      position - the starting position
      Returns:
      the new position after processing the next token
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getNextToken

      public StructureMatrix<StringAnalyzer1.Token> getNextToken()