use of com.oracle.truffle.sl.nodes.SLExpressionNode in project graal by oracle.
the class FatalError method Arithmetic.
SLExpressionNode Arithmetic() {
SLExpressionNode result;
result = Term();
while (la.kind == 26 || la.kind == 27) {
if (la.kind == 26) {
Get();
} else {
Get();
}
Token op = t;
SLExpressionNode right = Term();
result = factory.createBinary(op, result, right);
}
return result;
}
use of com.oracle.truffle.sl.nodes.SLExpressionNode in project graal by oracle.
the class FatalError method ReturnStatement.
SLStatementNode ReturnStatement() {
SLStatementNode result;
Expect(17);
Token returnToken = t;
SLExpressionNode value = null;
if (StartOf(2)) {
value = Expression();
}
result = factory.createReturn(returnToken, value);
Expect(11);
return result;
}
use of com.oracle.truffle.sl.nodes.SLExpressionNode in project graal by oracle.
the class FatalError method LogicFactor.
SLExpressionNode LogicFactor() {
SLExpressionNode result;
result = Arithmetic();
if (StartOf(3)) {
switch(la.kind) {
case 20:
{
Get();
break;
}
case 21:
{
Get();
break;
}
case 22:
{
Get();
break;
}
case 23:
{
Get();
break;
}
case 24:
{
Get();
break;
}
case 25:
{
Get();
break;
}
}
Token op = t;
SLExpressionNode right = Arithmetic();
result = factory.createBinary(op, result, right);
}
return result;
}
use of com.oracle.truffle.sl.nodes.SLExpressionNode in project graal by oracle.
the class FatalError method Factor.
SLExpressionNode Factor() {
SLExpressionNode result;
result = null;
if (la.kind == 1) {
Get();
SLExpressionNode assignmentName = factory.createStringLiteral(t, false);
if (StartOf(4)) {
result = MemberExpression(null, null, assignmentName);
} else if (StartOf(5)) {
result = factory.createRead(assignmentName);
} else
SynErr(36);
} else if (la.kind == 2) {
Get();
result = factory.createStringLiteral(t, true);
} else if (la.kind == 3) {
Get();
result = factory.createNumericLiteral(t);
} else if (la.kind == 5) {
Get();
int start = t.charPos;
result = Expression();
SLExpressionNode expr = result;
Expect(7);
int length = (t.charPos + t.val.length()) - start;
result = factory.createParenExpression(expr, start, length);
} else
SynErr(37);
return result;
}
use of com.oracle.truffle.sl.nodes.SLExpressionNode in project graal by oracle.
the class FatalError method IfStatement.
SLStatementNode IfStatement(boolean inLoop) {
SLStatementNode result;
Expect(15);
Token ifToken = t;
Expect(5);
SLExpressionNode condition = Expression();
Expect(7);
SLStatementNode thenPart = Block(inLoop);
SLStatementNode elsePart = null;
if (la.kind == 16) {
Get();
elsePart = Block(inLoop);
}
result = factory.createIf(ifToken, condition, thenPart, elsePart);
return result;
}
Aggregations