From 527518d6d425bdc6c2d30e65a7bc9ac99272e517 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 12 Oct 2016 06:16:45 -0700 Subject: New function regex-from-trie. * filter.c (regex_from_trie): New static function. (filter_init): Register regex-from-trie intrinsic. * txr.1: Documented regex-from-trie. --- txr.1 | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index 74c832c3..f41c867d 100644 --- a/txr.1 +++ b/txr.1 @@ -44849,6 +44849,34 @@ using .codn equal , and the result of that is returned. +.coNP Function @ regex-from-trie +.synb +.mets (regex-from-trie << trie ) +.syne +.desc +The +.code regex-from-trie +function returns a representation of +.meta trie +as regular expression abstract syntax, suitable for +processing by the +.code regex-compile +function. + +The values stored in the trie nodes are not represented in +the regular expression. + +The +.meta trie +may be one that has been compressed via +.codn trie-compress ; +in fact, a compressed +.meta trie +results in more compact syntax. + +Note: this function is useful for creating a compact, prefix-compressed +regular expression which matches a list of strings. + .SS* Access To TXR Pattern Language From Lisp It is useful to be able to invoke the abilities of the \*(TX pattern Language -- cgit v1.2.3