(:documentation
"Expand a parser list-form given by HEAD and TAIL, in CONTEXT.")
(:method (context head tail)
(:documentation
"Expand a parser list-form given by HEAD and TAIL, in CONTEXT.")
(:method (context head tail)
(cons head tail)))
(export 'wrap-parser)
(defgeneric wrap-parser (context form)
(:documentation
"Enclose FORM in whatever is necessary to make the parser work.")
(cons head tail)))
(export 'wrap-parser)
(defgeneric wrap-parser (context form)
(:documentation
"Enclose FORM in whatever is necessary to make the parser work.")
body FORMs. The BVL is a destructuring lambda-list to be applied to the
tail of the form. The body forms are enclosed in a block called NAME.
body FORMs. The BVL is a destructuring lambda-list to be applied to the
tail of the form. The body forms are enclosed in a block called NAME.
If the :context key is provided, then the parser form is specialized on a
particular class of parser contexts SPEC; specialized expanders take
priority over less specialized or unspecialized expanders -- so you can
If the :context key is provided, then the parser form is specialized on a
particular class of parser contexts SPEC; specialized expanders take
priority over less specialized or unspecialized expanders -- so you can
`(defmethod expand-parser-form
((,context ,ctxclass) (,head (eql ',name)) ,tail)
,@doc
`(defmethod expand-parser-form
((,context ,ctxclass) (,head (eql ',name)) ,tail)
,@doc
'(values t t nil))
(defmethod expand-parser-spec (context (spec (eql nil)))
"Always fails without consuming input. The failure indicator is `:fail'."
'(values t t nil))
(defmethod expand-parser-spec (context (spec (eql nil)))
"Always fails without consuming input. The failure indicator is `:fail'."
(parser () ,parser)
,@(and sepp (list `(parser () ,sep)))
,@(and minp `(:min ,min))
(parser () ,parser)
,@(and sepp (list `(parser () ,sep)))
,@(and minp `(:min ,min))
(with-gensyms (acc)
`(parse (many (,acc nil (cons it ,acc) :final (nreverse ,acc) ,@keys)
,parser ,@(and sepp (list sep))))))
(export 'skip-many)
(defparse skip-many ((&rest keys) parser &optional (sep nil sepp))
(with-gensyms (acc)
`(parse (many (,acc nil (cons it ,acc) :final (nreverse ,acc) ,@keys)
,parser ,@(and sepp (list sep))))))
(export 'skip-many)
(defparse skip-many ((&rest keys) parser &optional (sep nil sepp))
`(parse (many (nil nil nil ,@keys)
,parser ,@(and sepp (list sep)))))
`(parse (many (nil nil nil ,@keys)
,parser ,@(and sepp (list sep)))))
underlying scanner can use this call to determine whether there are
outstanding captured places, and thereby optimize its behaviour. Be
careful: all of this is happening at macro-expansion time.")
underlying scanner can use this call to determine whether there are
outstanding captured places, and thereby optimize its behaviour. Be
careful: all of this is happening at macro-expansion time.")
the correct cleanup. If it returns false, then the `unwind-protect' is
omitted so that the runtime code does't have to register cleanup
handlers.")
the correct cleanup. If it returns false, then the `unwind-protect' is
omitted so that the runtime code does't have to register cleanup
handlers.")
A token matches under the following conditions:
* If the value of TYPE is `t' then the match succeeds if and only if the
A token matches under the following conditions:
* If the value of TYPE is `t' then the match succeeds if and only if the