source: java/FramclipsePlugin/src/main/java/com/framsticks/framclipse/internal/parser/SimpleNode.java @ 193

Last change on this file since 193 was 193, checked in by Maciej Komosinski, 10 years ago

Set svn:eol-style native for all textual files

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/plain
File size: 1.8 KB
Line 
1/* Generated By:JJTree: Do not edit this line. SimpleNode.java */
2
3package com.framsticks.framclipse.internal.parser;
4
5public class SimpleNode implements Node {
6  protected Node parent;
7  protected Node[] children;
8  protected int id;
9  protected FramclipseNonScriptParser parser;
10
11  public SimpleNode(int i) {
12    id = i;
13  }
14
15  public SimpleNode(FramclipseNonScriptParser p, int i) {
16    this(i);
17    parser = p;
18  }
19
20  public void jjtOpen() {
21  }
22
23  public void jjtClose() {
24  }
25 
26  public void jjtSetParent(Node n) { parent = n; }
27  public Node jjtGetParent() { return parent; }
28
29  public void jjtAddChild(Node n, int i) {
30    if (children == null) {
31      children = new Node[i + 1];
32    } else if (i >= children.length) {
33      Node c[] = new Node[i + 1];
34      System.arraycopy(children, 0, c, 0, children.length);
35      children = c;
36    }
37    children[i] = n;
38  }
39
40  public Node jjtGetChild(int i) {
41    return children[i];
42  }
43
44  public int jjtGetNumChildren() {
45    return (children == null) ? 0 : children.length;
46  }
47
48  /* You can override these two methods in subclasses of SimpleNode to
49     customize the way the node appears when the tree is dumped.  If
50     your output uses more than one line you should override
51     toString(String), otherwise overriding toString() is probably all
52     you need to do. */
53
54  public String toString() { return FramclipseNonScriptParserTreeConstants.jjtNodeName[id]; }
55  public String toString(String prefix) { return prefix + toString(); }
56
57  /* Override this method if you want to customize how the node dumps
58     out its children. */
59
60  public void dump(String prefix) {
61    System.out.println(toString(prefix));
62    if (children != null) {
63      for (int i = 0; i < children.length; ++i) {
64        SimpleNode n = (SimpleNode)children[i];
65        if (n != null) {
66          n.dump(prefix + " ");
67        }
68      }
69    }
70  }
71}
72
Note: See TracBrowser for help on using the repository browser.