Generic Interpreter 0.9
Private API

gi
Class Grammar.Production

java.lang.Object
  |
  +--gi.Grammar.Production
Enclosing class:
Grammar

static class Grammar.Production
extends Object

This class implements a Production.

Version:
0.9
Author:
© 1999-2000 Craig A. Rich <carich@acm.org>

Field Summary
(package private)  Object nonterminal
          The nonterminal on the left-hand side of this Production.
(package private)  int number
          The number of this Production.
(package private)  Object[] phrase
          The phrase on the right-hand side of this Production.
 
Constructor Summary
(package private) Grammar.Production(Object nonterminal, Object[] phrase)
          Constructs a Production with a nonterminal and phrase.
 
Method Summary
 String toString()
          Returns a string representation of this Production.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

nonterminal

final Object nonterminal

The nonterminal on the left-hand side of this Production.


number

final int number

The number of this Production. It is the priority of this Production when resolving parse conflicts.


phrase

final Object[] phrase

The phrase on the right-hand side of this Production.

Constructor Detail

Grammar.Production

Grammar.Production(Object nonterminal,
                   Object[] phrase)

Constructs a Production with a nonterminal and phrase.

Parameters:
nonterminal - the nonterminal on the left-hand side.
phrase - the phrase on the right-hand side.
Method Detail

toString

public String toString()

Returns a string representation of this Production.

Overrides:
toString in class Object
Returns:
the string representation of this Production.

 

© 1999-2000 Craig A. Rich <carich@acm.org>