Package com.bacoder.parser.java.JavaParser

Examples of com.bacoder.parser.java.JavaParser.BlockContext


      }
      default:
      }
    }

    BlockContext blockContext = getChild(context, BlockContext.class);
    if (blockContext != null) {
      return getAdapter(BlockAdapter.class).adapt(blockContext);
    }

    StatementExpressionContext statementExpressionContext =
View Full Code Here


    SynchronizedStatement synchronizedStatement = createNode(context, SynchronizedStatement.class);

    ParExpressionContext parExpressionContext = getChild(context, ParExpressionContext.class);
    synchronizedStatement.setExpression(processParExpression(parExpressionContext));

    BlockContext blockContext = getChild(context, BlockContext.class);
    if (blockContext != null) {
      synchronizedStatement.setBody(getAdapter(BlockAdapter.class).adapt(blockContext));
    }

    return synchronizedStatement;
View Full Code Here

              }
            }));
      }
    }

    BlockContext blockContext = getChild(context, BlockContext.class);
    if (blockContext != null) {
      tryStatement.setBody(getAdapter(BlockAdapter.class).adapt(blockContext));
    }

    tryStatement.setCatchClauses(transform(context, CatchClauseContext.class,
        new Function<CatchClauseContext, CatchClause>() {
          @Override
          public CatchClause apply(CatchClauseContext context) {
            CatchClause catchClause = createNode(context, CatchClause.class);

            setModifiers(context, catchClause);

            CatchTypeContext catchTypeContext = getChild(context, CatchTypeContext.class);
            if (catchTypeContext != null) {
              catchClause.setExceptions(transform(catchTypeContext, QualifiedNameContext.class,
                  new Function<QualifiedNameContext, QualifiedName>() {
                    @Override
                    public QualifiedName apply(QualifiedNameContext context) {
                      return getAdapter(QualifiedNameAdapter.class).adapt(context);
                    }
                  }));
            }

            TerminalNode identifierNode = getTerminalNode(context, JavaParser.Identifier);
            if (identifierNode != null) {
              catchClause.setVariable(getAdapter(IdentifierAdapter.class).adapt(identifierNode));
            }

            BlockContext blockContext = getChild(context, BlockContext.class);
            if (blockContext != null) {
              catchClause.setBody(getAdapter(BlockAdapter.class).adapt(blockContext));
            }

            return catchClause;
          }
        }));

    FinallyBlockContext finallyBlockContext = getChild(context, FinallyBlockContext.class);
    if (finallyBlockContext != null) {
      BlockContext finallyBodyContext = getChild(finallyBlockContext, BlockContext.class);
      if (finallyBodyContext != null) {
        tryStatement.setFinallyBlock(getAdapter(BlockAdapter.class).adapt(finallyBodyContext));
      }
    }
View Full Code Here

          getAdapter(QualifiedNamesAdapter.class).adapt(qualifiedNameListContext));
    }

    MethodBodyContext methodBodyContext = getChild(context, MethodBodyContext.class);
    if (methodBodyContext != null) {
      BlockContext blockContext = getChild(methodBodyContext, BlockContext.class);
      if (blockContext != null) {
        methodDeclaration.setBody(getAdapter(BlockAdapter.class).adapt(blockContext));
      }
    }
View Full Code Here

    super(adapters);
  }

  @Override
  public ClassMemberDeclaration adapt(ClassBodyDeclarationContext context) {
    BlockContext blockContext = getChild(context, BlockContext.class);
    if (blockContext != null) {
      BlockDeclaration blockDeclaration = createNode(blockContext, BlockDeclaration.class);
      blockDeclaration.setStatic(hasTerminalNode(context, JavaParser.STATIC));
      blockDeclaration.setBlock(getAdapter(BlockAdapter.class).adapt(blockContext));
      return blockDeclaration;
View Full Code Here

          getAdapter(QualifiedNamesAdapter.class).adapt(qualifiedNameListContext));
    }

    ConstructorBodyContext constructorBodyContext = getChild(context, ConstructorBodyContext.class);
    if (constructorBodyContext != null) {
      BlockContext blockContext = getChild(constructorBodyContext, BlockContext.class);
      if (blockContext != null) {
        constructorDeclaration.setBody(getAdapter(BlockAdapter.class).adapt(blockContext));
      }
    }
View Full Code Here

TOP

Related Classes of com.bacoder.parser.java.JavaParser.BlockContext

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.