use of com.oracle.truffle.sl.nodes.SLExpressionNode in project graal by oracle.
the class FatalError method Expression.
SLExpressionNode Expression() {
SLExpressionNode result;
result = LogicTerm();
while (la.kind == 18) {
Get();
Token op = t;
SLExpressionNode right = LogicTerm();
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 Term.
SLExpressionNode Term() {
SLExpressionNode result;
result = Factor();
while (la.kind == 28 || la.kind == 29) {
if (la.kind == 28) {
Get();
} else {
Get();
}
Token op = t;
SLExpressionNode right = Factor();
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 MemberExpression.
SLExpressionNode MemberExpression(SLExpressionNode r, SLExpressionNode assignmentReceiver, SLExpressionNode assignmentName) {
SLExpressionNode result;
result = null;
SLExpressionNode receiver = r;
SLExpressionNode nestedAssignmentName = null;
if (la.kind == 5) {
Get();
List<SLExpressionNode> parameters = new ArrayList<>();
SLExpressionNode parameter;
if (receiver == null) {
receiver = factory.createRead(assignmentName);
}
if (StartOf(2)) {
parameter = Expression();
parameters.add(parameter);
while (la.kind == 6) {
Get();
parameter = Expression();
parameters.add(parameter);
}
}
Expect(7);
Token finalToken = t;
result = factory.createCall(receiver, parameters, finalToken);
} else if (la.kind == 30) {
Get();
SLExpressionNode value = Expression();
if (assignmentName == null) {
SemErr("invalid assignment target");
} else if (assignmentReceiver == null) {
result = factory.createAssignment(assignmentName, value);
} else {
result = factory.createWriteProperty(assignmentReceiver, assignmentName, value);
}
} else if (la.kind == 31) {
Get();
if (receiver == null) {
receiver = factory.createRead(assignmentName);
}
Expect(1);
nestedAssignmentName = factory.createStringLiteral(t, false);
result = factory.createReadProperty(receiver, nestedAssignmentName);
} else if (la.kind == 32) {
Get();
if (receiver == null) {
receiver = factory.createRead(assignmentName);
}
nestedAssignmentName = Expression();
result = factory.createReadProperty(receiver, nestedAssignmentName);
Expect(33);
} else
SynErr(38);
if (StartOf(4)) {
result = MemberExpression(result, receiver, nestedAssignmentName);
}
return result;
}
use of com.oracle.truffle.sl.nodes.SLExpressionNode in project graal by oracle.
the class FatalError method LogicTerm.
SLExpressionNode LogicTerm() {
SLExpressionNode result;
result = LogicFactor();
while (la.kind == 19) {
Get();
Token op = t;
SLExpressionNode right = LogicFactor();
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 WhileStatement.
SLStatementNode WhileStatement() {
SLStatementNode result;
Expect(14);
Token whileToken = t;
Expect(5);
SLExpressionNode condition = Expression();
Expect(7);
SLStatementNode body = Block(true);
result = factory.createWhile(whileToken, condition, body);
return result;
}
Aggregations