use of org.beetl.core.statement.IfStatement in project beetl2.0 by javamonkey.
the class AntlrProgramBuilder method parseIf.
protected IfStatement parseIf(IfStContext ctx) {
ParExpressionContext pe = ctx.parExpression();
ExpressionContext expCtx = pe.expression();
Expression exp = this.parseExpress(expCtx);
StatementContext ifStatCtx = ctx.statement(0);
Statement ifStat = this.parseStatment(ifStatCtx);
StatementContext elseStatCtx = ctx.statement(1);
Statement elseStat = null;
if (elseStatCtx != null) {
elseStat = this.parseStatment(elseStatCtx);
}
return new IfStatement(exp, ifStat, elseStat, this.getBTToken(ctx.If().getSymbol()));
}
Aggregations