use of org.mozilla.javascript.ast.InfixExpression in project HL4A by HL4A.
the class Parser method eqExpr.
private AstNode eqExpr() throws IOException {
AstNode pn = relExpr();
for (; ; ) {
int tt = peekToken(), opPos = ts.tokenBeg;
switch(tt) {
case Token.EQ:
case Token.NE:
case Token.SHEQ:
case Token.SHNE:
consumeToken();
int parseToken = tt;
if (compilerEnv.getLanguageVersion() == Context.VERSION_1_2) {
// JavaScript 1.2 uses shallow equality for == and != .
if (tt == Token.EQ)
parseToken = Token.SHEQ;
else if (tt == Token.NE)
parseToken = Token.SHNE;
}
pn = new InfixExpression(parseToken, pn, relExpr(), opPos);
continue;
}
break;
}
return pn;
}
use of org.mozilla.javascript.ast.InfixExpression in project HL4A by HL4A.
the class Parser method mulExpr.
private AstNode mulExpr() throws IOException {
AstNode pn = unaryExpr();
for (; ; ) {
int tt = peekToken(), opPos = ts.tokenBeg;
switch(tt) {
case Token.MUL:
case Token.DIV:
case Token.MOD:
consumeToken();
pn = new InfixExpression(tt, pn, unaryExpr(), opPos);
continue;
}
break;
}
return pn;
}
use of org.mozilla.javascript.ast.InfixExpression in project HL4A by HL4A.
the class Parser method orExpr.
private AstNode orExpr() throws IOException {
AstNode pn = andExpr();
if (matchToken(Token.OR)) {
int opPos = ts.tokenBeg;
pn = new InfixExpression(Token.OR, pn, orExpr(), opPos);
}
return pn;
}
use of org.mozilla.javascript.ast.InfixExpression in project HL4A by HL4A.
the class Parser method bitXorExpr.
private AstNode bitXorExpr() throws IOException {
AstNode pn = bitAndExpr();
while (matchToken(Token.BITXOR)) {
int opPos = ts.tokenBeg;
pn = new InfixExpression(Token.BITXOR, pn, bitAndExpr(), opPos);
}
return pn;
}
Aggregations