Class StringAnalyzer3.Token

java.lang.Object
one.empty3.library1.tree.StringAnalyzer3.Token
Direct Known Subclasses:
StringAnalyzer3.MultiToken, StringAnalyzer3.SingleToken, StringAnalyzer3.TokenAttribute, StringAnalyzer3.TokenLogicalExpression, StringAnalyzer3.TokenLogicalExpression1, StringAnalyzerJava1.MultiTokenSequence, StringAnalyzerJava1.TokenArrayAccessor, StringAnalyzerJava1.TokenConstructor, StringAnalyzerJava1.TokenConstructorArray, StringAnalyzerJava1.TokenConstructorCall, StringAnalyzerJava1.TokenExpression2, StringAnalyzerJava1.TokenMethodCall, StringAnalyzerJava1.TokenNameDeclaration2, StringAnalyzerJava1.TokenTypeArrayOrNot, StringAnalyzerJava2.MultiTokenSequence, StringAnalyzerJava2.TokenArrayAccessor, StringAnalyzerJava2.TokenConstructor, StringAnalyzerJava2.TokenConstructorArray, StringAnalyzerJava2.TokenConstructorCall, StringAnalyzerJava2.TokenExpression2, StringAnalyzerJava2.TokenMethodCall, StringAnalyzerJava2.TokenNameDeclaration2, StringAnalyzerJava2.TokenTypeArrayOrNot
Enclosing class:
StringAnalyzer3

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

    • fire

      protected boolean fire
    • action

      protected Action3 action
    • aClass

      protected Class aClass
    • method

      protected Method method
    • variable

      protected Variable variable
  • Constructor Details

    • Token

      public Token()
  • Method Details

    • addToken

    • setAction

      public StringAnalyzer3.Token setAction(Action3 action)
    • fireOnTrue

      public void fireOnTrue(boolean fire)
    • 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
    • getAction3

      public Action3 getAction3()
      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<StringAnalyzer3.Token> getNextToken()
    • hasNextToken

      protected boolean hasNextToken()
    • copy

      Creates a copy of the current Token object.
      Returns:
      a new Token object that is a copy of the current Token (further step: make a deep copy with nextTokens and Token type fields.
    • getConstruct

      public StringAnalyzer3.Construct getConstruct()
    • setConstruct

      public void setConstruct(StringAnalyzer3.Construct clone)
    • getFirstConstructVersion

      public StringAnalyzer3.Construct getFirstConstructVersion()