java.lang.Object
org.matheclipse.parser.client.Scanner
- Direct Known Subclasses:
Parser
The Class Scanner.
-
Field Summary
Modifier and TypeFieldDescriptionprotected char
protected int
protected int
protected org.matheclipse.parser.client.ast.IParserFactory
protected String
protected String
protected List<org.matheclipse.parser.client.operator.Operator>
protected int
protected int
protected int
Row counter for syntax errors.static final int
Token type: closing bracket for function arguments.static final int
Token type: opening bracket for function arguments.static final int
Token type: pattern placeholder '_'.static final int
',' operator.static final int
Token type: digit 0,1,2,3,4,5,6,7,8,9.static final int
Token type: End-of_File.static final int
Token type: floating point number.static final int
Token type: identifier name.static final int
Token type: closing curly braces '}' for ending lists.static final int
Token type: opening curly braces '{' for starting lists.static final int
Token type: operator found in input string.static final int
Token type: closing brackets for ending the "index part" of an expression.static final int
Token type: opening brackets for starting the "index part" of an expression.static final int
'%' operator.static final int
Token type: closing bracket ')' for sub-formulas with higher precedence.static final int
Token type: opening bracket '(' for sub-formulas with higher precedence.static final int
Token type: slot #.static final int
Token type: slot sequence ##.static final int
Token type: string surrounded by "...." -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
Gets the identifier.protected void
getNextTokenprotected Object[]
Gets the number string.protected List<org.matheclipse.parser.client.operator.Operator>
getOperator.protected StringBuffer
Gets the string buffer.protected void
initialize
(String s) Initialize.protected void
throwSyntaxError
(String error) Throw syntax error.protected void
throwSyntaxError
(String error, int errorLength) Throw syntax error.
-
Field Details
-
fInputString
-
fCurrentChar
protected char fCurrentChar -
fCurrentPosition
protected int fCurrentPosition -
fToken
protected int fToken -
fOperatorString
-
fOperList
-
rowCount
protected int rowCountRow counter for syntax errors. -
fCurrentColumnStartPosition
protected int fCurrentColumnStartPosition -
TT_EOF
public static final int TT_EOFToken type: End-of_File.- See Also:
-
TT_FLOATING_POINT
public static final int TT_FLOATING_POINTToken type: floating point number.- See Also:
-
TT_ARGUMENTS_OPEN
public static final int TT_ARGUMENTS_OPENToken type: opening bracket for function arguments.- See Also:
-
TT_ARGUMENTS_CLOSE
public static final int TT_ARGUMENTS_CLOSEToken type: closing bracket for function arguments.- See Also:
-
TT_PRECEDENCE_OPEN
public static final int TT_PRECEDENCE_OPENToken type: opening bracket '(' for sub-formulas with higher precedence.- See Also:
-
TT_PRECEDENCE_CLOSE
public static final int TT_PRECEDENCE_CLOSEToken type: closing bracket ')' for sub-formulas with higher precedence.- See Also:
-
TT_LIST_OPEN
public static final int TT_LIST_OPENToken type: opening curly braces '{' for starting lists.- See Also:
-
TT_LIST_CLOSE
public static final int TT_LIST_CLOSEToken type: closing curly braces '}' for ending lists.- See Also:
-
TT_PARTOPEN
public static final int TT_PARTOPENToken type: opening brackets for starting the "index part" of an expression.- See Also:
-
TT_PARTCLOSE
public static final int TT_PARTCLOSEToken type: closing brackets for ending the "index part" of an expression.- See Also:
-
TT_OPERATOR
public static final int TT_OPERATORToken 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_STRINGToken type: string surrounded by "...."- See Also:
-
TT_BLANK
public static final int TT_BLANKToken type: pattern placeholder '_'.- See Also:
-
TT_IDENTIFIER
public static final int TT_IDENTIFIERToken type: identifier name.- See Also:
-
TT_DIGIT
public static final int TT_DIGITToken type: digit 0,1,2,3,4,5,6,7,8,9.- See Also:
-
TT_SLOT
public static final int TT_SLOTToken type: slot #.- See Also:
-
TT_SLOTSEQUENCE
public static final int TT_SLOTSEQUENCEToken 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
Initialize.- Parameters:
s
- the s- Throws:
SyntaxError
- the syntax error
-
getOperator
getOperator.- Returns:
- the operator
-
getNextToken
getNextToken- Throws:
SyntaxError
- if any.
-
throwSyntaxError
Throw syntax error.- Parameters:
error
- the error- Throws:
SyntaxError
- the syntax error
-
throwSyntaxError
Throw syntax error.- Parameters:
error
- the errorerrorLength
- the error length- Throws:
SyntaxError
- the syntax error
-
getIdentifier
Gets the identifier.- Returns:
- the identifier
-
getNumberString
Gets the number string.- Returns:
- the number string
-
getStringBuffer
Gets the string buffer.- Returns:
- the string buffer
- Throws:
SyntaxError
- the syntax error
-