Packages

sealed abstract class Rx extends AnyRef

Rx is a regular expression.

Self Type
Rx
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Rx
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def &(rhs: Rx): Rx

    Intersection operator.

  4. def *(rhs: Rx): Rx

    Concatenation operator.

    Concatenation operator.

    The expression x * y means that x and then y will be used in a given production in that order. In regular expression syntax this is written as 'xy'.

    The operator is called * because it corresponds to multiplication in the Kleene algebra of regular expressions.

  5. def +(rhs: Rx): Rx

    Choice operator.

    Choice operator.

    The expression x + y (also written as x | y), means that either x or y (but not both) will be used in a given production. In regular expression syntax this is written as 'x|y'. This is also sometimes known as alternation.

    The operator is called + because it corresponds to addition in the Kleene algebra of regular expressions.

  6. def -(rhs: Rx): Rx

    Difference operator.

  7. def <(rhs: Rx): Boolean

    Is lhs' accepted set a proper subset of rhs' accepted set?

  8. def <=(rhs: Rx): Boolean

    Is lhs' accepted set a subset of rhs' accepted set?

  9. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. def ===(rhs: Rx): Boolean

    Do lhs and rhs accept the same set of strings?

  11. def >(rhs: Rx): Boolean

    Is lhs' accepted set a proper superset of rhs' accepted set?

  12. def >=(rhs: Rx): Boolean

    Is lhs' accepted set a superset of rhs' accepted set?

  13. def ^(rhs: Rx): Rx

    Exclusive-or (XOR) operator.

  14. def accepts(s: String): Boolean

    Decide whether the regex accepts the string s.

  15. lazy val acceptsEmpty: Boolean

    Does this regular expression accept the empty string ("")?

  16. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  17. def canonical: Rx

    Attempt to put a regular expression in a canonical form.

    Attempt to put a regular expression in a canonical form.

    This is not guaranteed to be a "minimal" form (in fact it will often expand the size of the regex). However, two regular exprssions that are equal should have equivalent representations after canonicalization is performed.

  18. def cardRepr: String

    Represent the cardinality of this expression as a string.

    Represent the cardinality of this expression as a string.

    For finite cardinalities, just return that number.

    For infinite star depths, we show ∞ and then display the first cardinalities where we limit star expansions.

  19. def cardinality: Size

    Compute the size of the set of strings matched by this regular expression.

    Compute the size of the set of strings matched by this regular expression.

    In expressions using the Kleene star operator the cardinality will often be unbounded, since the set is infinite (at least in theory). To get a sense of the relative complexity of an expression using Kleene stars, consider exploring how the values of limitStars(i).cardinality increase as i does.

    This method traverses the expression to avoid double-counting the same string which can be produced by two different paths

  20. def choices: Set[Rx]

    Return a list of nodes to be chosen between.

    Return a list of nodes to be chosen between.

    If this node is a Choice node, the list will have two or more elements. Otherwise it will have exactly one element.

  21. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  22. def concats: List[Rx]

    Return a list of nodes to be concatenated.

    Return a list of nodes to be concatenated.

    If this node is a Concat node, the list will have two or more elements. Otherwise it will have exactly one element.

  23. def deriv(c: Char): Rx

    Compute the derivative with respect to c.

    Compute the derivative with respect to c.

    The derivative of a regular expressions with respect to c is a new regular expression that accepts a string s if and only if the original expression accepts c + s.

    For example, the derivative of '(abc)*' with respect to 'a' is '(bc)(abc)*'

  24. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  25. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  26. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  27. lazy val firstSet: List[LetterSet]

    Set of "first characters" which this regex can accept.

    Set of "first characters" which this regex can accept.

    If a character is not in the firstSet, this regex cannot match strings starting with that character.

    Each LetterSet represents one or more contiguous character ranges. We represent the first set as a list of LetterSets to ensure that each letter set is either completely valid, or completely invalid, for every internal Rx value. For this regex, we can treat each element of the list as a congruence class of characters (which are all treated the same by this regex and all its children). This is very important for efficiency.

    For example, the first set for the expression ([a-c]|[b-d])e* would be List([a], [b-c], [d]). This is because [a] is only matched by [a-c], [d] is only matched by [b-d], and [b-c] is matched by both. If we instead returned something like List([a-c], [d]), then [b-d] would partially (but not completely) match [a-c].

  28. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  29. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  30. def isEmpty: Boolean

    Is this regular expression equivalent to ε (empty)?

  31. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  32. def isPhi: Boolean

    Is this regular expressions equivalent to ϕ (phi)?

  33. def limitStars(count: Int): Rx

    Limit applications of the Kleene star operator.

    Limit applications of the Kleene star operator.

    Replaces Star(r) nodes with Repeat(r, 0, count) nodes. This has the effect of limiting any Kleene star in the expression to being expanded at most count times.

  34. lazy val matchSizes: Option[(Size, Size)]

    Return the range of string lenghts (if any) matched by this regular expression.

    Return the range of string lenghts (if any) matched by this regular expression.

    ϕ (or regular expressions equivalent to ϕ) will return None. All other expressions will return Some((x, y)), where 0 <= x <= y < ∞.

  35. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  36. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  37. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  38. def optional: Rx

    Optionality operator.

    Optionality operator.

    The expression x.optional means that x will be applied zero-or-one times. In regular expression syntax this would be written as 'x?'.

  39. def partialCompare(rhs: Rx): Double

    Partial comparison using a subset relation between regular expressions.

    Partial comparison using a subset relation between regular expressions.

    The return value represents the relationship:

    <0 means (lhs < rhs) means lhs is a subset of rhs 0 means (lhs = rhs) means lhs is equivalent to rhs >0 means (lhs > rhs) means lhs is a supserset of rhs NaN means none of the above

  40. def partialDeriv(x: Char): Set[Rx]

    Compute the partial derivatives with respect to x.

    Compute the partial derivatives with respect to x.

    A partial derivative of a regular expression with respect to x is a new regular expression that only accepts a string s if the original expression accepts x + s.

    Unlike a derivative, if a partial derivative does not match s that does not mean that the original regular expression would not match x + s -- there may be some other partial derivative that does match s.

    If you calculate all the partial derivatives and union them together, you get a regular expression that is equivalent to the derivative. (In fact, this is how Antimirov implements the derivative operation.)

    We use a Set here to avoid duplicate partial derivatives.

  41. def plus: Rx

    Kleene plus operator.

    Kleene plus operator.

    The expression x.plus means that x will be applied one-or-more times. In regular expression syntax this would be written as 'x+'.

    Kleene plus is implemented in terms of Kleene star:

    x.plus = x * x.star

    Kleene plus also satisfies the self-referential relation:

    x.plus = x * (Empty + x.plus)

  42. def pow(k: Int): Rx

    Exponentiation operator.

    Exponentiation operator.

    x.pow(k) is equivalent to x * x *... * x k times. This can be written in regular expression syntax as x{k}.

    x.pow(k) is equivalent to x.repeat(k, k) in the same way that 'x{k}' is equivalent to 'x{k,k}' in regular expression syntax.

  43. def properSubsetOf(rhs: Rx): Boolean

    Is lhs a proper subset of rhs?

  44. def properSupersetOf(rhs: Rx): Boolean

    Is lhs a proper superset of rhs?

  45. def reRepr: String

    Represent this value using traditional "regex" syntax.

    Represent this value using traditional "regex" syntax.

    The output of this method should be readable by Rx.parse.

  46. def rejects(s: String): Boolean

    Decide whether the regex rejects the string s.

  47. def rejectsEmpty: Boolean

    Does this regular expression reject the empty string ("")?

  48. def repeat(m: Int, n: Int): Rx

    Repetition operator.

    Repetition operator.

    This repeats the given regex for at least m times and no more than n times (so 0 <= m <= n). If n=0 this is equivalent to the empty string.

    This method is equivalent to m concatenations followed by (n - m) choice operations and concatenations, e.g.

    x{3,5} = xxx(|x(|x))

  49. def reverse: Rx

    Reverse the regular expression.

    Reverse the regular expression.

    For every string matched by the original expression, the reversed expression matches the reversed string. There are no other differences, and .reverse.reverse is a no-op.

  50. def scalaRepr: String

    Represent this value using Scala syntax.

    Represent this value using Scala syntax.

    The output of this method should be usable in the REPL.

  51. def star: Rx

    Kleene star operator.

    Kleene star operator.

    The expression x.star means that x will be applied zero-or-more times. In regular expression syntax this would be written as 'x*'.

    Kleene star satisfies the self-referential relation:

    x.star = Empty + (x * x.star)

  52. def starDepth: Int

    The deepest number of nested Kleene star operators in this expression.

    The deepest number of nested Kleene star operators in this expression.

    This can be used as a complexity measure.

  53. def subsetOf(rhs: Rx): Boolean

    Is lhs a subset of rhs?

  54. def supersetOf(rhs: Rx): Boolean

    Is lhs a superset of rhs?

  55. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  56. def toDfa: Dfa

  57. def toJava: Pattern

    Compile this regular expression to a java.util.regex.Pattern.

  58. def toNfa: Nfa

  59. def toScala: Regex

    Compile this regular expression to a scala.util.matching.Regex.

  60. def toString(): String

    String representation of Rx.

    String representation of Rx.

    Definition Classes
    Rx → AnyRef → Any
  61. def unary_~: Rx

    Complement (negation) operator.

  62. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  63. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  64. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  65. def |(rhs: Rx): Rx

    Alias for the choice operator.

Inherited from AnyRef

Inherited from Any

Ungrouped