Generic Interpreter 0.9
Private API

gi
Class Lexicon.Range

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

protected static class Lexicon.Range
extends Lexicon.Alphabet

This class implements an Expression denoting the set of characters in a range.

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

Field Summary
private  char first
          The first character in the range.
private  char last
          The last character in the range.
 
Fields inherited from class gi.Lexicon.Expression
accept, initial
 
Constructor Summary
Lexicon.Range(char first, char last)
          Constructs an Expression denoting the set of characters in a range.
 
Method Summary
(package private)  boolean contains(char c)
          Indicates whether a character is in the set denoted by this Expression.
(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

first

private final char first

The first character in the range.


last

private final char last

The last character in the range.

Constructor Detail

Lexicon.Range

public Lexicon.Range(char first,
                     char last)

Constructs an Expression denoting the set of characters in a range. An NFA recognizing the language denoted by this Expression is constructed.

Parameters:
first - the first character in the range.
last - the last character in the range.
Method Detail

contains

boolean contains(char c)

Indicates whether a character is in the set denoted by this Expression.

Overrides:
contains in class Lexicon.Alphabet
Parameters:
c - the character whose status is requested.
Returns:
true if c is in this Range; false otherwise.

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>