Search in sources :

Example 1 with InfixExpression

use of org.mozilla.javascript.ast.InfixExpression in project HL4A by HL4A.

the class Parser method addExpr.

private AstNode addExpr() throws IOException {
    AstNode pn = mulExpr();
    for (; ; ) {
        int tt = peekToken(), opPos = ts.tokenBeg;
        if (tt == Token.ADD || tt == Token.SUB) {
            consumeToken();
            pn = new InfixExpression(tt, pn, mulExpr(), opPos);
            continue;
        }
        break;
    }
    return pn;
}
Also used : InfixExpression(org.mozilla.javascript.ast.InfixExpression) AstNode(org.mozilla.javascript.ast.AstNode)

Example 2 with InfixExpression

use of org.mozilla.javascript.ast.InfixExpression in project HL4A by HL4A.

the class Parser method relExpr.

private AstNode relExpr() throws IOException {
    AstNode pn = shiftExpr();
    for (; ; ) {
        int tt = peekToken(), opPos = ts.tokenBeg;
        switch(tt) {
            case Token.IN:
                if (inForInit)
                    break;
            // fall through
            case Token.INSTANCEOF:
            case Token.LE:
            case Token.LT:
            case Token.GE:
            case Token.GT:
                consumeToken();
                pn = new InfixExpression(tt, pn, shiftExpr(), opPos);
                continue;
        }
        break;
    }
    return pn;
}
Also used : InfixExpression(org.mozilla.javascript.ast.InfixExpression) AstNode(org.mozilla.javascript.ast.AstNode)

Example 3 with InfixExpression

use of org.mozilla.javascript.ast.InfixExpression in project HL4A by HL4A.

the class Parser method bitAndExpr.

private AstNode bitAndExpr() throws IOException {
    AstNode pn = eqExpr();
    while (matchToken(Token.BITAND)) {
        int opPos = ts.tokenBeg;
        pn = new InfixExpression(Token.BITAND, pn, eqExpr(), opPos);
    }
    return pn;
}
Also used : InfixExpression(org.mozilla.javascript.ast.InfixExpression) AstNode(org.mozilla.javascript.ast.AstNode)

Example 4 with InfixExpression

use of org.mozilla.javascript.ast.InfixExpression in project HL4A by HL4A.

the class Parser method andExpr.

private AstNode andExpr() throws IOException {
    AstNode pn = bitOrExpr();
    if (matchToken(Token.AND)) {
        int opPos = ts.tokenBeg;
        pn = new InfixExpression(Token.AND, pn, andExpr(), opPos);
    }
    return pn;
}
Also used : InfixExpression(org.mozilla.javascript.ast.InfixExpression) AstNode(org.mozilla.javascript.ast.AstNode)

Example 5 with InfixExpression

use of org.mozilla.javascript.ast.InfixExpression in project HL4A by HL4A.

the class Parser method shiftExpr.

private AstNode shiftExpr() throws IOException {
    AstNode pn = addExpr();
    for (; ; ) {
        int tt = peekToken(), opPos = ts.tokenBeg;
        switch(tt) {
            case Token.LSH:
            case Token.URSH:
            case Token.RSH:
                consumeToken();
                pn = new InfixExpression(tt, pn, addExpr(), opPos);
                continue;
        }
        break;
    }
    return pn;
}
Also used : InfixExpression(org.mozilla.javascript.ast.InfixExpression) AstNode(org.mozilla.javascript.ast.AstNode)

Aggregations

InfixExpression (org.mozilla.javascript.ast.InfixExpression)14 AstNode (org.mozilla.javascript.ast.AstNode)13 Name (org.mozilla.javascript.ast.Name)2 XmlString (org.mozilla.javascript.ast.XmlString)2 ArrayLiteral (org.mozilla.javascript.ast.ArrayLiteral)1 EmptyExpression (org.mozilla.javascript.ast.EmptyExpression)1 ObjectLiteral (org.mozilla.javascript.ast.ObjectLiteral)1 PropertyGet (org.mozilla.javascript.ast.PropertyGet)1 XmlMemberGet (org.mozilla.javascript.ast.XmlMemberGet)1 XmlRef (org.mozilla.javascript.ast.XmlRef)1