Package com.bacoder.parser.java.api

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


    ForControlContext forControlContext = getChild(context, ForControlContext.class);
    if (forControlContext != null) {
      EnhancedForControlContext enhancedForControlContext =
          getChild(forControlContext, EnhancedForControlContext.class);
      if (enhancedForControlContext == null) {
        LoopControl loopControl = createNode(forControlContext, LoopControl.class);

        ForInitContext forInitContext = getChild(forControlContext, ForInitContext.class);
        if (forInitContext != null) {
          LocalVariableDeclarationContext localVariableDeclarationContext =
              getChild(forInitContext, LocalVariableDeclarationContext.class);
          if (localVariableDeclarationContext != null) {
            loopControl.setVariableDeclaration(
                getAdapter(LocalVariableDeclarationAdapter.class).adapt(
                    localVariableDeclarationContext));
          }

          ExpressionListContext expressionListContext =
              getChild(forControlContext, ExpressionListContext.class);
          if (expressionListContext != null) {
            loopControl.setInitExpressions(
                getAdapter(ExpressionListAdapter.class).adapt(expressionListContext));
          }
        }

        ExpressionContext expressionContext = getChild(forControlContext, ExpressionContext.class);
        if (expressionContext != null) {
          loopControl.setCondition(getAdapter(ExpressionAdapter.class).adapt(expressionContext));
        }

        ForUpdateContext forUpdateContext = getChild(forControlContext, ForUpdateContext.class);
        if (forUpdateContext != null) {
          ExpressionListContext expressionListContext =
              getChild(forUpdateContext, ExpressionListContext.class);
          if (expressionListContext != null) {
            loopControl.setUpdateExpressions(
                getAdapter(ExpressionListAdapter.class).adapt(expressionListContext));
          }
        }

        forStatement.setControl(loopControl);
View Full Code Here

TOP

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

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.