Generic Interpreter 1.2
Private API

gi
Class Lexicon.Repetition

java.lang.Object
  extended bygi.Lexicon.Expression
      extended bygi.Lexicon.Repetition
Enclosing class:
Lexicon

protected static class Lexicon.Repetition
extends Lexicon.Expression

This class implements an Expression expressing the repetition of a regular language.

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

Field Summary
private  Lexicon.Expression e1
          The operand Expression.
private  int max
          The maximum number of times e1 is repeated.
private  int min
          The minimum number of times e1 is repeated.
 
Fields inherited from class gi.Lexicon.Expression
f, i
 
Constructor Summary
Lexicon.Repetition(Lexicon.Expression e1, int min, int max)
          Constructs an Expression expressing the repetition of a regular language, and builds the NFA constructed from this Expression.
 
Method Summary
(package private)  Lexicon.Expression copy()
          Creates a copy of this Expression, and replicates the NFA constructed from this Expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

e1

private final Lexicon.Expression e1

The operand Expression.


max

private final int max

The maximum number of times e1 is repeated.


min

private final int min

The minimum number of times e1 is repeated.

Constructor Detail

Lexicon.Repetition

public Lexicon.Repetition(Lexicon.Expression e1,
                          int min,
                          int max)

Constructs an Expression expressing the repetition of a regular language, and builds the NFA constructed from this Expression. Large finite values for the minimum or maximum cause the NFA constructed from the operand Expression to be copied many times, resulting in a space-inefficient NFA.

Parameters:
e1 - the operand Expression.
min - the minimum number of times e1 is repeated. If negative, it is assumed to be zero.
max - the maximum number of times e1 is repeated. If negative, it is assumed to be infinity.
Method Detail

copy

Lexicon.Expression copy()

Creates a copy of this Expression, and replicates the NFA constructed from this Expression.

Specified by:
copy in class Lexicon.Expression
Returns:
a copy of this Expression.

 

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