Skip to content

Commit 4a12683

Browse files
committed
Clean up the source code and explain notation.
1 parent cbeb2a5 commit 4a12683

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

specification/chap-opendtrace-dlang.tex

+15-14
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ \section{Language grammar}
1717

1818
%TODO: Define all the auxiliary things we may need, such as integers, ...
1919

20-
In this section, we will define the grammar of the D language and explain
21-
how each part fits together when interacting with DTrace. We first define
20+
In this section, we will define the grammar of the D language and explain how
21+
each part fits together when interacting with DTrace. Terminals are represented
22+
using lower\_case, while non-terminals are written as CamelCase. We first define
2223
a number of auxiliary constructs to define the rest of the grammar.
2324

2425
\begin{grammar}
2526
<letter> ::= `A' ... `Z'
26-
\alt `a' ... `z'
27-
\alt `\_' ;
27+
\alt `a' ... `z'
28+
\alt `\_' ;
2829

2930
<sep> ::= ` ' | `\\t' ;
3031

@@ -46,13 +47,13 @@ \section{Language grammar}
4647
<oct\_digit> ::= `0' | `1' | `2' | `3' | `4' | `5' | `6' | `7' ;
4748

4849
<HexDigit> ::= <DecDigitWithZero>
49-
\alt `A' ... `F'
50-
\alt `a' ... `f' ;
50+
\alt `A' ... `F'
51+
\alt `a' ... `f' ;
5152

5253
<Integer> ::= <dec\_digit> <DecDigitWithZero>
53-
\alt `0b' <bin\_digit>
54-
\alt `0' <oct\_digit>
55-
\alt `0x' <HexDigit>
54+
\alt `0b' <bin\_digit>
55+
\alt `0' <oct\_digit>
56+
\alt `0x' <HexDigit>
5657
\end{grammar}
5758

5859
\begin{grammar}
@@ -105,8 +106,8 @@ \section{Language grammar}
105106
% FIXME: SturctOrUnionSpec should include things like typedef and so on
106107
\begin{grammar}
107108
<StructOrUnionSpec> ::= ( `struct' | `union' ) [ <Identifier> ] \newline
108-
`{' <StructDeclList> `}' [ <VarList> ] `;'
109-
\alt ( `struct' | `union' ) <Identifier> [ <VarList> ] `;' ;
109+
`{' <StructDeclList> `}' [ <VarList> ] `;'
110+
\alt ( `struct' | `union' ) <Identifier> [ <VarList> ] `;' ;
110111

111112
<StructDeclList> ::= <Type> <VarList> `;' \{ <Type> <VarList> `;' \} ;
112113
\end{grammar}
@@ -116,8 +117,8 @@ \section{Language grammar}
116117
% FIXME: Enum should allow for typedefs/... as well.
117118
\begin{grammar}
118119
<EnumSpecifier> ::= `enum' [ <Identifier> ] \newline
119-
`{' <EnumDeclList> `}' [ <VarList> ] `;'
120-
\alt `enum' <Identifier> [ <VarList> ] `;' ;
120+
`{' <EnumDeclList> `}' [ <VarList> ] `;'
121+
\alt `enum' <Identifier> [ <VarList> ] `;' ;
121122

122123
<EnumDeclList> ::= <Identifier> [ `=' <Identifier> ] [ `,' ] ;
123124
\end{grammar}
@@ -343,4 +344,4 @@ \section{Aggregations}
343344
\section{Subroutines}
344345
\label{sec:subroutines}
345346

346-
% XXX explain how subroutines are different from actions.
347+
% XXX explain how subroutines are different from actions.

0 commit comments

Comments
 (0)