Logo Search packages:      
Sourcecode: jasmin-sable version File versions  Download package

java_cup::production Class Reference

Inheritance diagram for java_cup::production:

java_cup::action_production

List of all members.


Detailed Description

This class represents a production in the grammar. It contains a LHS non terminal, and an array of RHS symbols. As various transformations are done on the RHS of the production, it may shrink. As a result a separate length is always maintained to indicate how much of the RHS array is still valid.

I addition to construction and manipulation operations, productions provide methods for factoring out actions (see remove_embedded_actions()), for computing the nullability of the production (i.e., can it derive the empty string, see check_nullable()), and operations for computing its first set (i.e., the set of terminals that could appear at the beginning of some string derived from the production, see check_first_set()).

See also:
java_cup.production_part

java_cup.symbol_part

java_cup.action_part

Version:
last updated: 7/3/96
Author:
Frank Flannery

Definition at line 27 of file production.java.


Public Member Functions

action_part action ()
terminal_set check_first_set () throws internal_error
boolean check_nullable () throws internal_error
boolean equals (Object other)
boolean equals (production other)
terminal_set first_set ()
int hashCode ()
int index ()
symbol_part lhs ()
void note_reduction_use ()
boolean nullable ()
boolean nullable_known ()
int num_reductions ()
int precedence_num ()
int precedence_side ()
 production (non_terminal lhs_sym, production_part rhs_parts[], int rhs_l, int prec_num, int prec_side) throws internal_error
 production (non_terminal lhs_sym, production_part rhs_parts[], int rhs_l, String action_str, int prec_num, int prec_side) throws internal_error
 production (non_terminal lhs_sym, production_part rhs_parts[], int rhs_l) throws internal_error
 production (non_terminal lhs_sym, production_part rhs_parts[], int rhs_l, String action_str) throws internal_error
production_part rhs (int indx) throws internal_error
int rhs_length ()
void set_precedence_num (int prec_num)
void set_precedence_side (int prec_side)
String to_simple_string () throws internal_error
String toString ()

Static Public Member Functions

static Enumeration all ()
static production find (int indx)
static int number ()

Protected Member Functions

String declare_labels (production_part rhs[], int rhs_len, String final_action)
String make_declaration (String labelname, String stack_type, int offset)
int merge_adjacent_actions (production_part rhs_parts[], int len)
void remove_embedded_actions () throws internal_error
action_part strip_trailing_action (production_part rhs_parts[], int len)

Static Protected Member Functions

static boolean is_id_char (char c)
static boolean is_id_start (char c)

Protected Attributes

action_part _action
terminal_set _first_set = new terminal_set()
int _index
symbol_part _lhs
boolean _nullable = false
boolean _nullable_known = false
int _num_reductions = 0
production_part _rhs []
int _rhs_assoc = -1
int _rhs_length
int _rhs_prec = -1

Static Protected Attributes

static Hashtable _all = new Hashtable()
static int next_index

Package Functions

boolean set_nullable (boolean v)

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index