Changeset 20 in default for trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/actions
- Timestamp:
- 10/29/10 15:39:17 (14 years ago)
- Location:
- trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/actions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/actions/GenerateDefaultMergeDSLAction.java
r5 r20 42 42 private IStructuredSelection selection = StructuredSelection.EMPTY; 43 43 private IFile file=null; 44 private LinkedList<CompositeNode> deltas ;44 private LinkedList<CompositeNode> deltas = null; 45 45 private LinkedList<String> deltaLabels; 46 46 … … 116 116 int counter=1; 117 117 118 for(int p=0; p <a.length; p++) {118 for(int p=0; p < a.length; p++) { 119 119 120 120 File b = (File) a[p]; 121 121 if(!b.getFileExtension().equals("bnf")) 122 122 continue; 123 123 124 124 URI ur = URI.createFileURI(b.getRawLocation().toPortableString()); 125 125 … … 135 135 if(((EtsiBnfImpl) xres.getParseResult().getRootNode().getElement()).getType().equals("/delta")) { 136 136 if(checkImport(xres.getParseResult().getRootNode(), uri.segment(uri.segmentCount()-1))) { 137 137 138 deltas.add(xres.getParseResult().getRootNode()); 138 139 deltaLabels.add("Package" + counter); … … 177 178 String name = ((Rule) node.getElement()).getName().trim(); 178 179 179 for(int i=0; i <deltas.size(); i++) {180 for(int i=0; i < deltas.size(); i++) { 180 181 for(AbstractNode node2: NodeUtil.getAllContents(deltas.get(i))){ 181 182 if(node2.getElement() instanceof ExtRule) … … 194 195 195 196 boolean start = true; 196 while(rules.size() >0) {197 while(rules.size() > 0) { 197 198 current = selectFirstExtension(rules); 198 int index = deltas.indexOf(current.getParent() );199 int index = deltas.indexOf(current.getParent().getParent()); 199 200 if(start) { 200 201 old = current; 201 202 } 202 203 /// URI uri = current.getElement().eResource().getURI(); 203 if((((ExtRule) current.getElement()).getRuleext()!=((ExtRule) old.getElement()).getRuleext()) ||start) {204 if((((ExtRule) current.getElement()).getRuleext()!=((ExtRule) old.getElement()).getRuleext()) || start) { 204 205 205 206 createNewLine('\n' + "hook combinator: " + name + " (" + … … 252 253 int index = 0; 253 254 for(int i=0; i<rules.size(); i++) { 255 254 256 if(((ExtRule) first.getElement()).getRuleext() > ((ExtRule) rules.get(i).getElement()).getRuleext()) { 255 257 first=rules.get(i); -
trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/actions/GenerateDeltaBnfAction.java
r5 r20 221 221 boolean rightSide2=true; 222 222 223 while((p <pLeaves.size())){223 while((p < pLeaves.size())){ 224 224 225 225 if(rightSide) { … … 239 239 } 240 240 241 if(c ==cLeaves.size()) {241 if(c == cLeaves.size()) { 242 242 if(!(pLeaves.get(p).getGrammarElement() instanceof org.eclipse.xtext.impl.TerminalRuleImpl)) 243 243 temp=temp.concat(pLeaves.get(p).serialize()); … … 294 294 } 295 295 296 else {296 // else { 297 297 if(last) { 298 298 //check if its the end of the extension … … 330 330 } 331 331 332 }332 // } 333 333 } 334 334
Note: See TracChangeset
for help on using the changeset viewer.