Package com.bacoder.parser.java.api

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


      @Override
      public Void apply(ParseTree input) {
        if (input instanceof TerminalNode) {
          TerminalNode terminalNode = (TerminalNode) input;
          if (terminalNode.getSymbol().getType() == JavaParser.Identifier) {
            IdentifierWithTypeArguments element =
                createNode(input, IdentifierWithTypeArguments.class);
            element.setIdentifier(getAdapter(IdentifierAdapter.class).adapt(terminalNode));
            identifierWithTypeArguments.add(element);
          }
        } else if (input instanceof TypeArgumentsOrDiamondContext) {
          int size = identifierWithTypeArguments.size();
          if (size > 0) {
            IdentifierWithTypeArguments element = identifierWithTypeArguments.get(size - 1);
            setNodeAttributes(element, null, input);

            TypeArgumentsOrDiamondContext typeArgumentsOrDiamondContext =
                (TypeArgumentsOrDiamondContext) input;
            TypeArgumentsContext typeArgumentsContext =
                getChild(typeArgumentsOrDiamondContext, TypeArgumentsContext.class);
            if (typeArgumentsContext != null) {
              element.setTypeArguments(
                  getAdapter(TypeArgumentsAdapter.class).adapt(typeArgumentsContext));
            }
          }
        } else if (input instanceof NonWildcardTypeArgumentsOrDiamondContext) {
          int size = identifierWithTypeArguments.size();
          if (size > 0) {
            IdentifierWithTypeArguments element = identifierWithTypeArguments.get(size - 1);
            setNodeAttributes(element, null, input);

            NonWildcardTypeArgumentsContext nonWildcardTypeArgumentsContext =
                (NonWildcardTypeArgumentsContext) input;
            element.setTypeArguments(getAdapter(NonWildcardTypeArgumentsAdapter.class).adapt(
                nonWildcardTypeArgumentsContext));
          }
        }
        return null;
      }
View Full Code Here

TOP

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

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.