Examples of CompilationUnit


Examples of at.bestsolution.efxclipse.tooling.rrobot.model.task.CompilationUnit

@SuppressWarnings("all")
public class MediaPartTpl implements Generator<DynamicFile> {
  public InputStream generate(final DynamicFile file, final Map<String,Object> data) {
    EObject _eContainer = file.eContainer();
    final CompilationUnit cu = ((CompilationUnit) _eContainer);
    String _packagename = cu.getPackagename();
    String _packagename_1 = cu.getPackagename();
    int _lastIndexOf = _packagename_1.lastIndexOf(".");
    String _substring = _packagename.substring(0, _lastIndexOf);
    final String modelPackage = (_substring + ".model");
    String _packagename_2 = cu.getPackagename();
    String _packagename_3 = cu.getPackagename();
    int _lastIndexOf_1 = _packagename_3.lastIndexOf(".");
    String _substring_1 = _packagename_2.substring(0, _lastIndexOf_1);
    final String handlersPackage = (_substring_1 + ".handlers");
    String _packagename_4 = cu.getPackagename();
    CharSequence _generate = this.generate(_packagename_4, modelPackage, handlersPackage);
    String _string = _generate.toString();
    byte[] _bytes = _string.getBytes();
    ByteArrayInputStream _byteArrayInputStream = new ByteArrayInputStream(_bytes);
    return _byteArrayInputStream;
View Full Code Here

Examples of com.asakusafw.utils.java.model.syntax.CompilationUnit

    public CompiledType emit(String moduleId, CopyDescription slot, boolean prologue) throws IOException {
        Precondition.checkMustNotBeNull(moduleId, "moduleId"); //$NON-NLS-1$
        Precondition.checkMustNotBeNull(slot, "slot"); //$NON-NLS-1$
        LOG.debug("Generates a mapper for \"{}\" in \"{}\"",
                slot.getName(), moduleId);
        CompilationUnit source;
        Engine engine = new Engine(environment, moduleId, slot, prologue);
        source = engine.generate();
        environment.emit(source);
        Name packageName = source.getPackageDeclaration().getName();
        SimpleName simpleName = source.getTypeDeclarations().get(0).getName();
        Name name = environment.getModelFactory().newQualifiedName(packageName, simpleName);
        LOG.debug("Mapper for \"{}\" is {}",
                slot.getName(),
                name);
        return new CompiledType(name);
View Full Code Here

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

    super(adapters);
  }

  @Override
  public CompilationUnit adapt(CompilationUnitContext context) {
    CompilationUnit compilationUnit = createNode(context);

    PackageDeclarationContext packageDeclarationContext =
        getChild(context, PackageDeclarationContext.class);
    if (packageDeclarationContext != null) {
      compilationUnit.setPackageDeclaration(
          getAdapter(PackageDeclarationAdapter.class).adapt(packageDeclarationContext));
    }

    List<ImportDeclaration> importDeclarationas =
        transform(context, ImportDeclarationContext.class, new Function<ImportDeclarationContext,
            ImportDeclaration>() {
          @Override
          public ImportDeclaration apply(ImportDeclarationContext context) {
            return getAdapter(ImportDeclarationAdapter.class).adapt(context);
          }
        });
    compilationUnit.setImportDeclarations(importDeclarationas);

    List<TypeDeclaration> typeDeclarations =
        transform(context, TypeDeclarationContext.class, new Function<TypeDeclarationContext,
            TypeDeclaration>() {
          @Override
          public TypeDeclaration apply(TypeDeclarationContext context) {
            return getAdapter(TypeDeclarationAdapter.class).adapt(context);
          }
        });
    compilationUnit.setTypeDeclarations(typeDeclarations);

    return compilationUnit;
  }
View Full Code Here

Examples of com.github.antlrjavaparser.api.CompilationUnit

            sb.append("\n");
            sb.append("  }\n");
            sb.append("}\n");
            final ByteArrayInputStream bais = new ByteArrayInputStream(sb
                    .toString().getBytes());
            CompilationUnit ci;
            try {
                ci = JavaParser.parse(bais);
            }
            catch (final IOException e) {
                throw new IllegalStateException(
                        "Illegal state: Unable to parse input stream", e);
            }
            catch (final ParseException pe) {
                throw new IllegalStateException(
                        "Illegal state: JavaParser did not parse correctly", pe);
            }
            final List<TypeDeclaration> types = ci.getTypes();
            if (types == null || types.size() != 1) {
                throw new IllegalArgumentException("Method body invalid");
            }
            final TypeDeclaration td = types.get(0);
            final List<BodyDeclaration> bodyDeclarations = td.getMembers();
View Full Code Here

Examples of com.google.dart.engine.ast.CompilationUnit

      String oldContents, String newContents, int offset, int oldLength, int newLength,
      SourceEntry sourceEntry) {

    // Determine the cache resolved unit
    Source librarySource = null;
    CompilationUnit unit = null;
    if (sourceEntry instanceof DartEntryImpl) {
      DartEntryImpl dartEntry = (DartEntryImpl) sourceEntry;
      Source[] librarySources = dartEntry.getLibrariesContaining();
      if (librarySources.length == 1) {
        librarySource = librarySources[0];
View Full Code Here

Examples of com.google.gwt.dev.javac.CompilationUnit

     * assignment is based around reflection on Class objects. Don't inject JSNI
     * when loading a JSO interface class; just wait until the implementation
     * class is loaded.
     */
    if (!classRewriter.isJsoIntf(className)) {
      CompilationUnit unit = getUnitForClassName(canonicalizeClassName(className));
      if (unit != null) {
        toInject.push(unit);
      }
    }

    if (localInjection) {
      try {
        /*
         * Can't use an iterator here because calling injectJsniFor may cause
         * additional entries to be added.
         */
        while (toInject.size() > 0) {
          CompilationUnit unit = toInject.remove(0);
          if (!alreadyInjected.contains(unit)) {
            injectJsniMethods(unit);
            alreadyInjected.add(unit);
          }
        }
View Full Code Here

Examples of com.google.gxp.compiler.CompilationUnit

   */
  private Root getRoot(TemplateName templateName) {
    if (templateName.getPackageName() == null) {
      throw new IllegalArgumentException("templateName must be fully qualified");
    }
    CompilationUnit compilationUnit = compilationSet.getCompilationUnit(
        (TemplateName.FullyQualified) templateName);
    return (compilationUnit == null) ? null : compilationUnit.getReparentedTree().getRoot();
  }
View Full Code Here

Examples of com.google.gxp.compiler.CompilationUnit

    return unit.getSourceFileRef().getLastModified();
  }

  // implements CompilationManager
  public boolean sourceChanged(CompilationTask task) {
    CompilationUnit unit = task.getCompilationUnit();
    DependencyNode node = nodes.get(unit.getTemplateName());
    if (node != null) {
      long oldTimestamp = node.getLastModified();
      if (oldTimestamp > 0L) {
        return oldTimestamp != getLastModified(unit);
      }
View Full Code Here

Examples of com.google.gxp.compiler.CompilationUnit

    return true;
  }

  // implements CompilationManager
  public boolean usedInterfacesChanged(CompilationTask task) {
    CompilationUnit unit = task.getCompilationUnit();
    DependencyNode node = nodes.get(unit.getTemplateName());
    if (node != null) {
      Set<Callable> oldRequirements = node.getRequirements();
      return !oldRequirements.equals(getRequirements(unit));
    }
    // We never saw the file before so play it safe.
View Full Code Here

Examples of com.redhat.ceylon.compiler.typechecker.tree.Tree.CompilationUnit

        }
    }

    private void buildNodesMaps() {
        for (final PhasedUnit pu : phasedUnits) {
            CompilationUnit cu = pu.getCompilationUnit();
            Walker.walkCompilationUnit(new Visitor() {
                public void visit(Tree.Declaration that) {
                    modelUnitMap.put(that.getDeclarationModel(), pu);
                    modelNodeMap.put(that.getDeclarationModel(), that);
                    super.visit(that);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.