convert

Function summary
add-range-to-set set from to
convert parse-tree
convert-aux parse-tree
convert-char-class-to-charset list
maybe-accumulate str
maybe-split-repetition regex greedyp minimum maximum min-len length reg-seen
set-flag token
Macro summary
case-insensitive-mode-p flags
multi-line-mode-p flags
single-line-mode-p flags
set-flag   token  [Function]

Reads a flag token and sets or unsets the corresponding entry in the special FLAGS list.

add-range-to-set   set from to  [Function]

Adds all characters from character FROM to character TO (inclusive) to the charset SET. Does the right thing with respect to case-(in)sensitivity as specified by the special variable FLAGS.

convert-char-class-to-charset   list  [Function]

Combines all items in LIST into one charset and returns it. Items can be single characters, character ranges like (:RANGE #\A #\E), or special character classes like :DIGIT-CLASS. Does the right thing with respect to case-(in)sensitivity as specified by the special variable FLAGS.

maybe-split-repetition   regex greedyp minimum maximum min-len length reg-seen  [Function]

Splits a REPETITION object into a constant and a varying part if applicable, i.e. something like a{3,} -> a{3}a* The arguments to this function correspond to the REPETITION slots of the same name.

maybe-accumulate   str  [Function]

Accumulate STR into the special variable STARTS-WITH if ACCUMULATE-START-P (also special) is true and STARTS-WITH is either NIL or a STR object of the same case mode. Always returns NIL.

convert-aux   parse-tree  [Function]

Converts the parse tree PARSE-TREE into a REGEX object and returns it.

Will also

  • split and optimize repetitions,

  • accumulate strings or EVERYTHING objects into the special variable STARTS-WITH,

  • keep track of all registers seen in the special variable REG-NUM,

  • keep track of all named registers seen in the special variable REG-NAMES

  • keep track of the highest backreference seen in the special variable MAX-BACK-REF,

  • maintain and adher to the currently applicable modifiers in the special variable FLAGS, and

  • maybe even wash your car...

convert   parse-tree  [Function]

Converts the parse tree PARSE-TREE into an equivalent REGEX object and returns three values: the REGEX object, the number of registers seen and an object the regex starts with which is either a STR object or an EVERYTHING object (if the regex starts with something like ".*") or NIL.

case-insensitive-mode-p   flags  [Macro]

Accessor macro to extract the first flag out of a three-element flag list.

multi-line-mode-p   flags  [Macro]

Accessor macro to extract the second flag out of a three-element flag list.

single-line-mode-p   flags  [Macro]

Accessor macro to extract the third flag out of a three-element flag list.