summaryrefslogtreecommitdiff
path: root/java/src/ParseNode.java
blob: 6a4db7542276bcf37c5d22c746a50affb4a459ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*************************************************
 *
 * = PACKAGE
 *    JACE.ServiceConfigurator
 *
 * = FILENAME
 *    ParseNode.java
 *
 * Base class for the data types used in the parse tree for adjusting 
 * services.  Things like SuspendNode extend this.  They help connect
 * CUP/JLex with the service configurator system.
 *
 *@author Everett Anderson
 *
 *************************************************/
package JACE.ServiceConfigurator;

import java.io.*;
import JACE.OS.*;
import java_cup.runtime.*;

public class ParseNode extends java_cup.runtime.symbol 
{
  /** 
   * Constructor
   *
   */
  public ParseNode (int number)
  {
    super(number);

    this.name_ = new String("Uninitialized");
  }

  /**
   * Initialize the service (subclasses
   * may do more than set the name)
   */
  public void init (String name)
  {
    this.name_ = name;
  }

  /**
   * Subclasses override to do real work, usually
   * initiating a service or modifying one
   */
  public void apply () 
  {
    // Empty
  }

  /**
    * Retrive the service name
    */
  public String name() 
  {
    return this.name_;
  }

  /**
   * Set the name of the service
   */
  public void name(String newName)
  {
    this.name_ = newName;
  }
  
  String name_;
};