package orsetto
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=bb2af4d8b376b2d60fa996bd4d3b90d9f3559455672540f6d7c3598af81d483b
md5=f7bfa83013801b42fcdba607af2f012b
doc/orsetto.cf/Cf_regx/DFA/index.html
Module Cf_regx.DFA
The deterministic finite automata on octet character symbols.
include Cf_dfa.Regular with type event := char
val nil : termThe empty term, representing no events.
val one : char -> termUse one v to make a term representing the single occurrence of v.
val sat : (char -> bool) -> termUse sat f to make a term representing any event that satisfies the predicate f.
Use cats s to make a term representing the concatenation of all the terms of s in sequential order.
Use alt2 a b to make a term representing the occurrence of either a or b.
Use alts s to make a term representing the occurrence of any of the alternatives in s.
Use star t to make a term representing the Kleene star of t, i.e. zero, one or more occurrences of t.
Use seq t to make a term representing a sequence of occurrences of t.
If ~a is used, then it specifies the minimum number of occurrences in the recognized sequence. If ~b is used then it specifies the maximum number of occurrences in the recognized sequence. Composition raises Invalid_argument if a < 0 or b < a.
include Cf_dfa.Machine with type event := char and type 'r fin := 'r fin
The type of automatons parameterized by final identifier type. An imperative programming interface is provided below for elaboration.
Use copy dfa to copy the internal state of dfa into a new machine, ready to advance from the same point.
val reset : 'r t -> unitUse reset dfa to reset the internal state of dfa to its initial state, ready to advance on new events.
val advance : 'r t -> char -> unitUse advance dfa event to advance dfa with event. Raises Failure if dfa has rejected an event previously.
val rejected : 'r t -> boolUse finished dfa to check whether dfa has rejected an event and and may not be advanced any further.
val accepted : 'r t -> boolUse accepted dfa to check whether dfa has reached a final state. A DFA may still be further advanced after reaching one of its final states the first time.
val finish : 'r t -> 'rUse finish dfa to get the final value dfa. Raise Not_found if no final value is available, i.e. either because it has rejected an event or it has not yet reached an accepting state.
val string_to_term : string -> termUse string_to_term s to make a term representing the regular expression in s. Raises Invalid_argument if s is not a valid regular expression.
Use chars_to_term s to make a term representing the regular expression parsed from the characters in s. Raises Invalid_argument if s does not comprise a valid regular expression.
module Affix : sig ... endThis module extends the usual set of affix operators.