clarify define-extended-language example
This commit is contained in:
parent
2032aaf341
commit
db437e0ba8
|
@ -657,15 +657,15 @@ extended non-terminals. For example, this language:
|
||||||
(define-extended-language lc-num-lang
|
(define-extended-language lc-num-lang
|
||||||
lc-lang
|
lc-lang
|
||||||
(v .... (code:comment "extend the previous `v' non-terminal")
|
(v .... (code:comment "extend the previous `v' non-terminal")
|
||||||
+
|
number
|
||||||
number)
|
+)
|
||||||
(x (variable-except λ +)))
|
(x (variable-except λ +)))
|
||||||
]
|
]
|
||||||
|
|
||||||
extends lc-lang with two new alternatives for the @racket[v]
|
extends lc-lang with two new alternatives (@racket[+] and @racket[number])
|
||||||
non-terminal, carries forward the @racket[e] and @racket[c]
|
for the @racket[v] non-terminal, carries forward the @racket[e]
|
||||||
non-terminals, and replaces the @racket[x] non-terminal with a
|
and @racket[c] non-terminals, and replaces the @racket[x] non-terminal
|
||||||
new one (which happens to be equivalent to the one that would
|
with a new one (which happens to be equivalent to the one that would
|
||||||
have been inherited).
|
have been inherited).
|
||||||
|
|
||||||
The four-period ellipses indicates that the new language's
|
The four-period ellipses indicates that the new language's
|
||||||
|
|
Loading…
Reference in New Issue
Block a user