~ubuntu-branches/ubuntu/jaunty/weka/jaunty

« back to all changes in this revision

Viewing changes to weka/core/parser/java_cup/parse_action.java

  • Committer: Bazaar Package Importer
  • Author(s): Soeren Sonnenburg, Torsten Werner, Soeren Sonnenburg
  • Date: 2008-10-30 06:42:46 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20081030064246-648zj038l155host
Tags: 3.5.8+cup1-1
[ Torsten Werner ]
* Update Section field in doc-base file.
* Add Class-Path attribute to jar file.

[ Soeren Sonnenburg ]
* Update my email address to sonne@debian.org.
* Update copyright.
* Remove build, java cup and jflex from orig.tar.gz.
* Add cup and jflex as build dependency.
* Patch weka source to use cup from debian.
* Patch weka shell wrapper to use java-6-sun or openjdk.
* Obtain documentation from svn.
* Build depend on texlive-latex-extra (required to generate documentation).
* Add javadoc as build target.
* Use java-wrappers to start weka.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * STANDARD ML OF NEW JERSEY COPYRIGHT NOTICE, LICENSE AND DISCLAIMER.
3
 
 * 
4
 
 * Copyright (c) 1989-1998 by Lucent Technologies
5
 
 * 
6
 
 * Permission to use, copy, modify, and distribute this software and its
7
 
 * documentation for any purpose and without fee is hereby granted, provided
8
 
 * that the above copyright notice appear in all copies and that both the
9
 
 * copyright notice and this permission notice and warranty disclaimer appear
10
 
 * in supporting documentation, and that the name of Lucent Technologies, Bell
11
 
 * Labs or any Lucent entity not be used in advertising or publicity pertaining
12
 
 * to distribution of the software without specific, written prior permission.
13
 
 *
14
 
 * Lucent disclaims all warranties with regard to this software, including all
15
 
 * implied warranties of merchantability and fitness. In no event shall Lucent
16
 
 * be liable for any special, indirect or consequential damages or any damages
17
 
 * whatsoever resulting from loss of use, data or profits, whether in an action
18
 
 * of contract, negligence or other tortious action, arising out of or in
19
 
 * connection with the use or performance of this software. 
20
 
 *
21
 
 * Taken from this URL:
22
 
 * http://www.smlnj.org/license.html
23
 
 * 
24
 
 * This license is compatible with the GNU GPL (see section "Standard ML of New
25
 
 * Jersey Copyright License"):
26
 
 * http://www.gnu.org/licenses/license-list.html#StandardMLofNJ
27
 
 */
28
 
 
29
 
/*
30
 
 * Copyright 1996-1999 by Scott Hudson, Frank Flannery, C. Scott Ananian
31
 
 */
32
 
 
33
 
package weka.core.parser.java_cup;
34
 
 
35
 
/** This class serves as the base class for entries in a parse action table.  
36
 
 *  Full entries will either be SHIFT(state_num), REDUCE(production), NONASSOC,
37
 
 *  or ERROR. Objects of this base class will default to ERROR, while
38
 
 *  the other three types will be represented by subclasses. 
39
 
 * 
40
 
 * @see     weka.core.parser.java_cup.reduce_action
41
 
 * @see     weka.core.parser.java_cup.shift_action
42
 
 * @version last updated: 7/2/96
43
 
 * @author  Frank Flannery
44
 
 */
45
 
 
46
 
public class parse_action {
47
 
 
48
 
  /*-----------------------------------------------------------*/
49
 
  /*--- Constructor(s) ----------------------------------------*/
50
 
  /*-----------------------------------------------------------*/
51
 
 
52
 
  /** Simple constructor. */
53
 
  public parse_action()
54
 
    {
55
 
      /* nothing to do in the base class */
56
 
    }
57
 
 
58
 
 
59
 
  /*-----------------------------------------------------------*/
60
 
  /*--- (Access to) Static (Class) Variables ------------------*/
61
 
  /*-----------------------------------------------------------*/
62
 
 
63
 
  /** Constant for action type -- error action. */
64
 
  public static final int ERROR = 0;
65
 
 
66
 
  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
67
 
 
68
 
  /** Constant for action type -- shift action. */
69
 
  public static final int SHIFT = 1;
70
 
 
71
 
  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
72
 
 
73
 
  /** Constants for action type -- reduce action. */
74
 
  public static final int REDUCE = 2;
75
 
 
76
 
  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
77
 
 
78
 
  /** Constants for action type -- reduce action. */
79
 
  public static final int NONASSOC = 3;
80
 
 
81
 
  /*-----------------------------------------------------------*/
82
 
  /*--- General Methods ---------------------------------------*/
83
 
  /*-----------------------------------------------------------*/
84
 
         
85
 
  /** Quick access to the type -- base class defaults to error. */
86
 
  public int kind() {return ERROR;}
87
 
 
88
 
  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
89
 
 
90
 
  /** Equality test. */
91
 
  public boolean equals(parse_action other)
92
 
    {
93
 
      /* we match all error actions */
94
 
      return other != null && other.kind() == ERROR;
95
 
    }
96
 
 
97
 
  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
98
 
 
99
 
  /** Generic equality test. */
100
 
  public boolean equals(Object other)
101
 
    {
102
 
      if (other instanceof parse_action)
103
 
        return equals((parse_action)other);
104
 
      else
105
 
        return false;
106
 
    }
107
 
  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
108
 
 
109
 
  /** Compute a hash code. */
110
 
  public int hashCode()
111
 
    {
112
 
      /* all objects of this class hash together */
113
 
      return 0xCafe123;
114
 
    }
115
 
 
116
 
  /*. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*/
117
 
 
118
 
  /** Convert to string. */
119
 
  public String toString() {return "ERROR";}
120
 
 
121
 
  /*-----------------------------------------------------------*/
122
 
}
123