Package org.csu.idl.idlmm

Examples of org.csu.idl.idlmm.TranslationUnit


   */
  private static IScope depthTraverse(EClass type, Iterator<TranslationUnit> iterator) throws Exception {
    IScope outer = IScope.NULLSCOPE;

    if (iterator.hasNext()) {
      TranslationUnit trunit = iterator.next();
      // inner scope calculation
      IScope scope = getScope(trunit, type);
      // outer scope calculation
      outer = depthTraverse(type, iterator);
      // concatenation
View Full Code Here


   *
   * @param include
   * @return
   */
  public static int include2stream(Include include) {
    TranslationUnit tu = (TranslationUnit) include.eContainer();
    Resource resource = tu.eResource();
    ResourceSet resourceSet = resource.getResourceSet();
    EList<Resource> resources = resourceSet.getResources();

    int result = tu.getIncludes().indexOf(include);
    int res = resources.indexOf(resource);

    for (int i = 0; i < res; i++) {
      result += ((TranslationUnit) resources.get(i)).getIncludes().size();
    }
View Full Code Here

    LinkedList<TranslationUnit> result = new LinkedList<TranslationUnit>();

    for (Include incl : includes) {
      Resource resource = currentLoader.loadInclude(incl);

      TranslationUnit obj = (TranslationUnit) resource.getContents().get(0);

      // extract the list of includes ordered by "outer" for
      // using with depthTraverse
      result.add(obj);
View Full Code Here

      loader.load(filePath);
    } catch (Exception e) {
      e.printStackTrace();
      System.exit(1);
    }
    TranslationUnit model = loader.getModel();

    // Xpand
    generate(model);
  }
View Full Code Here

  }

  protected static void convert(TranslationUnit tu) throws Exception {
   
    for (Include include: tu.getIncludes()) {
      TranslationUnit current = (TranslationUnit) IDLScopingHelper.getCurrentLoader().loadInclude(include).getContents().get(0);
      include.setTranslationUnit(current);
     
      // Recursivo
      convert(current);
    }
View Full Code Here

    model = resourceSet.createResource(URI.createURI("dummy:/" + numInclude + "/" + filePath));
    InputStream in = new ByteArrayInputStream(resources.get(numInclude++).toByteArray());

    model.load(in, resourceSet.getLoadOptions());
 
    TranslationUnit trunit = (TranslationUnit) model.getContents().get(0);
       
    BasicDiagnostic bd = new BasicDiagnostic();
    IDLJavaValidator idlValidator = new IDLJavaValidator();
    idlValidator.validate(trunit, bd, new HashMap<Object,Object>());
    new ShowErrors().show(bd);
View Full Code Here

    InputStream in = new ByteArrayInputStream(resources.get(numInclude++).toByteArray());
   
    resource.load(in, resourceSet.getLoadOptions());

    // Transformations
    TranslationUnit trunit = (TranslationUnit) resource.getContents().get(0);
    ExpressionEvaluator.evaluate(trunit);
    ArrayExpander.expand(trunit);

    logger.debug("Loaded " + filePath + " as resource " + resource.getURI());
View Full Code Here

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setTranslationUnit(TranslationUnit newTranslationUnit) {
    TranslationUnit oldTranslationUnit = translationUnit;
    translationUnit = newTranslationUnit;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, IdlmmPackage.INCLUDE__TRANSLATION_UNIT, oldTranslationUnit, translationUnit));
  }
View Full Code Here

TOP

Related Classes of org.csu.idl.idlmm.TranslationUnit

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.