use of org.apache.sysml.parser.dml.DmlParser.ForStatementContext in project incubator-systemml by apache.
the class DmlSyntacticValidator method exitForStatement.
@Override
public void exitForStatement(ForStatementContext ctx) {
ForStatement forStmt = new ForStatement();
DataIdentifier iterVar = new DataIdentifier(ctx.iterVar.getText());
HashMap<String, String> parForParamValues = null;
// 1/-1
Expression incrementExpr = null;
if (ctx.iterPred.info.increment != null) {
incrementExpr = ctx.iterPred.info.increment;
}
IterablePredicate predicate = new IterablePredicate(ctx, iterVar, ctx.iterPred.info.from, ctx.iterPred.info.to, incrementExpr, parForParamValues, currentFile);
forStmt.setPredicate(predicate);
if (ctx.body.size() > 0) {
for (StatementContext stmtCtx : ctx.body) {
forStmt.addStatementBlock(getStatementBlock(stmtCtx.info.stmt));
}
forStmt.mergeStatementBlocks();
}
ctx.info.stmt = forStmt;
}
use of org.apache.sysml.parser.dml.DmlParser.ForStatementContext in project systemml by apache.
the class DmlSyntacticValidator method exitForStatement.
@Override
public void exitForStatement(ForStatementContext ctx) {
ForStatement forStmt = new ForStatement();
DataIdentifier iterVar = new DataIdentifier(ctx.iterVar.getText());
HashMap<String, String> parForParamValues = null;
// 1/-1
Expression incrementExpr = null;
if (ctx.iterPred.info.increment != null) {
incrementExpr = ctx.iterPred.info.increment;
}
IterablePredicate predicate = new IterablePredicate(ctx, iterVar, ctx.iterPred.info.from, ctx.iterPred.info.to, incrementExpr, parForParamValues, currentFile);
forStmt.setPredicate(predicate);
if (ctx.body.size() > 0) {
for (StatementContext stmtCtx : ctx.body) {
forStmt.addStatementBlock(getStatementBlock(stmtCtx.info.stmt));
}
forStmt.mergeStatementBlocks();
}
ctx.info.stmt = forStmt;
}
Aggregations