All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dregex.CompiledRegex.scala Maven / Gradle / Ivy

There is a newer version: 0.7.0
Show newest version
package dregex

import com.typesafe.scalalogging.slf4j.StrictLogging
import dregex.impl.RegexTree
import dregex.impl.Operations
import dregex.impl.Util
import dregex.impl.Dfa

/**
 * A fully-compiled regular expression that was generated from a string literal.
 */
class CompiledRegex private[dregex] (originalString: String, val parsedRegex: ParsedRegex, val universe: Universe)
  extends Regex with StrictLogging {

  val dfa: Dfa = Operations.resolve(parsedRegex.metaTree, universe)

  override def toString = s"[$originalString] (DFA states: ${dfa.stateCount})"

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy