a little progress
svn: r11063
This commit is contained in:
parent
b2e7594c9d
commit
7aa5a138cf
|
@ -2,10 +2,18 @@
|
||||||
@(require scribble/manual
|
@(require scribble/manual
|
||||||
scribble/bnf
|
scribble/bnf
|
||||||
scribble/eval
|
scribble/eval
|
||||||
|
(for-syntax scheme/base)
|
||||||
(for-label scheme/base
|
(for-label scheme/base
|
||||||
scheme/contract
|
scheme/contract
|
||||||
redex))
|
redex))
|
||||||
|
|
||||||
|
@(define-syntax (defpattech stx)
|
||||||
|
(syntax-case stx ()
|
||||||
|
[(_ arg)
|
||||||
|
(identifier? #'arg)
|
||||||
|
(with-syntax ([as (symbol->string (syntax-e #'arg))])
|
||||||
|
#'@index['("Redex Pattern" as)]{@deftech{as}})]))
|
||||||
|
|
||||||
@;{
|
@;{
|
||||||
|
|
||||||
I usually use an `ellipsis' non-terminal to make it more explicit that
|
I usually use an `ellipsis' non-terminal to make it more explicit that
|
||||||
|
@ -101,7 +109,7 @@ this tool:
|
||||||
|
|
||||||
======================================================================
|
======================================================================
|
||||||
|
|
||||||
The _reduction-semantics.ss_ library defines a pattern
|
The _reduction-semantics.ss_ library defines a @deftech{pattern}
|
||||||
language, used in various ways:
|
language, used in various ways:
|
||||||
|
|
||||||
@(schemegrammar* #:literals (any number string variable variable-except variable-prefix variable-not-otherwise-mentioned hole name in-hole in-named-hole side-condition cross)
|
@(schemegrammar* #:literals (any number string variable variable-except variable-prefix variable-not-otherwise-mentioned hole name in-hole in-named-hole side-condition cross)
|
||||||
|
@ -125,12 +133,21 @@ language, used in various ways:
|
||||||
scheme-constant]
|
scheme-constant]
|
||||||
[pattern-sequence
|
[pattern-sequence
|
||||||
pattern
|
pattern
|
||||||
... ;; literal ellipsis
|
(code:line ... (code:comment "literal ellipsis"))
|
||||||
..._id])
|
..._id])
|
||||||
|
|
||||||
The patterns match sexpressions. The _any_ pattern matches
|
@itemize{
|
||||||
any sepxression. The _number_ pattern matches any
|
|
||||||
number. The _string_ pattern matches any string. Those three
|
@item{The any
|
||||||
|
@;{@defpattech[any]}
|
||||||
|
pattern matches
|
||||||
|
any sepxression.}
|
||||||
|
|
||||||
|
@item{The number
|
||||||
|
@;{@defpattech[number]}
|
||||||
|
pattern matches any number.}}
|
||||||
|
|
||||||
|
The _string_ pattern matches any string. Those three
|
||||||
patterns may also be suffixed with an underscore and another
|
patterns may also be suffixed with an underscore and another
|
||||||
identifier, in which case they bind the full name (as if it
|
identifier, in which case they bind the full name (as if it
|
||||||
were an implicit `name' pattern) and match the portion
|
were an implicit `name' pattern) and match the portion
|
||||||
|
|
Loading…
Reference in New Issue
Block a user