use of cz.cuni.mff.d3s.trupple.language.nodes.statement.StatementNode in project TrufflePascal by Aspect26.
the class FatalError method CaseStatement.
StatementNode CaseStatement() {
StatementNode statement;
Expect(23);
ExpressionNode caseExpression = Expression();
Expect(13);
CaseStatementData caseData = CaseList();
caseData.caseExpression = caseExpression;
Expect(21);
statement = factory.createCaseStatement(caseData);
return statement;
}
use of cz.cuni.mff.d3s.trupple.language.nodes.statement.StatementNode in project TrufflePascal by Aspect26.
the class FatalError method RepeatLoop.
StatementNode RepeatLoop() {
StatementNode statement;
factory.startLoop();
Expect(42);
List<StatementNode> bodyNodes = new ArrayList<>();
StatementSequence(bodyNodes);
Expect(43);
ExpressionNode condition = Expression();
statement = factory.createRepeatLoop(condition, factory.createBlockNode(bodyNodes, this.extendedGotoSupport));
factory.finishLoop();
return statement;
}
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 Statement.
StatementNode Statement() {
StatementNode statement;
statement = null;
Token label = null;
if (la.kind == 3) {
label = Label();
Expect(25);
}
switch(la.kind) {
case 8:
case 22:
case 38:
case 45:
{
statement = factory.createNopStatement();
break;
}
case 47:
{
statement = IfStatement();
break;
}
case 41:
{
statement = ForLoop();
break;
}
case 46:
{
statement = WhileLoop();
break;
}
case 44:
{
statement = RepeatLoop();
break;
}
case 24:
{
statement = CaseStatement();
break;
}
case 36:
{
Get();
statement = factory.createBreak();
break;
}
case 39:
{
statement = WithStatement();
break;
}
case 49:
{
statement = GotoStatement();
break;
}
case 35:
{
statement = Block();
break;
}
case 1:
{
statement = IdentifierBeginningStatement();
break;
}
default:
SynErr(80);
break;
}
if (label != null)
statement = factory.createLabeledStatement(statement, label);
return statement;
}
use of cz.cuni.mff.d3s.trupple.language.nodes.statement.StatementNode in project TrufflePascal by Aspect26.
the class FatalError method RepeatLoop.
StatementNode RepeatLoop() {
StatementNode statement;
factory.startLoop();
Expect(44);
List<StatementNode> bodyNodes = new ArrayList<>();
StatementSequence(bodyNodes);
Expect(45);
ExpressionNode condition = Expression();
statement = factory.createRepeatLoop(condition, factory.createBlockNode(bodyNodes, this.extendedGotoSupport));
factory.finishLoop();
return statement;
}
Aggregations