use of org.apache.sysml.parser.pydml.PydmlParser.StatementContext 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);
whileStmt.setCtxValuesAndFilename(ctx, currentFile);
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);
}
use of org.apache.sysml.parser.pydml.PydmlParser.StatementContext in project incubator-systemml by apache.
the class PydmlSyntacticValidator method exitElifBranch.
@Override
public void exitElifBranch(ElifBranchContext ctx) {
IfStatement elifStmt = new IfStatement();
ConditionalPredicate predicate = new ConditionalPredicate(ctx.predicate.info.expr);
elifStmt.setConditionalPredicate(predicate);
elifStmt.setCtxValuesAndFilename(ctx, currentFile);
if (ctx.elifBody.size() > 0) {
for (StatementContext stmtCtx : ctx.elifBody) {
elifStmt.addStatementBlockIfBody(getStatementBlock(stmtCtx.info.stmt));
}
elifStmt.mergeStatementBlocksIfBody();
}
ctx.info.stmt = elifStmt;
setFileLineColumn(ctx.info.stmt, ctx);
}
Aggregations