MatchingAutomatonNode¶
fauto.spad line 1 [edit on github]
This domains provides node of nondetermistic finite automaton.
- accepting?: % -> Boolean
accepting?(n)returnstrueif and only ifnis an accepting node.
- alt: % -> Union(%, none)
alt(n)returns alternative node ton.
- char: % -> Character
char(n)returns charactercsuch thatnmatchesc.
- gen: % -> Integer
gen(n)retrurns generation number ofn.
- new: (Boolean, Character, Boolean) -> %
new(wild?, char, accepting)creates new noden. Ifwild?istruethenis a wildcared node, that is matches any character, otherewisenmaches onlychar.nis accepting node if and only accepting istrue. Next and alt fields ofnare “none”.
- next: % -> Union(%, none)
next(n)returns the next node ofn.
- next: (%, Character) -> Union(%, none)
next(n, c)returns next node ofnifnmatchesc, otherwise returns “none”.
- set_alt!: (%, %) -> Void
set_alt(
n,n1) sets alt field ofnton1.
- set_gen!: (%, Integer) -> Integer
set_gen!(n, k)sets generation number ofntokand returns previous generation ofn. Generation number is needed by the matching algorithm.
- set_next!: (%, %) -> Void
set_next!(n, n1)sets next field ofnton1.
- wild?: % -> Boolean
wild?(n)istrueif and olny ifnis a wildcard node, that is matches all characters.