01: /*
02: * Copyright (C) Chaperon. All rights reserved.
03: * -------------------------------------------------------------------------
04: * This software is published under the terms of the Apache Software License
05: * version 1.1, a copy of which has been included with this distribution in
06: * the LICENSE file.
07: */
08:
09: package net.sourceforge.chaperon.process.extended;
10:
11: import net.sourceforge.chaperon.model.extended.Pattern;
12:
13: public class NonterminalStackNode extends StackNode {
14: public StackNodeList definition = null;
15:
16: public NonterminalStackNode(StackNodeList definition,
17: Pattern pattern, StackNode ancestor) {
18: this .definition = definition;
19: this .pattern = pattern;
20: this .ancestor = ancestor;
21:
22: if (definition != null) {
23: for (StackNodeList list = definition; list != null; list = list.next)
24: if (list.next == null)
25: this .last = list.node.last;
26: } else
27: this .last = ancestor.last;
28: }
29:
30: public String getText() {
31: StringBuffer buffer = new StringBuffer();
32: for (StackNodeList list = definition; list != null; list = list.next)
33: buffer.append(list.node.getText());
34:
35: return buffer.toString();
36: }
37: }
|