/** Get parent of this grammar */ public Grammar getDelegator(Grammar g) { CompositeGrammarTree me = delegateGrammarTreeRoot.findNode(g); if ( me==null ) { return null; // not found } if ( me.parent!=null ) { return me.parent.grammar; } return null; }
/** Get parent of this grammar */ public Grammar getDelegator(Grammar g) { CompositeGrammarTree me = delegateGrammarTreeRoot.findNode(g); if ( me==null ) { return null; // not found } if ( me.parent!=null ) { return me.parent.grammar; } return null; }
public Grammar getGrammar(String grammarName) { CompositeGrammarTree t = delegateGrammarTreeRoot.findNode(grammarName); if ( t!=null ) { return t.grammar; } return null; }
public Grammar getGrammar(String grammarName) { CompositeGrammarTree t = delegateGrammarTreeRoot.findNode(grammarName); if ( t!=null ) { return t.grammar; } return null; }
public Grammar getGrammar(String grammarName) { CompositeGrammarTree t = delegateGrammarTreeRoot.findNode(grammarName); if ( t!=null ) { return t.grammar; } return null; }
/** Get parent of this grammar */ public Grammar getDelegator(Grammar g) { CompositeGrammarTree me = delegateGrammarTreeRoot.findNode(g); if ( me==null ) { return null; // not found } if ( me.parent!=null ) { return me.parent.grammar; } return null; }
/** Get parent of this grammar */ public Grammar getDelegator(Grammar g) { CompositeGrammarTree me = delegateGrammarTreeRoot.findNode(g); if ( me==null ) { return null; // not found } if ( me.parent!=null ) { return me.parent.grammar; } return null; }
public Grammar getGrammar(String grammarName) { CompositeGrammarTree t = delegateGrammarTreeRoot.findNode(grammarName); if ( t!=null ) { return t.grammar; } return null; }
public List<Grammar> getDirectDelegates(Grammar g) { CompositeGrammarTree t = delegateGrammarTreeRoot.findNode(g); List<CompositeGrammarTree> children = t.children; if ( children==null ) { return null; } List<Grammar> grammars = new ArrayList(); for (int i = 0; children!=null && i < children.size(); i++) { CompositeGrammarTree child = (CompositeGrammarTree) children.get(i); grammars.add(child.grammar); } return grammars; }
public List<Grammar> getDirectDelegates(Grammar g) { CompositeGrammarTree t = delegateGrammarTreeRoot.findNode(g); List<CompositeGrammarTree> children = t.children; if ( children==null ) { return null; } List<Grammar> grammars = new ArrayList<Grammar>(); for (int i = 0; children!=null && i < children.size(); i++) { CompositeGrammarTree child = children.get(i); grammars.add(child.grammar); } return grammars; }
public List<Grammar> getDirectDelegates(Grammar g) { CompositeGrammarTree t = delegateGrammarTreeRoot.findNode(g); List<CompositeGrammarTree> children = t.children; if ( children==null ) { return null; } List<Grammar> grammars = new ArrayList<Grammar>(); for (int i = 0; children!=null && i < children.size(); i++) { CompositeGrammarTree child = children.get(i); grammars.add(child.grammar); } return grammars; }
public List<Grammar> getDirectDelegates(Grammar g) { CompositeGrammarTree t = delegateGrammarTreeRoot.findNode(g); List<CompositeGrammarTree> children = t.children; if ( children==null ) { return null; } List<Grammar> grammars = new ArrayList(); for (int i = 0; children!=null && i < children.size(); i++) { CompositeGrammarTree child = (CompositeGrammarTree) children.get(i); grammars.add(child.grammar); } return grammars; }
/** Get list of all delegates from all grammars in the delegate subtree of g. * The grammars are in delegation tree preorder. Don't include g itself * in list as it is not a delegate of itself. */ public List<Grammar> getDelegates(Grammar g) { CompositeGrammarTree t = delegateGrammarTreeRoot.findNode(g); if ( t==null ) { return null; // no delegates } List<Grammar> grammars = t.getPostOrderedGrammarList(); grammars.remove(grammars.size()-1); // remove g (last one) return grammars; }
/** Get list of all delegates from all grammars in the delegate subtree of g. * The grammars are in delegation tree preorder. Don't include g itself * in list as it is not a delegate of itself. */ public List<Grammar> getDelegates(Grammar g) { CompositeGrammarTree t = delegateGrammarTreeRoot.findNode(g); if ( t==null ) { return null; // no delegates } List<Grammar> grammars = t.getPostOrderedGrammarList(); grammars.remove(grammars.size()-1); // remove g (last one) return grammars; }
/** Get list of all delegates from all grammars in the delegate subtree of g. * The grammars are in delegation tree preorder. Don't include g itself * in list as it is not a delegate of itself. */ public List<Grammar> getDelegates(Grammar g) { CompositeGrammarTree t = delegateGrammarTreeRoot.findNode(g); if ( t==null ) { return null; // no delegates } List<Grammar> grammars = t.getPostOrderedGrammarList(); grammars.remove(grammars.size()-1); // remove g (last one) return grammars; }
/** Get list of all delegates from all grammars in the delegate subtree of g. * The grammars are in delegation tree preorder. Don't include g itself * in list as it is not a delegate of itself. */ public List<Grammar> getDelegates(Grammar g) { CompositeGrammarTree t = delegateGrammarTreeRoot.findNode(g); if ( t==null ) { return null; // no delegates } List<Grammar> grammars = t.getPostOrderedGrammarList(); grammars.remove(grammars.size()-1); // remove g (last one) return grammars; }
/** add new delegate to composite tree */ protected void addDelegateGrammar(Grammar delegateGrammar) { CompositeGrammarTree t = composite.delegateGrammarTreeRoot.findNode(this); t.addChild(new CompositeGrammarTree(delegateGrammar)); // make sure new grammar shares this composite delegateGrammar.composite = this.composite; }
/** add new delegate to composite tree */ protected void addDelegateGrammar(Grammar delegateGrammar) { CompositeGrammarTree t = composite.delegateGrammarTreeRoot.findNode(this); t.addChild(new CompositeGrammarTree(delegateGrammar)); // make sure new grammar shares this composite delegateGrammar.composite = this.composite; }
/** add new delegate to composite tree */ protected void addDelegateGrammar(Grammar delegateGrammar) { CompositeGrammarTree t = composite.delegateGrammarTreeRoot.findNode(this); t.addChild(new CompositeGrammarTree(delegateGrammar)); // make sure new grammar shares this composite delegateGrammar.composite = this.composite; }
/** add new delegate to composite tree */ protected void addDelegateGrammar(Grammar delegateGrammar) { CompositeGrammarTree t = composite.delegateGrammarTreeRoot.findNode(this); t.addChild(new CompositeGrammarTree(delegateGrammar)); // make sure new grammar shares this composite delegateGrammar.composite = this.composite; }