MatchingAutomatonNode

fauto.spad line 1 [edit on github]

This domains provides node of nondetermistic finite automaton.

accepting?: % -> Boolean

accepting?(n) returns true if and only if n is an accepting node.

alt: % -> Union(%, none)

alt(n) returns alternative node to n.

char: % -> Character

char(n) returns character c such that n matches c.

gen: % -> Integer

gen(n) retrurns generation number of n.

new: (Boolean, Character, Boolean) -> %

new(wild?, char, accepting) creates new node n. If wild? is true the n is a wildcared node, that is matches any character, otherewise n maches only char. n is accepting node if and only accepting is true. Next and alt fields of n are “none”.

next: % -> Union(%, none)

next(n) returns the next node of n.

next: (%, Character) -> Union(%, none)

next(n, c) returns next node of n if n matches c, otherwise returns “none”.

set_alt!: (%, %) -> Void

set_alt(n, n1) sets alt field of n to n1.

set_gen!: (%, Integer) -> Integer

set_gen!(n, k) sets generation number of n to k and returns previous generation of n. Generation number is needed by the matching algorithm.

set_next!: (%, %) -> Void

set_next!(n, n1) sets next field of n to n1.

wild?: % -> Boolean

wild?(n) is true if and olny if n is a wildcard node, that is matches all characters.