Package org.matheclipse.parser.client
Class Scanner
- java.lang.Object
-
- org.matheclipse.parser.client.Scanner
-
- Direct Known Subclasses:
Parser
public class Scanner extends java.lang.ObjectThe Class Scanner.
-
-
Field Summary
Fields Modifier and Type Field Description protected charfCurrentCharprotected intfCurrentColumnStartPositionprotected intfCurrentPositionprotected org.matheclipse.parser.client.ast.IParserFactoryfFactoryprotected java.lang.StringfInputStringprotected java.lang.StringfOperatorStringprotected java.util.List<org.matheclipse.parser.client.operator.Operator>fOperListprotected intfTokenprotected intnumFormatprotected introwCountRow counter for syntax errors.static intTT_ARGUMENTS_CLOSEToken type: closing bracket for function arguments.static intTT_ARGUMENTS_OPENToken type: opening bracket for function arguments.static intTT_BLANKToken type: pattern placeholder '_'.static intTT_COMMA',' operator.static intTT_DIGITToken type: digit 0,1,2,3,4,5,6,7,8,9.static intTT_EOFToken type: End-of_File.static intTT_FLOATING_POINTToken type: floating point number.static intTT_IDENTIFIERToken type: identifier name.static intTT_LIST_CLOSEToken type: closing curly braces '}' for ending lists.static intTT_LIST_OPENToken type: opening curly braces '{' for starting lists.static intTT_OPERATORToken type: operator found in input string.static intTT_PARTCLOSEToken type: closing brackets for ending the "index part" of an expression.static intTT_PARTOPENToken type: opening brackets for starting the "index part" of an expression.static intTT_PERCENT'%' operator.static intTT_PRECEDENCE_CLOSEToken type: closing bracket ')' for sub-formulas with higher precedence.static intTT_PRECEDENCE_OPENToken type: opening bracket '(' for sub-formulas with higher precedence.static intTT_SLOTToken type: slot #.static intTT_SLOTSEQUENCEToken type: slot sequence ##.static intTT_STRINGToken type: string surrounded by "...."
-
Constructor Summary
Constructors Constructor Description Scanner()Initialize Scanner without a math-expression.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringgetIdentifier()Gets the identifier.protected voidgetNextToken()getNextTokenprotected java.lang.Object[]getNumberString()Gets the number string.protected java.util.List<org.matheclipse.parser.client.operator.Operator>getOperator()getOperator.protected java.lang.StringBuffergetStringBuffer()Gets the string buffer.protected voidinitialize(java.lang.String s)Initialize.protected voidthrowSyntaxError(java.lang.String error)Throw syntax error.protected voidthrowSyntaxError(java.lang.String error, int errorLength)Throw syntax error.
-
-
-
Field Detail
-
fInputString
protected java.lang.String fInputString
-
fCurrentChar
protected char fCurrentChar
-
fCurrentPosition
protected int fCurrentPosition
-
fToken
protected int fToken
-
fOperatorString
protected java.lang.String fOperatorString
-
fOperList
protected java.util.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:
- Constant Field Values
-
TT_FLOATING_POINT
public static final int TT_FLOATING_POINT
Token type: floating point number.- See Also:
- Constant Field Values
-
TT_ARGUMENTS_OPEN
public static final int TT_ARGUMENTS_OPEN
Token type: opening bracket for function arguments.- See Also:
- Constant Field Values
-
TT_ARGUMENTS_CLOSE
public static final int TT_ARGUMENTS_CLOSE
Token type: closing bracket for function arguments.- See Also:
- Constant Field Values
-
TT_PRECEDENCE_OPEN
public static final int TT_PRECEDENCE_OPEN
Token type: opening bracket '(' for sub-formulas with higher precedence.- See Also:
- Constant Field Values
-
TT_PRECEDENCE_CLOSE
public static final int TT_PRECEDENCE_CLOSE
Token type: closing bracket ')' for sub-formulas with higher precedence.- See Also:
- Constant Field Values
-
TT_LIST_OPEN
public static final int TT_LIST_OPEN
Token type: opening curly braces '{' for starting lists.- See Also:
- Constant Field Values
-
TT_LIST_CLOSE
public static final int TT_LIST_CLOSE
Token type: closing curly braces '}' for ending lists.- See Also:
- Constant Field Values
-
TT_PARTOPEN
public static final int TT_PARTOPEN
Token type: opening brackets for starting the "index part" of an expression.- See Also:
- Constant Field Values
-
TT_PARTCLOSE
public static final int TT_PARTCLOSE
Token type: closing brackets for ending the "index part" of an expression.- See Also:
- Constant Field Values
-
TT_OPERATOR
public static final int TT_OPERATOR
Token type: operator found in input string.- See Also:
- Constant Field Values
-
TT_COMMA
public static final int TT_COMMA
',' operator.- See Also:
- Constant Field Values
-
TT_PERCENT
public static final int TT_PERCENT
'%' operator.- See Also:
- Constant Field Values
-
TT_STRING
public static final int TT_STRING
Token type: string surrounded by "...."- See Also:
- Constant Field Values
-
TT_BLANK
public static final int TT_BLANK
Token type: pattern placeholder '_'.- See Also:
- Constant Field Values
-
TT_IDENTIFIER
public static final int TT_IDENTIFIER
Token type: identifier name.- See Also:
- Constant Field Values
-
TT_DIGIT
public static final int TT_DIGIT
Token type: digit 0,1,2,3,4,5,6,7,8,9.- See Also:
- Constant Field Values
-
TT_SLOT
public static final int TT_SLOT
Token type: slot #.- See Also:
- Constant Field Values
-
TT_SLOTSEQUENCE
public static final int TT_SLOTSEQUENCE
Token type: slot sequence ##.- See Also:
- Constant Field Values
-
numFormat
protected int numFormat
-
fFactory
protected org.matheclipse.parser.client.ast.IParserFactory fFactory
-
-
Method Detail
-
initialize
protected void initialize(java.lang.String s) throws SyntaxErrorInitialize.- Parameters:
s- the s- Throws:
SyntaxError- the syntax error
-
getOperator
protected java.util.List<org.matheclipse.parser.client.operator.Operator> getOperator()
getOperator.- Returns:
- the operator
-
getNextToken
protected void getNextToken() throws SyntaxErrorgetNextToken- Throws:
SyntaxError- if any.
-
throwSyntaxError
protected void throwSyntaxError(java.lang.String error) throws SyntaxErrorThrow syntax error.- Parameters:
error- the error- Throws:
SyntaxError- the syntax error
-
throwSyntaxError
protected void throwSyntaxError(java.lang.String error, int errorLength) throws SyntaxErrorThrow syntax error.- Parameters:
error- the errorerrorLength- the error length- Throws:
SyntaxError- the syntax error
-
getIdentifier
protected java.lang.String getIdentifier()
Gets the identifier.- Returns:
- the identifier
-
getNumberString
protected java.lang.Object[] getNumberString()
Gets the number string.- Returns:
- the number string
-
getStringBuffer
protected java.lang.StringBuffer getStringBuffer() throws SyntaxErrorGets the string buffer.- Returns:
- the string buffer
- Throws:
SyntaxError- the syntax error
-
-