Skip to content

Commit f059bab

Browse files
more labels for thesis
1 parent 34fbb87 commit f059bab

File tree

5 files changed

+20
-12
lines changed

5 files changed

+20
-12
lines changed

scribblings/common.rkt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@
2121
(cond-element
2222
[latex (make-element (make-style #false '(exact-chars)) items)]
2323
[else ""]))
24+
25+
(define (tex-label label)
26+
(mk-exact (format "\\label{~a}" label)))

scribblings/reference/compiling.scrbl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
@title{Compiling languages}
99

1010
@section[#:tag "reference compilers"]{Compiling references to DSL bindings within Racket code}
11+
@tex-label{doc:referencecompilers}
1112

1213
@margin-note{@secref["compilation" #:doc '(lib "syntax-spec-dev/scribblings/main.scrbl")] in the @secref["Basic_Tutorial__State_Machine_Language"
1314
#:doc '(lib "syntax-spec-dev/scribblings/main.scrbl")] introduces the use of reference compilers.}
@@ -74,6 +75,7 @@ Another concept that comes up when discussing identifiers and compilation is pos
7475
During the expansion of the invocation, when a macro's transformer is running, the macro transformer will see this introduction scope on the incoming syntax. This syntax is in @deftech{negative space}. After the scope is flipped off on the result, the syntax is in @deftech{positive space}. It's important to note that positive vs negative space depends on the @emph{current} introduction scope, as there may be many introduction scopes floating around. It is also possible to manually flip this scope in a transformer to convert syntax between positive and negative space.
7576

7677
@section{Symbol collections}
78+
@tex-label{doc:symboltables}
7779

7880
Symbol collections allow compilers to track information related to dsl variables. Symbol collections expect to receive @tech{compiled identifiers} in @tech{negative space}.
7981

scribblings/reference/main.scrbl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#lang scribble/manual
22

3-
@(require (for-label racket))
3+
@(require (for-label racket) "../common.rkt")
44

55
@title[#:style '(toc)]{Reference}
6+
@tex-label{doc:reference}
67

78
@require[(for-label "../../main.rkt")]
89
@defmodule[syntax-spec-dev]

scribblings/reference/specifying.scrbl

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ The following subsections address each kind of declaration allowed within the
2424

2525

2626
@section{Binding classes}
27-
@mk-exact["\\label{doc:binding-classes}"]
27+
@tex-label["doc:binding-classes"]
2828

2929

3030
@deftech{Binding classes} distinguish types of binding. When a reference resolves to a
3131
binder, it is an error if the binding class declared for the reference position
3232
does not match the binding class of the binding position.
3333

34-
@defsubform[(binding-class id binding-class-option ...)
34+
@defform[(binding-class id binding-class-option ...)
3535
#:grammar
3636
[(binding-class-option (code:line #:description string-literal)
3737
(code:line #:binding-space space-symbol)
@@ -65,7 +65,7 @@ class using @racket[define-dsl-syntax].
6565
Nonterminals can be declared extensible by a certain extension class using @racket[#:allow-extension].
6666
These extensions are expanded away into core DSL forms before compilation.
6767

68-
@defsubform[(extension-class id extension-class-option)
68+
@defform[(extension-class id extension-class-option)
6969
#:grammar
7070
[(extension-class-option (code:line #:description string-literal)
7171
(code:line #:binding-space space-symbol))]]
@@ -78,7 +78,7 @@ to use for all extensions with this class.
7878

7979
@section{Nonterminals}
8080

81-
@defsubform[(nonterminal id nonterminal-option production ...)]
81+
@defform[(nonterminal id nonterminal-option production ...)]
8282

8383
Defines a nonterminal supporting @racket[let]-like binding structure.
8484

@@ -96,7 +96,7 @@ Example:
9696

9797
@let-example
9898

99-
@defsubform[(nonterminal/nesting id (nested-id) nonterminal-option production ...)]
99+
@defform[(nonterminal/nesting id (nested-id) nonterminal-option production ...)]
100100

101101
Defines a @deftech{nesting nonterminal} supporting nested, @racket[let*]-like binding structure. Nesting nonterminals may also be used to describe complex binding structures like for @racket[match].
102102

@@ -117,7 +117,7 @@ Example:
117117
]]
118118
@let*-example
119119

120-
@defsubform[(nonterminal/exporting id nonterminal-option production ...)]
120+
@defform[(nonterminal/exporting id nonterminal-option production ...)]
121121

122122
Defines an @deftech{exporting nonterminal} which can export bindings, like @racket[define] and @racket[begin].
123123

@@ -252,6 +252,7 @@ When a form production's form is used outside of the context of a syntax-spec DS
252252
]
253253

254254
@section{Binding specs}
255+
@tex-label{doc:bindingspecs}
255256

256257

257258
@racketgrammar*[#:literals (bind bind-syntax bind-syntaxes import re-export export export-syntax export-syntaxes nest ...)
@@ -448,7 +449,7 @@ There are several other constraints on binding specs:
448449
Host interface forms are the entry point to the DSL from the host language. They often invoke a compiler macro to translate
449450
the DSL forms into Racket expressions.
450451

451-
@defsubform[(host-interface/expression
452+
@defform[(host-interface/expression
452453
(id . syntax-spec)
453454
maybe-binding-spec
454455
pattern-directive ...
@@ -476,7 +477,7 @@ An example from the @hyperlink["https://github.com/michaelballantyne/syntax-spec
476477
This defines @racket[run], which takes in a Racket expression representing a number, a term variable, and a goal, and invokes
477478
the compiler @racket[compile-goal] to translate the DSL forms into Racket.
478479

479-
@defsubform[#:literals (-> define)
480+
@defform[#:literals (-> define)
480481
(host-interface/definition
481482
(id . syntax-spec)
482483
maybe-binding-spec
@@ -522,7 +523,7 @@ An example from the @hyperlink["https://github.com/michaelballantyne/syntax-spec
522523

523524
This defines @racket[defrel], which defines a relation. In the @racket[#:lhs], We record arity information about the identifier before producing it. Since the left-hand-sides all run before the right-hand-sides, even if there is mutual recursion, all arity information will be available before any goals are compiled. Note that the @racket[#:rhs] produces a lambda expression, not a @racket[define].
524525

525-
@defsubform[(host-interface/definitions
526+
@defform[(host-interface/definitions
526527
(id . syntax-spec)
527528
maybe-binding-spec
528529
pattern-directive ...

scribblings/tutorial/main.scrbl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#lang scribble/manual
22

3-
@(require (for-label racket))
3+
@(require (for-label racket) "../common.rkt")
44

5-
@title[#:style '(toc)]{Tutorial}
5+
@title[#:tag "tutorials" #:style '(toc)]{Tutorial}
6+
@tex-label{doc:tutorials}
67

78
The tutorial is broken down into illustrative examples:
89

0 commit comments

Comments
 (0)