Esempio n. 1
0
 public void makeConstraint(String constraintString)
     throws OclParserException, OclTypeException, IOException {
   // System.out.println("Loaded constraint:");
   // System.out.println(constraintString);
   // System.out.println("Parsing constraint.");
   OclTree constraintTree = OclTree.createTree(constraintString, modelfacade);
   constraintTree.setNameCreator(namecreator);
   // System.out.println("Type checking constraint.");
   constraintTree.assureTypes();
   // System.out.println("Normalizing.");
   constraintTree.applyDefaultNormalizations();
   // System.out.println("Generating Code.");
   CodeFragment[] frags = jcg.getCode(constraintTree);
   for (int j = 0; j < frags.length; j++) {
     String ct = frags[j].getConstrainedType();
     SortedFragments sf = (SortedFragments) (codefragments.get(ct));
     if (sf == null) codefragments.put(ct, new SortedFragments(frags[j]));
     else sf.addFragment(frags[j]);
   }
 }
Esempio n. 2
0
 {
   jcg.setInitialIndent(0);
 }