RegExpPowerRange (API documentation of hlt.language packages)
Date: 2013-01-30

hlt.language.util

## Class RegExpPowerRange

- java.lang.Object
- - hlt.language.util.RegExp
  - - hlt.language.util.RegExpOne
    - - hlt.language.util.RegExpPowerRange

-     public class RegExpPowerRange
      extends RegExpOne

  This class is a concrete implementation of the abstract class `RegExpOne` to represent a regular expression that is a finite choice of powers ranging from m to n.
  Version:
    Last modified on Tue Jun 19 17:38:09 2012 by hak
  Author:
    Hassan Aït-Kaci
  Copyright:
    © Hassan Aït-Kaci

- - ### Field Summary

    - ### Fields inherited from class hlt.language.util.RegExp

      `BINARY_EXP, CHOICE_EXP, CONCAT_EXP, EMPTY, EMPTY_EXP, OPTION_EXP, PLUS_EXP, POWER_EXP, RANGE_EXP, STAR_EXP, SYMBOL_EXP, UNARY_EXP`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RegExpPowerRange(RegExp arg)` Constructs a `RegExpPowerRange` with the specified `RegExp`, lower bound `0` and upper bound `OMEGA`.
    `RegExpPowerRange(RegExp arg, int lower)` Constructs a `RegExpPowerRange` with the specified `RegExp` and lower bound, and upper bound `OMEGA`.
    `RegExpPowerRange(RegExp arg, int lower, int upper)` Constructs a `RegExpPowerRange` with the specified `RegExp`, and lower and upper bounds.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `RegExp` | `deepCopy()` This returns a deep copy of this `RegExp`.
    `boolean` | `equals(java.lang.Object other)` Returns `true` iff the specified object is a `RegExpPowerRange` that has the same argument, lower, and upper bounds as this one.
    `int` | `getLower()`
    `int` | `getUpper()`
    `RegExp` | `normalize()` This returns this `RegExpPowerRange`'s normal form according to the following rewrite rules: `[PR:E]` `()_m^n` → `()` `[PR:00]` `X_0^0` → `()` `[PR:01]` `X_0^1` → `X?` `[PR:O]` `X_0~` → `X\*` `[PR:1_]` `X_1~` → `X+` `[PR:__]` `X_m^n` → `()` (if `m > n`) `[PR:_0]` `X_m^n` → `X_m~` (if `n < 0`) `[PR:mm]` `X_m^m` → `X` `[PR:O]` `X?_m^n` → `X_0^n` `[PR:P]` `X+_m^n` → `X_m~` `[PR:S]` `X\*_m^n` → `X\*`
    `RegExpPowerRange` | `setLower(int lower)`
    `RegExpPowerRange` | `setRange(int lower, int upper)`
    `RegExpPowerRange` | `setUpper(int upper)`
    `RegExp` | `shallowCopy()` This returns a shallow copy of this `RegExp`.
    `java.lang.String` | `toString()` Returns a printable form for this `RegExpPowerRange`.
    `int` | `type()` This returns the specific type identifying this `RegExp`.

    - ### Methods inherited from class hlt.language.util.RegExpOne

      `getArg, normalArg`

    - ### Methods inherited from class hlt.language.util.RegExp

      `cleanup, isBinary, isChoice, isConcat, isEmpty, isLexLess, isOption, isPlus, isPower, isRange, isStar, isSymbol, isUnary, normEquals, noTrace, tag, toggleTrace, toNormalString, trace, tracing`

    - ### Methods inherited from class java.lang.Object

      `getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### RegExpPowerRange

          public RegExpPowerRange(RegExp arg)

      Constructs a `RegExpPowerRange` with the specified `RegExp`, lower bound `0` and upper bound `OMEGA`.

    - #### RegExpPowerRange

          public RegExpPowerRange(RegExp arg,
                          int lower)

      Constructs a `RegExpPowerRange` with the specified `RegExp` and lower bound, and upper bound `OMEGA`.

    - #### RegExpPowerRange

          public RegExpPowerRange(RegExp arg,
                          int lower,
                          int upper)

      Constructs a `RegExpPowerRange` with the specified `RegExp`, and lower and upper bounds.

  - ### Method Detail

    - #### getLower

          public final int getLower()

    - #### getUpper

          public final int getUpper()

    - #### shallowCopy

          public final RegExp shallowCopy()

      Description copied from class: `RegExp`
      This returns a shallow copy of this `RegExp`.
      Specified by:
        `shallowCopy` in class `RegExp`

    - #### deepCopy

          public final RegExp deepCopy()

      Description copied from class: `RegExp`
      This returns a deep copy of this `RegExp`.
      Specified by:
        `deepCopy` in class `RegExp`

    - #### type

          public final int type()

      Description copied from class: `RegExp`
      This returns the specific type identifying this `RegExp`.
      Specified by:
        `type` in class `RegExp`

    - #### setLower

          public final RegExpPowerRange setLower(int lower)

    - #### setUpper

          public final RegExpPowerRange setUpper(int upper)

    - #### setRange

          public final RegExpPowerRange setRange(int lower,
                                  int upper)

    - #### normalize

          public RegExp normalize()

      This returns this `RegExpPowerRange`'s normal form according to the following rewrite rules:
      1. `[PR:E]` `()_m^n` → `()`
      2. `[PR:00]` `X_0^0` → `()`
      3. `[PR:01]` `X_0^1` → `X?`
      4. `[PR:O]` `X_0~` → `X\*`
      5. `[PR:1_]` `X_1~` → `X+`
      6. `[PR:__]` `X_m^n` → `()` (if `m > n`)
      7. `[PR:_0]` `X_m^n` → `X_m~` (if `n < 0`)
      8. `[PR:mm]` `X_m^m` → `X`
      9. `[PR:O]` `X?_m^n` → `X_0^n`
      10. `[PR:P]` `X+_m^n` → `X_m~`
      11. `[PR:S]` `X\*_m^n` → `X\*`
      Specified by:
        `normalize` in class `RegExp`

    - #### equals

          public final boolean equals(java.lang.Object other)

      Returns `true` iff the specified object is a `RegExpPowerRange` that has the same argument, lower, and upper bounds as this one.
      Overrides:
        `equals` in class `RegExpOne`

    - #### toString

          public final java.lang.String toString()

      Returns a printable form for this `RegExpPowerRange`.
      Overrides:
        `toString` in class `java.lang.Object`