1 8 9 package net.sourceforge.chaperon.process.extended; 10 11 import net.sourceforge.chaperon.model.extended.Pattern; 12 13 public class NonterminalStackNode extends StackNode 14 { 15 public StackNodeList definition = null; 16 17 public NonterminalStackNode(StackNodeList definition, Pattern pattern, StackNode ancestor) 18 { 19 this.definition = definition; 20 this.pattern = pattern; 21 this.ancestor = ancestor; 22 23 if (definition!=null) 24 { 25 for (StackNodeList list = definition; list!=null; list = list.next) 26 if (list.next==null) 27 this.last = list.node.last; 28 } 29 else 30 this.last = ancestor.last; 31 } 32 33 public String getText() 34 { 35 StringBuffer buffer = new StringBuffer (); 36 for (StackNodeList list = definition; list!=null; list = list.next) 37 buffer.append(list.node.getText()); 38 39 return buffer.toString(); 40 } 41 } 42 | Popular Tags |