01 /*
02 * YamNode.java
03 * Copyright (c) 1998-2008, The University of Sheffield.
04 *
05 * This code is from the GATE project (http://gate.ac.uk/) and is free
06 * software licenced under the GNU General Public License version 3. It is
07 * distributed without any warranty. For more details see COPYING.txt in the
08 * top level directory (or at http://gatewiki.sf.net/COPYING.txt).
09 *
10 * Hamish Cunningham, 7th May 2006
11 */
12
13 package gate.yam.parse;
14 import java.util.*;
15 import gate.util.*;
16
17 /**
18 * Parent of {@link gate.yam.parse.SimpleNode} that adds state needed
19 * for YAM translators. This includes storing first/last tokens.
20 * @author Hamish Cunningham
21 */
22 public class YamNode {
23 /** Construction. */
24 public YamNode() { }
25
26 /** Tokens dominated by this node. */
27 Token first, last;
28
29 /** Get the first Token dominated by this node. */
30 public Token getFirstToken() { return first; }
31
32 /** Set the first Token dominated by this node. */
33 public void setFirstToken(Token first) { this.first = first; }
34
35 /** Get the last Token dominated by this node. */
36 public Token getLastToken() { return last; }
37
38 /** Set the last Token dominated by this node. */
39 public void setLastToken(Token last) { this.last = last; }
40
41 /** Start, end, before, after body. */
42 String start = null, end = null, before = null, after = null, body = null;
43
44 /** Get the start output string for this node. */
45 public String getStart() { return start; }
46
47 /** Set the start output string for this node. */
48 public void setStart(String start) { this.start = start; }
49
50 /** Get the end output string for this node. */
51 public String getEnd() { return end; }
52
53 /** Set the end output string for this node. */
54 public void setEnd(String end) { this.end = end; }
55
56 /** Get the before output string for this node. */
57 public String getBefore() { return before; }
58
59 /** Set the before output string for this node. */
60 public void setBefore(String before) { this.before = before; }
61
62 /** Get the after output string for this node. */
63 public String getAfter() { return after; }
64
65 /** Set the after output string for this node. */
66 public void setAfter(String after) { this.after = after; }
67
68 /** Get the body output string for this node. */
69 public String getBody() { return body; }
70
71 /** Set the body output string for this node. */
72 public void setBody(String body) { this.body = body; }
73
74 /** Reset the output strings. */
75 public void reset() { start = end = before = after = body = null; }
76
77 /** Argument list for predicates. */
78 List argsList;
79
80 /** Get the predicate arguments list for this node. */
81 public List getArgsList() { return argsList; }
82
83 /** Set the predicate arguments list for this node. */
84 public void setArgsList(List argsList) { this.argsList = argsList; }
85
86 } // YamNode
|