Package com.bacoder.parser.java.api

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


      return type;
    }

    PrimitiveTypeContext primitiveTypeContext = getChild(context, PrimitiveTypeContext.class);
    if (primitiveTypeContext != null) {
      PrimitiveType type = getAdapter(PrimitiveTypeAdapter.class).adapt(primitiveTypeContext);
      type.setDimensions(getAdapter(ArrayDimensionsAdapter.class).adapt(context));
      return type;
    }

    return null;
  }
View Full Code Here


    super(adapters);
  }

  @Override
  public PrimitiveType adapt(PrimitiveTypeContext context) {
    PrimitiveType primitiveType = createNode(context);

    TerminalNode node = getChild(context, TerminalNode.class);
    if (node != null) {
      switch (node.getSymbol().getType()) {
      case JavaParser.BOOLEAN:
        primitiveType.setType(Type.BOOLEAN);
        break;
      case JavaParser.BYTE:
        primitiveType.setType(Type.BYTE);
        break;
      case JavaParser.CHAR:
        primitiveType.setType(Type.CHAR);
        break;
      case JavaParser.DOUBLE:
        primitiveType.setType(Type.DOUBLE);
        break;
      case JavaParser.FLOAT:
        primitiveType.setType(Type.FLOAT);
        break;
      case JavaParser.INT:
        primitiveType.setType(Type.INT);
        break;
      case JavaParser.LONG:
        primitiveType.setType(Type.LONG);
        break;
      case JavaParser.SHORT:
        primitiveType.setType(Type.SHORT);
        break;
      default:
      }
    }
    return primitiveType;
View Full Code Here

TOP

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

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.