Changeset 887
- Timestamp:
- 04/29/12 16:51:48 (13 months ago)
- Location:
- dpf-model-editor/trunk/examples/no.hib.dpf.codegen.examples.dpfplay/src
- Files:
-
- 3 modified
-
extensions/dpfplay.ext (modified) (1 diff)
-
extensions/TemplateHelper.java (modified) (3 diffs)
-
template/templ.xpt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
dpf-model-editor/trunk/examples/no.hib.dpf.codegen.examples.dpfplay/src/extensions/dpfplay.ext
r854 r887 22 22 let constructorInitList = attr.collect(e|"this." + e.name + " = " + e.name + ";") : 23 23 constructorInitList.addAll(ref.collect(e|"this." + e.name + " = " + e.name + ";")); 24 25 String printSymbols(Specification spec): 26 JAVA extensions.TemplateHelper.printSymbols(no.hib.dpf.core.Specification); -
dpf-model-editor/trunk/examples/no.hib.dpf.codegen.examples.dpfplay/src/extensions/TemplateHelper.java
r854 r887 5 5 import no.hib.dpf.core.Constraint; 6 6 import no.hib.dpf.core.Node; 7 import no.hib.dpf.core.Specification; 7 8 8 9 public class TemplateHelper { … … 45 46 public static boolean hasOneOrManyToOtherConstraint(Arrow a) { 46 47 for(Constraint c : a.getConstraints()) { 47 if(c.getPredicate().getSymbol().equals(MULT_CONSTRAINT)) {48 // if(c.getPredicate().getSymbol().equals(MULT_CONSTRAINT)) { 48 49 if(!parseConstraint(c.getParameters()).equals(Mult.MANY_TO_ONE)) 49 50 return true; 50 }51 // } 51 52 } 52 53 return false; … … 78 79 return ret.toString(); 79 80 } 81 82 public String printSymbols(Specification spec) { 83 StringBuffer buf = new StringBuffer(); 84 for(Constraint c : spec.getConstraints()) { 85 // try { 86 buf.append("Symbol for " + c.getId() + ": " + c.getPredicate().getSymbol() + 87 " Parameters: " + c.getParameters() + "\n"); 88 // } catch(NullPointerException e) { 89 // buf.append("Symbol for " + c.getId() + ": npe\n"); 90 // } 91 } 92 return buf.toString(); 93 } 80 94 } 81 95 -
dpf-model-editor/trunk/examples/no.hib.dpf.codegen.examples.dpfplay/src/template/templ.xpt
r856 r887 1 1 «IMPORT dpf» 2 2 «EXTENSION extensions::dpfplay» 3 «EXTENSION org::eclipse::xtend::util::stdlib::io» 3 4 4 5 «DEFINE main FOR dpf::Specification» 6 «syserr(printSymbols(this))» 5 7 «EXPAND graph FOR this.graph» 6 8 «ENDDEFINE»
![(please configure the [header_logo] section in trac.ini)](/trac/eclipsep/chrome/site/your_project_logo.png)