Class Scanner

java.lang.Object
org.matheclipse.parser.client.Scanner
Direct Known Subclasses:
Parser

public class Scanner extends Object
The Class Scanner.
  • Field Details

    • fInputString

      protected String fInputString
    • fCurrentChar

      protected char fCurrentChar
    • fCurrentPosition

      protected int fCurrentPosition
    • fToken

      protected int fToken
    • fOperatorString

      protected String fOperatorString
    • fOperList

      protected List<org.matheclipse.parser.client.operator.Operator> fOperList
    • rowCount

      protected int rowCount
      Row counter for syntax errors.
    • fCurrentColumnStartPosition

      protected int fCurrentColumnStartPosition
    • TT_EOF

      public static final int TT_EOF
      Token type: End-of_File.
      See Also:
    • TT_FLOATING_POINT

      public static final int TT_FLOATING_POINT
      Token type: floating point number.
      See Also:
    • TT_ARGUMENTS_OPEN

      public static final int TT_ARGUMENTS_OPEN
      Token type: opening bracket for function arguments.
      See Also:
    • TT_ARGUMENTS_CLOSE

      public static final int TT_ARGUMENTS_CLOSE
      Token type: closing bracket for function arguments.
      See Also:
    • TT_PRECEDENCE_OPEN

      public static final int TT_PRECEDENCE_OPEN
      Token type: opening bracket '(' for sub-formulas with higher precedence.
      See Also:
    • TT_PRECEDENCE_CLOSE

      public static final int TT_PRECEDENCE_CLOSE
      Token type: closing bracket ')' for sub-formulas with higher precedence.
      See Also:
    • TT_LIST_OPEN

      public static final int TT_LIST_OPEN
      Token type: opening curly braces '{' for starting lists.
      See Also:
    • TT_LIST_CLOSE

      public static final int TT_LIST_CLOSE
      Token type: closing curly braces '}' for ending lists.
      See Also:
    • TT_PARTOPEN

      public static final int TT_PARTOPEN
      Token type: opening brackets for starting the "index part" of an expression.
      See Also:
    • TT_PARTCLOSE

      public static final int TT_PARTCLOSE
      Token type: closing brackets for ending the "index part" of an expression.
      See Also:
    • TT_OPERATOR

      public static final int TT_OPERATOR
      Token type: operator found in input string.
      See Also:
    • TT_COMMA

      public static final int TT_COMMA
      ',' operator.
      See Also:
    • TT_PERCENT

      public static final int TT_PERCENT
      '%' operator.
      See Also:
    • TT_STRING

      public static final int TT_STRING
      Token type: string surrounded by "...."
      See Also:
    • TT_BLANK

      public static final int TT_BLANK
      Token type: pattern placeholder '_'.
      See Also:
    • TT_IDENTIFIER

      public static final int TT_IDENTIFIER
      Token type: identifier name.
      See Also:
    • TT_DIGIT

      public static final int TT_DIGIT
      Token type: digit 0,1,2,3,4,5,6,7,8,9.
      See Also:
    • TT_SLOT

      public static final int TT_SLOT
      Token type: slot #.
      See Also:
    • TT_SLOTSEQUENCE

      public static final int TT_SLOTSEQUENCE
      Token type: slot sequence ##.
      See Also:
    • numFormat

      protected int numFormat
    • fFactory

      protected org.matheclipse.parser.client.ast.IParserFactory fFactory
  • Constructor Details

    • Scanner

      public Scanner()
      Initialize Scanner without a math-expression.
  • Method Details

    • initialize

      protected void initialize(String s) throws SyntaxError
      Initialize.
      Parameters:
      s - the s
      Throws:
      SyntaxError - the syntax error
    • getOperator

      protected List<org.matheclipse.parser.client.operator.Operator> getOperator()
      getOperator.
      Returns:
      the operator
    • getNextToken

      protected void getNextToken() throws SyntaxError
      getNextToken
      Throws:
      SyntaxError - if any.
    • throwSyntaxError

      protected void throwSyntaxError(String error) throws SyntaxError
      Throw syntax error.
      Parameters:
      error - the error
      Throws:
      SyntaxError - the syntax error
    • throwSyntaxError

      protected void throwSyntaxError(String error, int errorLength) throws SyntaxError
      Throw syntax error.
      Parameters:
      error - the error
      errorLength - the error length
      Throws:
      SyntaxError - the syntax error
    • getIdentifier

      protected String getIdentifier()
      Gets the identifier.
      Returns:
      the identifier
    • getNumberString

      protected Object[] getNumberString()
      Gets the number string.
      Returns:
      the number string
    • getStringBuffer

      protected StringBuffer getStringBuffer() throws SyntaxError
      Gets the string buffer.
      Returns:
      the string buffer
      Throws:
      SyntaxError - the syntax error