TokenMatcher

halotukozak.regex.TokenMatcher
See theTokenMatcher companion class
object TokenMatcher

Attributes

Companion
class
Source
TokenMatcher.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

object given_ToExpr_TokenMatcher extends ToExpr[TokenMatcher]

Embeds the already-built DFA table as Array[Int] literals - no Regex/Subset involved.

Embeds the already-built DFA table as Array[Int] literals - no Regex/Subset involved.

Attributes

Source
TokenMatcher.scala
Supertypes
trait ToExpr[TokenMatcher]
class Object
trait Matchable
class Any
Self type

Value members

Concrete methods

def fromRegexes(initial: Regex*): TokenMatcher

Build a matcher from pre-parsed regexes (use this from macros after compile-time parsing).

Build a matcher from pre-parsed regexes (use this from macros after compile-time parsing).

Attributes

Throws
IllegalArgumentException

if a pattern uses a construct fromRegexesChecked rejects

Source
TokenMatcher.scala
def fromRegexesBounded(maxStates: Int)(initial: Regex*): Either[StateSpaceLimitExceeded, TokenMatcher]

Like fromRegexes, but fails fast with Left(StateSpaceLimitExceeded(maxStates)) instead of exploring more than maxStates distinct derivative states while building the DFA - see StateSpaceLimitExceeded. Opt-in: fromRegexes itself stays uncapped for existing callers.

Like fromRegexes, but fails fast with Left(StateSpaceLimitExceeded(maxStates)) instead of exploring more than maxStates distinct derivative states while building the DFA - see StateSpaceLimitExceeded. Opt-in: fromRegexes itself stays uncapped for existing callers.

Attributes

Throws
IllegalArgumentException

if a pattern uses a construct fromRegexesChecked rejects

Source
TokenMatcher.scala

Like fromRegexes, but returns the first UnsupportedTokenConstruct as a Left instead of throwing it.

Like fromRegexes, but returns the first UnsupportedTokenConstruct as a Left instead of throwing it.

Attributes

Source
TokenMatcher.scala
def fromSubsets(initial: Subset*): TokenMatcher

Build a matcher from pre-parsed subsets (use this from macros after compile-time parsing).

Build a matcher from pre-parsed subsets (use this from macros after compile-time parsing).

Attributes

Throws
IllegalArgumentException

if a pattern uses a construct fromRegexesChecked rejects

Source
TokenMatcher.scala
def fromSubsetsBounded(maxStates: Int)(initial: Subset*): Either[StateSpaceLimitExceeded, TokenMatcher]

Like fromSubsets, but capped the way fromRegexesBounded caps fromRegexes.

Like fromSubsets, but capped the way fromRegexesBounded caps fromRegexes.

Attributes

Source
TokenMatcher.scala

Every pattern that uses a construct fromRegexesChecked rejects, with the first such construct in it, in pattern order - the check those builders make, without building the matcher. Empty when every pattern is supported. E.g. for a macro that reports each unsupported pattern at compile time and builds the matcher at runtime.

Every pattern that uses a construct fromRegexesChecked rejects, with the first such construct in it, in pattern order - the check those builders make, without building the matcher. Empty when every pattern is supported. E.g. for a macro that reports each unsupported pattern at compile time and builds the matcher at runtime.

Attributes

Source
TokenMatcher.scala

Givens

Givens

Embeds the already-built DFA table as Array[Int] literals - no Regex/Subset involved.

Embeds the already-built DFA table as Array[Int] literals - no Regex/Subset involved.

Attributes

Source
TokenMatcher.scala