Package org.openarchitectureware.xtend.ast

Examples of org.openarchitectureware.xtend.ast.ExtensionFile


   */
  public void test1() throws Exception {
    String checkFile = "src/metamodel/Checks.chk";
    InputStream in = new FileInputStream(checkFile);
   
    ExtensionFile file = ParseFacade.file(new InputStreamReader(in), checkFile);
   
    for (Check check : file.getChecks()) {
      System.out.println("Message: " + check.getMsg());
      System.out.println(check.getConstraint().getClass());
      System.out.println("Constraint: " + check.getConstraint());
      System.out.println();
    }
View Full Code Here


    fr.setPlugin(plugin);
    fr.setPackage(packageBase);
    fr.setName(name);
    fr.setParent(root);
   
    ExtensionFile file = ParseFacade.file(new InputStreamReader(in), extFile);
   
    for (Extension ext : file.getExtensions()) {
   
      // is there at least one type?
      if (ext.getFormalParameters() != null && ext.getFormalParameters().size() > 0) {
       
        // map the Type (the first parameter) to an EMFClass
View Full Code Here

    fr.setPlugin(plugin);
    fr.setPackage(packageBase);
    fr.setName(name);
    fr.setParent(root);
   
    ExtensionFile file = ParseFacade.file(new InputStreamReader(in), checkFile);
   
    for (Check check : file.getChecks()) {
     
      // map the Identifier (the context) to an EMFClass
      EMFClass identifier = mapOAWIdentifier(root, check.getType());
      if (identifier == null)
        continue// unidentified type (e.g. emf::EObject)

      // make a new Constraint for this check
      Constraint constraint = factory.createConstraint();
      constraint.setConstraint(check.getConstraint().toString());
      constraint.setType( check.isErrorCheck() ? ConstraintType.ERROR : ConstraintType.WARNING );
      constraint.setMessage( check.getMsg().toString() );

      // make a new FileReference
      FileLineReference line = factory.createFileLineReference();
      line.setFile(fr);
      line.setLine(check.getLine());
      constraint.setReference(line);
     
      // add this constraint
      identifier.getConstraints().add(constraint);
    }
   
    // set number of constraints
    fr.setUniqueConstraints(file.getChecks().size());
   
  }
View Full Code Here

TOP

Related Classes of org.openarchitectureware.xtend.ast.ExtensionFile

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.