Generic Interpreter 1.2
Private API

gi
Class LR1_Grammar.Context

java.lang.Object
  extended bygi.Grammar.Production
      extended bygi.LR0_Grammar.Context
          extended bygi.LR1_Grammar.Context
Enclosing class:
LR1_Grammar

static class LR1_Grammar.Context
extends LR0_Grammar.Context

This class implements an LR(1) Context.

Version:
1.2
Author:
© 1999-2004 Craig A. Rich <carich@csupomona.edu>

Field Summary
(package private)  Object A
          The nonterminal on the left side of this Production.
(package private)  Object[] beta
          The phrase on the right side of this Production.
(package private)  Lexicon.Set follow
          The follow Set in this LR(1) Context.
private  int frontier
          The frontier beyond which reflexive transitive closure has not been pursued.
(package private)  int lookahead
          The lookahead position in this LR(0) Context.
(package private)  int serial
          The serial number of this Production.
 
Constructor Summary
(package private) LR1_Grammar.Context(Grammar.Production p, int lookahead)
          Constructs an LR(1) Context.
 
Method Summary
 String toString()
          Returns the string representation of this LR(1) Context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

follow

final Lexicon.Set follow

The follow Set in this LR(1) Context.


frontier

private int frontier

The frontier beyond which reflexive transitive closure has not been pursued.


lookahead

int lookahead

The lookahead position in this LR(0) Context.


A

Object A

The nonterminal on the left side of this Production.


beta

Object[] beta

The phrase on the right side of this Production.


serial

int serial

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

Constructor Detail

LR1_Grammar.Context

LR1_Grammar.Context(Grammar.Production p,
                    int lookahead)

Constructs an LR(1) Context.

Parameters:
p - the Production in this Context.
lookahead - the lookahead position in this Context.
Method Detail

toString

public String toString()

Returns the string representation of this LR(1) Context.

Overrides:
toString in class LR0_Grammar.Context
Returns:
the string representation of this Context.

 

© 1999-2004 Craig A. Rich <carich@csupomona.edu>