use of cz.cuni.mff.d3s.trupple.language.nodes.statement.StatementNode in project TrufflePascal by Aspect26.
the class FatalError method StatementSequence.
void StatementSequence(List<StatementNode> body) {
StatementNode statement = Statement();
body.add(statement);
while (la.kind == 8) {
Get();
statement = Statement();
body.add(statement);
}
}
use of cz.cuni.mff.d3s.trupple.language.nodes.statement.StatementNode in project TrufflePascal by Aspect26.
the class FatalError method WhileLoop.
StatementNode WhileLoop() {
StatementNode statement;
factory.startLoop();
Expect(44);
ExpressionNode condition = Expression();
Expect(38);
StatementNode loopBody = Statement();
statement = factory.createWhileLoop(condition, loopBody);
factory.finishLoop();
return statement;
}
use of cz.cuni.mff.d3s.trupple.language.nodes.statement.StatementNode in project TrufflePascal by Aspect26.
the class FatalError method WithStatement.
StatementNode WithStatement() {
StatementNode statement;
Expect(37);
List<String> recordIdentifiers = IdentifiersList();
LexicalScope initialScope = factory.getScope();
List<FrameSlot> recordSlots = factory.stepIntoRecordsScope(recordIdentifiers);
Expect(38);
StatementNode innerStatement = Statement();
factory.setScope(initialScope);
statement = factory.createWithStatement(recordSlots, innerStatement);
return statement;
}
use of cz.cuni.mff.d3s.trupple.language.nodes.statement.StatementNode in project TrufflePascal by Aspect26.
the class FatalError method IdentifierBeginningStatement.
StatementNode IdentifierBeginningStatement() {
StatementNode statement;
statement = null;
Expect(1);
Token identifierToken = t;
if (StartOf(4)) {
statement = factory.createSubroutineCall(identifierToken, new ArrayList<>());
} else if (la.kind == 6) {
statement = SubroutineCall(identifierToken);
} else if (StartOf(5)) {
statement = Assignment(identifierToken);
} else
SynErr(75);
return statement;
}
use of cz.cuni.mff.d3s.trupple.language.nodes.statement.StatementNode in project TrufflePascal by Aspect26.
the class FatalError method IfStatement.
StatementNode IfStatement() {
StatementNode statement;
Expect(45);
ExpressionNode condition = Expression();
Expect(46);
StatementNode thenStatement = Statement();
StatementNode elseStatement = null;
if (la.kind == 36) {
Get();
elseStatement = Statement();
}
statement = factory.createIfStatement(condition, thenStatement, elseStatement);
return statement;
}
Aggregations