Skip to content

Commit c07b3b8

Browse files
committed
expr ~> full-expr
1 parent 81094cc commit c07b3b8

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

scribblings/tutorial/multipass-tutorial.scrbl

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ Here is the syntax-spec of our language:
2323
(syntax-spec
2424
(binding-class var
2525
#:reference-compiler immutable-reference-compiler)
26-
(nonterminal expr
26+
(nonterminal full-expr
2727
#:binding-space anf
2828
n:number
2929
x:var
30-
(let ([x:var e:expr]) body:expr)
30+
(let ([x:var e:full-expr]) body:full-expr)
3131
#:binding (scope (bind x) body)
32-
(+ a:expr b:expr)
33-
(* a:expr b:expr)
34-
(/ a:expr b:expr)
32+
(+ a:full-expr b:full-expr)
33+
(* a:full-expr b:full-expr)
34+
(/ a:full-expr b:full-expr)
3535
(rkt e:racket-expr))
3636
(nonterminal anf-expr
3737
#:binding-space anf
@@ -51,7 +51,7 @@ Here is the syntax-spec of our language:
5151
n:number)
5252

5353
(host-interface/expression
54-
(eval-expr e:expr)
54+
(eval-expr e:full-expr)
5555
#'(compile-expr e)))
5656

5757
(begin-for-syntax
@@ -73,7 +73,7 @@ Here is the syntax-spec of our language:
7373
#'(compile-anf e/pruned^)]))
7474

7575
(begin-for-syntax
76-
; expr -> anf-expr
76+
; full-expr -> anf-expr
7777
(define (to-anf e)
7878
; list of (list Identifier rhs-expr)
7979
; most recent, and thus innermost, binding first
@@ -84,7 +84,7 @@ Here is the syntax-spec of our language:
8484
(define e^ (to-rhs! e lift-binding!))
8585
(wrap-lets e^ (reverse bindings-rev)))
8686

87-
; expr (Identifier rhs-expr -> Void) -> rhs-expr
87+
; full-expr (Identifier rhs-expr -> Void) -> rhs-expr
8888
; this doesn't need to be hygienic, only the whole pass.
8989
; in other compilers, helpers may need to be hygienic too.
9090
(define (to-rhs! e lift-binding!)
@@ -102,7 +102,7 @@ Here is the syntax-spec of our language:
102102
n:number)
103103
this-syntax]))
104104

105-
; expr (Identifier rhs-expr -> Void) -> immediate-expr
105+
; full-expr (Identifier rhs-expr -> Void) -> immediate-expr
106106
(define (to-immediate! e lift-binding!)
107107
(syntax-parse e
108108
[(~or x:id n:number) this-syntax]
@@ -190,15 +190,15 @@ racket
190190
(syntax-spec
191191
(binding-class var
192192
#:reference-compiler immutable-reference-compiler)
193-
(nonterminal expr
193+
(nonterminal full-expr
194194
#:binding-space anf
195195
n:number
196196
x:var
197-
(let ([x:var e:expr]) body:expr)
197+
(let ([x:var e:full-expr]) body:full-expr)
198198
#:binding (scope (bind x) body)
199-
(+ a:expr b:expr)
200-
(* a:expr b:expr)
201-
(/ a:expr b:expr)
199+
(+ a:full-expr b:full-expr)
200+
(* a:full-expr b:full-expr)
201+
(/ a:full-expr b:full-expr)
202202
(rkt e:racket-expr))
203203
(nonterminal anf-expr
204204
#:binding-space anf
@@ -218,7 +218,7 @@ racket
218218
n:number)
219219

220220
(host-interface/expression
221-
(eval-expr e:expr)
221+
(eval-expr e:full-expr)
222222
#'(compile-expr e)))
223223
]
224224

@@ -227,8 +227,8 @@ Our language supports arithmetic, local variables, and Racket subexpressions.
227227
We have the following nonterminals:
228228

229229
@itemlist[
230-
@item{@racket[expr]: The surface syntax of a program}
231-
@item{@racket[anf-expr]: An expression in A-normal form. Users will not be writing these expressions; the compiler will transform @racket[expr]s the user writes into @racket[anf-expr]s.}
230+
@item{@racket[full-expr]: The surface syntax of a program}
231+
@item{@racket[anf-expr]: An expression in A-normal form. Users will not be writing these expressions; the compiler will transform @racket[full-expr]s the user writes into @racket[anf-expr]s.}
232232
@item{@racket[rhs-expr]: An expression which is allowed to be on the right-hand side of a binding pair in an expression when it is in A-normal form. Conceptually, these expressions take at most one "step" of reduction to evaluate. In other words, no nested expressions (except for @racket[rkt] expressions).}
233233
@item{@racket[immediate-expr]: Atomic expressions that can immediately be evaluated.}
234234
]
@@ -253,7 +253,7 @@ Now let's automate this process:
253253

254254
@racketblock[
255255
(begin-for-syntax
256-
(code:comment2 "expr -> anf-expr")
256+
(code:comment2 "full-expr -> anf-expr")
257257
(code:comment2 "convert an expression to A-normal form")
258258
(define (to-anf e)
259259
(define bindings-rev '())
@@ -263,7 +263,7 @@ Now let's automate this process:
263263
(define e^ (to-rhs! e lift-binding!))
264264
(wrap-lets e^ (reverse bindings-rev)))
265265

266-
(code:comment2 "expr (Identifier rhs-expr -> Void) -> rhs-expr")
266+
(code:comment2 "full-expr (Identifier rhs-expr -> Void) -> rhs-expr")
267267
(code:comment2 "convert an expr to an rhs-expr, potentially recording bindings")
268268
(define (to-rhs! e lift-binding!)
269269
(syntax-parse e
@@ -280,8 +280,8 @@ Now let's automate this process:
280280
n:number)
281281
this-syntax]))
282282

283-
(code:comment2 "expr (Identifier rhs-expr -> Void) -> immediate-expr")
284-
(code:comment2 "convert an expr to an immediate-expr, potentially recording bindings")
283+
(code:comment2 "full-expr (Identifier rhs-expr -> Void) -> immediate-expr")
284+
(code:comment2 "convert a full-expr to an immediate-expr, potentially recording bindings")
285285
(define (to-immediate! e lift-binding!)
286286
(syntax-parse e
287287
[(~or x:id n:number) this-syntax]

tests/dsls/multipass.rkt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
(syntax-spec
1010
(binding-class var
1111
#:reference-compiler immutable-reference-compiler)
12-
(nonterminal expr
12+
(nonterminal full-expr
1313
#:binding-space anf
1414
n:number
1515
x:var
16-
(let ([x:var e:expr]) body:expr)
16+
(let ([x:var e:full-expr]) body:full-expr)
1717
#:binding (scope (bind x) body)
18-
(+ a:expr b:expr)
19-
(* a:expr b:expr)
20-
(/ a:expr b:expr)
18+
(+ a:full-expr b:full-expr)
19+
(* a:full-expr b:full-expr)
20+
(/ a:full-expr b:full-expr)
2121
(rkt e:racket-expr))
2222
(nonterminal anf-expr
2323
#:binding-space anf
@@ -37,7 +37,7 @@
3737
n:number)
3838

3939
(host-interface/expression
40-
(eval-expr e:expr)
40+
(eval-expr e:full-expr)
4141
#'(compile-expr e)))
4242

4343
(begin-for-syntax
@@ -59,7 +59,7 @@
5959
#'(compile-anf e/pruned^)]))
6060

6161
(begin-for-syntax
62-
; expr -> anf-expr
62+
; full-expr -> anf-expr
6363
(define (to-anf e)
6464
; list of (list Identifier rhs-expr)
6565
; most recent, and thus innermost, binding first
@@ -70,7 +70,7 @@
7070
(define e^ (to-rhs! e lift-binding!))
7171
(wrap-lets e^ (reverse bindings-rev)))
7272

73-
; expr (Identifier rhs-expr -> Void) -> rhs-expr
73+
; full-expr (Identifier rhs-expr -> Void) -> rhs-expr
7474
; this doesn't need to be hygienic, only the whole pass.
7575
; in other compilers, helpers may need to be hygienic too.
7676
(define (to-rhs! e lift-binding!)
@@ -88,7 +88,7 @@
8888
n:number)
8989
this-syntax]))
9090

91-
; expr (Identifier rhs-expr -> Void) -> immediate-expr
91+
; full-expr (Identifier rhs-expr -> Void) -> immediate-expr
9292
(define (to-immediate! e lift-binding!)
9393
(syntax-parse e
9494
[(~or x:id n:number) this-syntax]

0 commit comments

Comments
 (0)