;ELC   
;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:39:22 2003
;;; from file /home/pot/gnu/emacs-pretest.new/lisp/emacs-lisp/rx.el
;;; in Emacs version 21.3
;;; with bytecomp version 2.85.4.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`rx.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


#@642 Alist of sexp form regexp constituents.
Each element of the alist has the form (SYMBOL . DEFN).
SYMBOL is a valid constituent of sexp regular expressions.
If DEFN is a string, SYMBOL is translated into DEFN.
If DEFN is a symbol, use the definition of DEFN, recursively.
Otherwise, DEFN must be a list (FUNCTION MIN-ARGS MAX-ARGS PREDICATE).
FUNCTION is used to produce code for SYMBOL.  MIN-ARGS and MAX-ARGS
are the minimum and maximum number of arguments the function-form
sexp constituent SYMBOL may have in sexp regular expressions.
MAX-ARGS nil means no limit.  PREDICATE, if specified, means that
all arguments must satisfy PREDICATE.
(defconst rx-constituents '((and rx-and 1 nil) (or rx-or 1 nil) (not-newline . ".") (anything . ".\\|\n") (any rx-any 1 1 rx-check-any) (in . any) (not rx-not 1 1 rx-check-not) (repeat rx-repeat 2 3) (submatch rx-submatch 1 nil) (group . submatch) (zero-or-more rx-kleene 1 1) (one-or-more rx-kleene 1 1) (zero-or-one rx-kleene 1 1) (\? . zero-or-one) (\?\? . zero-or-one) (* . zero-or-more) (*\? . zero-or-more) (0+ . zero-or-more) (+ . one-or-more) (+\? . one-or-more) (1+ . one-or-more) (optional . zero-or-one) (minimal-match rx-greedy 1 1) (maximal-match rx-greedy 1 1) (line-start . "^") (line-end . "$") (string-start . "\\`") (string-end . "\\'") (buffer-start . "\\`") (buffer-end . "\\'") (point . "\\=") (word-start . "\\<") (word-end . "\\>") (word-boundary . "\\b") (syntax rx-syntax 1 1) (category rx-category 1 1 rx-check-category) (eval rx-eval 1 1) (regexp rx-regexp 1 1 stringp) (digit . "[[:digit:]]") (control . "[[:cntrl:]]") (hex-digit . "[[:xdigit:]]") (blank . "[[:blank:]]") (graphic . "[[:graph:]]") (printing . "[[:print:]]") (alphanumeric . "[[:alnum:]]") (letter . "[[:alpha:]]") (ascii . "[[:ascii:]]") (nonascii . "[[:nonascii:]]") (lower . "[[:lower:]]") (punctuation . "[[:punct:]]") (space . "[[:space:]]") (upper . "[[:upper:]]") (word . "[[:word:]]")) (#$ . 618))
#@265 Alist mapping Rx syntax symbols to syntax characters.
Each entry has the form (SYMBOL . CHAR), where SYMBOL is a valid
symbol in `(syntax SYMBOL)', and CHAR is the syntax character
corresponding to SYMBOL, as it would be used with \s or \S in
regular expressions.
(defconst rx-syntax '((whitespace . 45) (punctuation . 46) (word . 119) (symbol . 95) (open-parenthesis . 40) (close-parenthesis . 41) (expression-prefix . 39) (string-quote . 34) (paired-delimiter . 36) (escape . 92) (character-quote . 47) (comment-start . 60) (comment-end . 62)) (#$ . 2566))
#@272 Alist mapping symbols to category characters.
Each entry has the form (SYMBOL . CHAR), where SYMBOL is a valid
symbol in `(category SYMBOL)', and CHAR is the category character
corresponding to SYMBOL, as it would be used with `\c' or `\C' in
regular expression strings.
(defconst rx-categories '((consonant . 48) (base-vowel . 49) (upper-diacritical-mark . 50) (lower-diacritical-mark . 51) (tone-mark . 52) (symbol . 53) (digit . 54) (vowel-modifying-diacritical-mark . 55) (vowel-sign . 56) (semivowel-lower . 57) (not-at-end-of-line . 60) (not-at-beginning-of-line . 62) (alpha-numeric-two-byte . 65) (chinse-two-byte . 67) (greek-two-byte . 71) (japanese-hiragana-two-byte . 72) (indian-two-byte . 73) (japanese-katakana-two-byte . 75) (korean-hangul-two-byte . 78) (cyrillic-two-byte . 89) (ascii . 97) (arabic . 98) (chinese . 99) (ethiopic . 101) (greek . 103) (korean . 104) (indian . 105) (japanese . 106) (japanese-katakana . 107) (latin . 108) (lao . 111) (tibetan . 113) (japanese-roman . 114) (thai . 116) (vietnamese . 118) (hebrew . 119) (cyrillic . 121) (can-break . 124)) (#$ . 3132))
#@124 Non-nil means produce greedy regular expressions for `zero-or-one',
`zero-or-more', and `one-or-more'.  Dynamically bound.
(defvar rx-greedy-flag t (#$ . 4242))
#@205 Return parsing/code generation info for OP.
If OP is the space character ASCII 32, return info for the symbol `?'.
If OP is the character `?', return info for the symbol `??'.
See also `rx-constituents'.
(defalias 'rx-info #[(op) "\302=\203 \303\202 \304=\203 \305\203% 9\203% 	\236A\211\204 \207" [op rx-constituents 32 \? 63 \?\?] 3 (#$ . 4410)])
#@49 Check FORM according to its car's parsing info.
(defalias 'rx-check #[(form) "\306@!GS	A@\307	8\310	8\203& \nW\203& \311\312@#\210\f\2037 \n\fV\2037 \311\313@\f#\210??\205f A\314\211\203d @!\204[ \311\315@#\210A\211\204H *\314-\207" [form rx nargs min-args max-args type-pred rx-info 2 3 error "Rx form `%s' requires at least %d args" "Rx form `%s' accepts at most %d args" nil "Rx form `%s' requires args satisfying `%s'" sub-form #1=#:--dolist-temp--97269] 5 (#$ . 4778)])
#@74 Parse and produce code from FORM.
FORM is of the form `(and FORM1 ...)'.
(defalias 'rx-and #[(form) "\301!\210\302\303A\304#\207" [form rx-check mapconcat rx-to-string nil] 4 (#$ . 5290)])
#@62 Parse and produce code from FORM, which is `(or FORM1 ...)'.
(defalias 'rx-or #[(form) "\304!\210\305A\306\211\203  @\211;\204 \306A\211\204 *	\203, \307A!\2022 \310\311A\312#)\207" [form all-args-strings arg #1=#:--dolist-temp--97270 rx-check t nil regexp-opt mapconcat rx-to-string "\\|"] 4 (#$ . 5487)])
#@143 Transform STRING for use in a character set.
If STRING contains a `]', move it to the front.
If STRING starts with a '^', move it to the end.
(defalias 'rx-quote-for-set #[(string) "\301\302\"\203 \303\304\305\"\304\306\"Q\301\307\"\203  \305\310O\311P\207" [string string-match "\\`\\(\\(?:.\\|\n\\)+\\)\\]\\(\\(?:.\\|\n\\)\\)*\\'" "]" match-string 1 2 "\\`^\\(\\(?:.\\|\n\\)+\\)\\'" nil "^"] 5 (#$ . 5815)])
#@29 Check arg ARG for Rx `any'.
(defalias 'rx-check-any #[(arg) "\250\203 \301\207;\203 \302G!\203 \303\304!\207;\203 \301\207\303\305!\207" [arg t zerop error "String arg for Rx `any' must not be empty" "Rx `any' requires string or character arg"] 2 (#$ . 6240)])
#@137 Parse and produce code from FORM, which is `(any STRING)'.
STRING is optional.  If it is omitted, build a regexp that
matches anything.
(defalias 'rx-any #[(form) "\303!\210\211A@)\211\250\203 \304\n!\202, \nG\305U\203! \n\202, \306\307\211A@)!\310Q)\207" [form x arg rx-check char-to-string 1 "[" rx-quote-for-set "]"] 4 (#$ . 6516)])
#@48 Check arguments of FORM.  FORM is `(not ...)'.
(defalias 'rx-check-not #[(form) "\301>\204 :\203 @\302>\204 \303\304\"\210\305\207" [form (digit control hex-digit blank graphic printing alphanumeric letter ascii nonascii lower punctuation space upper word) (not any in syntax category:) error "Rx `not' syntax error: %s" t] 3 (#$ . 6865)])
#@57 Parse and produce code from FORM.  FORM is `(not ...)'.
(defalias 'rx-not #[(form) "\303!\210\304\211A@)\305\"\306\307\n\"\203, \nG\310U\203# \n\311\312O\202\240 \313\n\311\314OP\202\240 \306\315\n\"\203< \316\n\317\314OP\202\240 \306\320\n\"\203L \321\n\311\314OP\202\240 \306\322\n\"\203\\ \323\n\311\314OP\202\240 \306\324\n\"\203l \325\n\311\314OP\202\240 \306\326\n\"\203| \327\n\311\314OP\202\240 \306\330\n\"\203\214 \331\n\311\314OP\202\240 \306\332\n\"\203\234 \333\n\311\314OP\202\240 \316\n\334Q)\207" [form x result rx-check rx-to-string no-group string-match "\\`\\[^" 4 2 3 "[" nil "\\`\\[" "[^" 1 "\\`\\\\s." "\\S" "\\`\\\\S." "\\s" "\\`\\\\c." "\\C" "\\`\\\\C." "\\c" "\\`\\\\B" "\\b" "\\`\\\\b" "\\B" "]"] 5 (#$ . 7218)])
#@94 Parse and produce code from FORM.
FORM is either `(repeat N FORM1)' or `(repeat N M FORM1)'.
(defalias 'rx-repeat #[(form) "\301!\210G\302U\203* A@\250\203 A@\303V\204 \304\305!\210\306\307\310\3118!A@#\207\3118\250\203R \3118\303W\204R A@\250\203R A@\303W\204R \3118A@W\203V \304\312!\207\306\313\310\3028!A@\3118$\207" [form rx-check 3 0 error "Rx `repeat' requires positive integer first arg" format "%s\\{%d\\}" rx-to-string 2 "Rx `repeat' range error" "%s\\{%d,%d\\}"] 6 (#$ . 7967)])
#@62 Parse and produce code from FORM, which is `(submatch ...)'.
(defalias 'rx-submatch #[(form) "\301\302\303A\304#\305Q\207" [form "\\(" mapconcat rx-to-string nil "\\)"] 5 (#$ . 8480)])
#@326 Parse and produce code from FORM.
FORM is `(OP FORM1)', where OP is one of the `zero-or-one',
`zero-or-more' etc.  operators.
If OP is one of `*', `+', `?', produce a greedy regexp.
If OP is one of `*?', `+?', `??', produce a non-greedy regexp.
If OP is anything else, produce a greedy regexp if `rx-greedy-flag'
is non-nil.
(defalias 'rx-kleene #[(form) "\305!\210@\306>\203 \307\202# @\310>\203 \311\202# 	\203\" \307\202# \311@\312>\203. \313\202: @\314>\2039 \315\202: \311\316\317\320\211A@)\321\"\n$*\207" [form rx-greedy-flag op suffix x rx-check (* + 32) "" (*\? +\? 63) "?" (* *\? 0+ zero-or-more) "*" (+ +\? 1+ one-or-more) "+" format "\\(?:%s\\)%s%s" rx-to-string no-group] 6 (#$ . 8673)])
#@63 Parse and produce code from FORM, which is `(syntax SYMBOL)'.
(defalias 'rx-syntax #[(form) "\304!\210\211A@)\n\236\211\204 \305\306\211A@)\"\210\307\310A\")\207" [form x rx-syntax syntax rx-check error "Unknown rx syntax `%s'" format "\\s%c"] 4 (#$ . 9392)])
#@49 Check the argument FORM of a `(category FORM)'.
(defalias 'rx-check-category #[(form) "\250\204 	\236A\204 \302\303\"\210\304\207" [form rx-categories error "Unknown category `%s'" t] 3 (#$ . 9666)])
#@69 Parse and produce code from FORM, which is `(category SYMBOL ...)'.
(defalias 'rx-category #[(form) "\304!\210\211A@)\250\203 \211A@)\202  \211A@)\n\236A\305\306\")\207" [form x rx-categories char rx-check format "\\c%c"] 4 (#$ . 9877)])
#@59 Parse and produce code from FORM, which is `(eval FORM)'.
(defalias 'rx-eval #[(form) "\302!\210\303\304\211A@)!!\207" [form x rx-check rx-to-string eval] 4 (#$ . 10131)])
#@214 Parse and produce code from FORM.  If FORM is '(minimal-match
FORM1)', non-greedy versions of `*', `+', and `?' operators will be
used in FORM1.  If FORM is '(maximal-match FORM1)', greedy operators
will be used.
(defalias 'rx-greedy #[(form) "\303!\210@\304=\305\211A@)!)\207" [form rx-greedy-flag x rx-check maximal-match rx-to-string] 3 (#$ . 10313)])
#@63 Parse and produce code from FORM, which is `(regexp STRING)'.
(defalias 'rx-regexp #[(form) "\302!\210\303\211A@)\304Q\207" [form x rx-check "\\(?:" "\\)"] 4 (#$ . 10679)])
#@159 Parse and produce code for regular expression FORM.
FORM is a regular expression in sexp form.
NO-GROUP non-nil means don't put shy groups around the result.
(defalias 'rx-to-string #[(form &optional no-group) ";\203	 \304!\207\250\203 \304\305!!\2079\2037 \306!\211;\203& 	\2025 	\2041 \307\310\"\2025 	@!)\207:\203f \306@!\211:\204L \307\310@\"\210	@!\204\\ \311\312\n\"\203` \n\202d \313\n\314Q*\207\307\315\"\207" [form info result no-group regexp-quote char-to-string rx-info error "Unknown Rx form `%s'" string-match "\\`\\\\[(]" "\\(?:" "\\)" "Rx syntax error at `%s'"] 4 (#$ . 10862)])
#@6722 Translate a regular expression REGEXP in sexp form to a regexp string.
See also `rx-to-string' for how to do such a translation at run-time.

The following are valid subforms of regular expressions in sexp
notation.

STRING
     matches string STRING literally.

CHAR
     matches character CHAR literally.

`not-newline'
     matches any character except a newline.
			.
`anything'
     matches any character

`(any SET)'
     matches any character in SET.  SET may be a character or string.
     Ranges of characters can be specified as `A-Z' in strings.

'(in SET)'
     like `any'.

`(not (any SET))'
     matches any character not in SET

`line-start'
     matches the empty string, but only at the beginning of a line
     in the text being matched

`line-end'
     is similar to `line-start' but matches only at the end of a line

`string-start'
     matches the empty string, but only at the beginning of the
     string being matched against.

`string-end'
     matches the empty string, but only at the end of the
     string being matched against.

`buffer-start'
     matches the empty string, but only at the beginning of the
     buffer being matched against.

`buffer-end'
     matches the empty string, but only at the end of the
     buffer being matched against.

`point'
     matches the empty string, but only at point.

`word-start'
     matches the empty string, but only at the beginning or end of a
     word.

`word-end'
     matches the empty string, but only at the end of a word.

`word-boundary'
     matches the empty string, but only at the beginning or end of a
     word.

`(not word-boundary)'
     matches the empty string, but not at the beginning or end of a
     word.

`digit'
     matches 0 through 9.

`control'
     matches ASCII control characters.

`hex-digit'
     matches 0 through 9, a through f and A through F.

`blank'
     matches space and tab only.

`graphic'
     matches graphic characters--everything except ASCII control chars,
     space, and DEL.

`printing'
     matches printing characters--everything except ASCII control chars
     and DEL.

`alphanumeric'
     matches letters and digits.  (But at present, for multibyte characters,
     it matches anything that has word syntax.)

`letter'
     matches letters.  (But at present, for multibyte characters,
     it matches anything that has word syntax.)

`ascii'
     matches ASCII (unibyte) characters.

`nonascii'
     matches non-ASCII (multibyte) characters.

`lower'
     matches anything lower-case.

`upper'
     matches anything upper-case.

`punctuation'
     matches punctuation.  (But at present, for multibyte characters,
     it matches anything that has non-word syntax.)

`space'
     matches anything that has whitespace syntax.

`word'
     matches anything that has word syntax.

`(syntax SYNTAX)'
     matches a character with syntax SYNTAX.  SYNTAX must be one
     of the following symbols.

     `whitespace'		(\s- in string notation)
     `punctuation'		(\s.)
     `word'			(\sw)
     `symbol'			(\s_)
     `open-parenthesis'		(\s()
     `close-parenthesis'	(\s))
     `expression-prefix'	(\s')
     `string-quote'		(\s")
     `paired-delimiter'		(\s$)
     `escape'			(\s\)
     `character-quote'		(\s/)
     `comment-start'		(\s<)
     `comment-end'		(\s>)

`(not (syntax SYNTAX))'
     matches a character that has not syntax SYNTAX.

`(category CATEGORY)'
     matches a character with category CATEGORY.  CATEGORY must be
     either a character to use for C, or one of the following symbols.

     `consonant'			(\c0 in string notation)
     `base-vowel'			(\c1)
     `upper-diacritical-mark'		(\c2)
     `lower-diacritical-mark'		(\c3)
     `tone-mark'		        (\c4)
     `symbol'			        (\c5)
     `digit'			        (\c6)
     `vowel-modifying-diacritical-mark'	(\c7)
     `vowel-sign'			(\c8)
     `semivowel-lower'			(\c9)
     `not-at-end-of-line'		(\c<)
     `not-at-beginning-of-line'		(\c>)
     `alpha-numeric-two-byte'		(\cA)
     `chinse-two-byte'			(\cC)
     `greek-two-byte'			(\cG)
     `japanese-hiragana-two-byte'	(\cH)
     `indian-tow-byte'			(\cI)
     `japanese-katakana-two-byte'	(\cK)
     `korean-hangul-two-byte'		(\cN)
     `cyrillic-two-byte'		(\cY)
     `ascii'				(\ca)
     `arabic'				(\cb)
     `chinese'				(\cc)
     `ethiopic'				(\ce)
     `greek'				(\cg)
     `korean'				(\ch)
     `indian'				(\ci)
     `japanese'				(\cj)
     `japanese-katakana'		(\ck)
     `latin'				(\cl)
     `lao'				(\co)
     `tibetan'				(\cq)
     `japanese-roman'			(\cr)
     `thai'				(\ct)
     `vietnamese'			(\cv)
     `hebrew'				(\cw)
     `cyrillic'				(\cy)
     `can-break'			(\c|)

`(not (category CATEGORY))'
     matches a character that has not category CATEGORY.

`(and SEXP1 SEXP2 ...)'
     matches what SEXP1 matches, followed by what SEXP2 matches, etc.

`(submatch SEXP1 SEXP2 ...)'
     like `and', but makes the match accessible with `match-end',
     `match-beginning', and `match-string'.

`(group SEXP1 SEXP2 ...)'
     another name for `submatch'.

`(or SEXP1 SEXP2 ...)'
     matches anything that matches SEXP1 or SEXP2, etc.  If all
     args are strings, use `regexp-opt' to optimize the resulting
     regular expression.

`(minimal-match SEXP)'
     produce a non-greedy regexp for SEXP.  Normally, regexps matching
     zero or more occurrances of something are "greedy" in that they
     match as much as they can, as long as the overall regexp can
     still match.  A non-greedy regexp matches as little as possible.

`(maximal-match SEXP)'
     produce a greedy regexp for SEXP.  This is the default.

`(zero-or-more SEXP)'
     matches zero or more occurrences of what SEXP matches.

`(0+ SEXP)'
     like `zero-or-more'.

`(* SEXP)'
     like `zero-or-more', but always produces a greedy regexp.

`(*? SEXP)'
     like `zero-or-more', but always produces a non-greedy regexp.

`(one-or-more SEXP)'
     matches one or more occurrences of A.

`(1+ SEXP)'
     like `one-or-more'.

`(+ SEXP)'
     like `one-or-more', but always produces a greedy regexp.

`(+? SEXP)'
     like `one-or-more', but always produces a non-greedy regexp.

`(zero-or-one SEXP)'
     matches zero or one occurrences of A.

`(optional SEXP)'
     like `zero-or-one'.

`(? SEXP)'
     like `zero-or-one', but always produces a greedy regexp.

`(?? SEXP)'
     like `zero-or-one', but always produces a non-greedy regexp.

`(repeat N SEXP)'
     matches N occurrences of what SEXP matches.

`(repeat N M SEXP)'
     matches N to M occurrences of what SEXP matches.

`(eval FORM)'
      evaluate FORM and insert result.  If result is a string,
      `regexp-quote' it.

`(regexp REGEXP)'
      include REGEXP in string notation in the result.
(defalias 'rx '(macro . #[(regexp) "\301\302DD\207" [regexp rx-to-string quote] 3 (#$ . 11482)]))
(provide 'rx)
