Generic Interpreter 0.9
Private API

gi
Class Lexicon.Repetition

java.lang.Object
  |
  +--gi.Lexicon.Expression
        |
        +--gi.Lexicon.Repetition
Enclosing class:
Lexicon

protected static class Lexicon.Repetition
extends Lexicon.Expression

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

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

Field Summary
private  Lexicon.Expression kernel
          The Expression denoting the language whose repetition is expressed.
private  int max
          The maximum number of times kernel is repeated.
private  int min
          The minimum number of times kernel is repeated.
 
Fields inherited from class gi.Lexicon.Expression
accept, initial
 
Constructor Summary
Lexicon.Repetition(Lexicon.Expression kernel, int min, int max)
          Constructs an Expression denoting the repetition of a regular language.
 
Method Summary
(package private)  Lexicon.Expression copy()
          Creates a copy of this Expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

kernel

private final Lexicon.Expression kernel

The Expression denoting the language whose repetition is expressed.


max

private final int max

The maximum number of times kernel is repeated.


min

private final int min

The minimum number of times kernel is repeated.

Constructor Detail

Lexicon.Repetition

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

Constructs an Expression denoting the repetition of a regular language. An NFA recognizing the language denoted by this Expression is constructed. Large finite values for the minimum or maximum cause the kernel NFA to be cloned many times, resulting in a space-inefficient NFA.

Parameters:
kernel - the Expression denoting the language whose repetition is expressed.
min - the minimum number of times kernel is repeated. If negative, it is assumed to be zero.
max - the maximum number of times kernel is repeated. If negative, it is assumed to be infinity.
Method Detail

copy

Lexicon.Expression copy()

Creates a copy of this Expression. The NFA recognizing the language denoted by this Expression is replicated.

Overrides:
copy in class Lexicon.Expression
Returns:
a copy of this Expression.

 

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