Search in sources :

Example 6 with SymbolNode

use of org.matheclipse.parser.client.ast.SymbolNode in project symja_android_library by axkr.

the class Parser method getSymbol.

/**
	 * Read the current identifier from the expression factories table
	 * 
	 * @return
	 * @see
	 */
private SymbolNode getSymbol() throws SyntaxError {
    String identifier = getIdentifier();
    if (!fFactory.isValidIdentifier(identifier)) {
        throwSyntaxError("Invalid identifier: " + identifier + " detected.");
    }
    final SymbolNode symbol = fFactory.createSymbol(identifier);
    getNextToken();
    return symbol;
}
Also used : SymbolNode(org.matheclipse.parser.client.ast.SymbolNode)

Example 7 with SymbolNode

use of org.matheclipse.parser.client.ast.SymbolNode in project symja_android_library by axkr.

the class Parser method getTimes.

private ASTNode getTimes(ASTNode temp) throws SyntaxError {
    FunctionNode func = fFactory.createAST(new SymbolNode("Times"));
    func.add(temp);
    do {
        getNextToken();
        temp = parseExpression();
        func.add(temp);
        if (fToken != TT_PRECEDENCE_CLOSE) {
            throwSyntaxError("\')\' expected.");
        }
        getNextToken();
    } while (fToken == TT_PRECEDENCE_OPEN);
    return func;
}
Also used : SymbolNode(org.matheclipse.parser.client.ast.SymbolNode) FunctionNode(org.matheclipse.parser.client.ast.FunctionNode)

Aggregations

SymbolNode (org.matheclipse.parser.client.ast.SymbolNode)7 FunctionNode (org.matheclipse.parser.client.ast.FunctionNode)6 ASTNode (org.matheclipse.parser.client.ast.ASTNode)5 IAST (org.matheclipse.core.interfaces.IAST)2 IExpr (org.matheclipse.core.interfaces.IExpr)2 NumberNode (org.matheclipse.parser.client.ast.NumberNode)2 ArithmeticMathException (org.matheclipse.parser.client.math.ArithmeticMathException)2 Apfloat (org.apfloat.Apfloat)1 Apint (org.apfloat.Apint)1 AST2Expr (org.matheclipse.core.convert.AST2Expr)1 WrongArgumentType (org.matheclipse.core.eval.exception.WrongArgumentType)1 IInteger (org.matheclipse.core.interfaces.IInteger)1 INumber (org.matheclipse.core.interfaces.INumber)1 ISignedNumber (org.matheclipse.core.interfaces.ISignedNumber)1 ISymbol (org.matheclipse.core.interfaces.ISymbol)1 FloatNode (org.matheclipse.parser.client.ast.FloatNode)1 FractionNode (org.matheclipse.parser.client.ast.FractionNode)1 IntegerNode (org.matheclipse.parser.client.ast.IntegerNode)1 Pattern2Node (org.matheclipse.parser.client.ast.Pattern2Node)1 Pattern3Node (org.matheclipse.parser.client.ast.Pattern3Node)1