Generic Interpreter 0.9
Private API

gi
Class Lexicon.Match

java.lang.Object
  |
  +--gi.Lexicon.Expression
        |
        +--gi.Lexicon.Alphabet
              |
              +--gi.Lexicon.Match
Direct Known Subclasses:
Lexicon.NonMatch
Enclosing class:
Lexicon

protected static class Lexicon.Match
extends Lexicon.Alphabet

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

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

Field Summary
(package private)  char c
          The character whose singleton set is denoted.
(package private)  Lexicon.Set list
          The Alphabet list whose set is denoted.
(package private)  String string
          The string whose set of characters is denoted.
 
Fields inherited from class gi.Lexicon.Expression
accept, initial
 
Constructor Summary
  Lexicon.Match(char c)
          Constructs an Expression denoting the set containing a character.
(package private) Lexicon.Match(Integer from, char c, Integer to)
          Constructs an Expression denoting the set containing a character.
(package private) Lexicon.Match(Lexicon.Set list)
          Constructs an Expression denoting the set of characters in an Alphabet list.
  Lexicon.Match(String string)
          Constructs an Expression denoting the set of characters in a string.
 
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

c

char c

The character whose singleton set is denoted.


list

Lexicon.Set list

The Alphabet list whose set is denoted.


string

String string

The string whose set of characters is denoted.

Constructor Detail

Lexicon.Match

public Lexicon.Match(char c)

Constructs an Expression denoting the set containing a character. An NFA recognizing the language denoted by this Expression is constructed.

Parameters:
c - the character whose singleton set is denoted.

Lexicon.Match

Lexicon.Match(Integer from,
              char c,
              Integer to)

Constructs an Expression denoting the set containing a character. An NFA recognizing the language denoted by this Expression is constructed.

Parameters:
c - the character whose singleton set is denoted.

Lexicon.Match

Lexicon.Match(Lexicon.Set list)

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

Parameters:
list - the Alphabet list whose set is denoted.

Lexicon.Match

public Lexicon.Match(String string)

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

Parameters:
string - the string of characters whose set is denoted.
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 the set denoted by this Expression; 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>