|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjmathlib.core.interpreter.RootObject
jmathlib.core.interpreter.Parser
public class Parser
The parser uses the Lexer to produce a list of tokens which it builds into an abstract syntax tree.
| Field Summary | |
|---|---|
java.lang.String |
evaluationLockWords
|
| Fields inherited from interface jmathlib.core.constants.TokenConstants |
|---|
ADDSUB_PRIORITY, AND_PRIORITY, ANDAND_PRIORITY, ASSIGN_PRIORITY, BRACKET_PRIORITY, COMPARE_PRIORITY, CONCAT, MATRIX, MULDIV_PRIORITY, OR_PRIORITY, OROR_PRIORITY, PARAMETER, POWER_PRIORITY, RELATION_PRIORITY, SINGLE, ttDelimiter, ttNotSet, ttOperand, ttOperator |
| Fields inherited from interface jmathlib.core.constants.ErrorCodes |
|---|
ERR_BRACKET_OPEN, ERR_BRACKET_ORDER, ERR_FUNCTION_NOT_FOUND, ERR_FUNCTION_NOT_IMPLEMENTED, ERR_INSUFFICIENT_PARAMETERS, ERR_INVALID_PARAMETER, ERR_LVALUE_REQUIRED, ERR_MATRIX_SINGULAR, ERR_NOT_SQUARE_MATRIX, ERR_OPNOTSUPPORTED, ERR_TOO_MANY_PARAMETERS, ERR_USER_ERROR, ERR_VARIABLE_NOTDEFINED, OK, OK_FUNCTION_PROCESS |
| Constructor Summary | |
|---|---|
Parser()
default constructor - creates the Parser object with an empty string |
|
| Method Summary | |
|---|---|
Token |
getNextToken()
get next token from the lexical analyser |
java.lang.String |
getScannedLineOfCode()
return the currently scanned line of code to identify the possible errors. |
OperandToken |
parseExpression(java.lang.String expression)
Parse an expression and return an operand tree of the expression |
OperandToken |
parseRemainingExpression()
parse remaining tokens of a m-function file or m-script file |
Token |
peekNextToken()
get next Token from lexical analyser, without moving forward |
void |
setExpression(java.lang.String expression)
set expression of a m-function file or m-script file. |
| Methods inherited from class jmathlib.core.interpreter.RootObject |
|---|
clone, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public java.lang.String evaluationLockWords
| Constructor Detail |
|---|
public Parser()
| Method Detail |
|---|
public OperandToken parseExpression(java.lang.String expression)
expression - = a vector of tokens
public void setExpression(java.lang.String expression)
expression - = code of a function as a stringpublic OperandToken parseRemainingExpression()
public java.lang.String getScannedLineOfCode()
public Token getNextToken()
public Token peekNextToken()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||