|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.core.parser.java_cup.symbol
weka.core.parser.java_cup.non_terminal
public class non_terminal
This class represents a non-terminal symbol in the grammar. Each non terminal has a textual name, an index, and a string which indicates the type of object it will be implemented with at runtime (i.e. the class of object that will be pushed on the parse stack to represent it).
| Field Summary | |
|---|---|
boolean |
is_embedded_action
flag non-terminals created to embed action productions |
static non_terminal |
START_nt
special non-terminal for start symbol |
| Constructor Summary | |
|---|---|
non_terminal(java.lang.String nm)
Constructor with default type. |
|
non_terminal(java.lang.String nm,
java.lang.String tp)
Full constructor. |
|
| Method Summary | |
|---|---|
void |
add_production(production prod)
Add a production to our set of productions. |
static java.util.Enumeration |
all()
Access to all non-terminals. |
static void |
clear()
|
static void |
compute_first_sets()
Compute first sets for all non-terminals. |
static void |
compute_nullability()
Compute nullability of all non-terminals. |
static non_terminal |
find(int indx)
Lookup a non terminal by index. |
static non_terminal |
find(java.lang.String with_name)
lookup a non terminal by name string |
terminal_set |
first_set()
First set for this non-terminal. |
boolean |
is_non_term()
Indicate that this symbol is a non-terminal. |
boolean |
nullable()
Nullability of this non terminal. |
int |
num_productions()
Total number of productions with this non terminal on the LHS. |
static int |
number()
Total number of non-terminals. |
java.util.Enumeration |
productions()
Access to productions with this non terminal on the LHS. |
java.lang.String |
toString()
convert to string |
| Methods inherited from class weka.core.parser.java_cup.symbol |
|---|
index, name, note_use, stack_type, use_count |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final non_terminal START_nt
public boolean is_embedded_action
| Constructor Detail |
|---|
public non_terminal(java.lang.String nm,
java.lang.String tp)
nm - the name of the non terminal.tp - the type string for the non terminal.public non_terminal(java.lang.String nm)
nm - the name of the non terminal.| Method Detail |
|---|
public static void clear()
public static java.util.Enumeration all()
public static non_terminal find(java.lang.String with_name)
public static non_terminal find(int indx)
public static int number()
public static void compute_nullability()
throws internal_error
internal_error
public static void compute_first_sets()
throws internal_error
internal_errorpublic java.util.Enumeration productions()
public int num_productions()
public void add_production(production prod)
throws internal_error
internal_errorpublic boolean nullable()
public terminal_set first_set()
public boolean is_non_term()
is_non_term in class symbolpublic java.lang.String toString()
toString in class symbol
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||