use of org.apache.sysml.parser.pydml.PydmlParser.WhileStatementContext in project incubator-systemml by apache.
the class PydmlSyntacticValidator method exitWhileStatement.
@Override
public void exitWhileStatement(WhileStatementContext ctx) {
WhileStatement whileStmt = new WhileStatement();
ConditionalPredicate predicate = new ConditionalPredicate(ctx.predicate.info.expr);
whileStmt.setPredicate(predicate);
int line = ctx.start.getLine();
int col = ctx.start.getCharPositionInLine();
whileStmt.setAllPositions(currentFile, line, col, line, col);
if (ctx.body.size() > 0) {
for (StatementContext stmtCtx : ctx.body) {
whileStmt.addStatementBlock(getStatementBlock(stmtCtx.info.stmt));
}
whileStmt.mergeStatementBlocks();
}
ctx.info.stmt = whileStmt;
setFileLineColumn(ctx.info.stmt, ctx);
}
Aggregations