Package com.bacoder.parser.java.api

Examples of com.bacoder.parser.java.api.IfStatement


    return forStatement;
  }

  protected IfStatement processIfStatement(StatementContext context) {
    IfStatement ifStatement = createNode(context, IfStatement.class);

    ParExpressionContext parExpressionContext = getChild(context, ParExpressionContext.class);
    ifStatement.setCondition(processParExpression(parExpressionContext));

    List<StatementContext> statementContexts = getChildren(context, StatementContext.class);
    if (statementContexts.size() > 0) {
      ifStatement.setThenStatement(
          getAdapter(StatementAdapter.class).adapt(statementContexts.get(0)));
    }

    if (statementContexts.size() > 1) {
      ifStatement.setElseStatement(
          getAdapter(StatementAdapter.class).adapt(statementContexts.get(1)));
    }

    return ifStatement;
  }
View Full Code Here

TOP

Related Classes of com.bacoder.parser.java.api.IfStatement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.