@@ -17,14 +17,15 @@ \section{Language grammar}
17
17
18
18
% TODO: Define all the auxiliary things we may need, such as integers, ...
19
19
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
22
23
a number of auxiliary constructs to define the rest of the grammar.
23
24
24
25
\begin {grammar }
25
26
<letter> ::= `A' ... `Z'
26
- \alt `a' ... `z'
27
- \alt `\_ ' ;
27
+ \alt `a' ... `z'
28
+ \alt `\_ ' ;
28
29
29
30
<sep> ::= ` ' | `\\t' ;
30
31
@@ -46,13 +47,13 @@ \section{Language grammar}
46
47
<oct\_ digit> ::= `0' | `1' | `2' | `3' | `4' | `5' | `6' | `7' ;
47
48
48
49
<HexDigit> ::= <DecDigitWithZero>
49
- \alt `A' ... `F'
50
- \alt `a' ... `f' ;
50
+ \alt `A' ... `F'
51
+ \alt `a' ... `f' ;
51
52
52
53
<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>
56
57
\end {grammar }
57
58
58
59
\begin {grammar }
@@ -105,8 +106,8 @@ \section{Language grammar}
105
106
% FIXME: SturctOrUnionSpec should include things like typedef and so on
106
107
\begin {grammar }
107
108
<StructOrUnionSpec> ::= ( `struct' | `union' ) [ <Identifier> ] \newline
108
- `{' <StructDeclList> `}' [ <VarList> ] `;'
109
- \alt ( `struct' | `union' ) <Identifier> [ <VarList> ] `;' ;
109
+ `{' <StructDeclList> `}' [ <VarList> ] `;'
110
+ \alt ( `struct' | `union' ) <Identifier> [ <VarList> ] `;' ;
110
111
111
112
<StructDeclList> ::= <Type> <VarList> `;' \{ <Type> <VarList> `;' \} ;
112
113
\end {grammar }
@@ -116,8 +117,8 @@ \section{Language grammar}
116
117
% FIXME: Enum should allow for typedefs/... as well.
117
118
\begin {grammar }
118
119
<EnumSpecifier> ::= `enum' [ <Identifier> ] \newline
119
- `{' <EnumDeclList> `}' [ <VarList> ] `;'
120
- \alt `enum' <Identifier> [ <VarList> ] `;' ;
120
+ `{' <EnumDeclList> `}' [ <VarList> ] `;'
121
+ \alt `enum' <Identifier> [ <VarList> ] `;' ;
121
122
122
123
<EnumDeclList> ::= <Identifier> [ `=' <Identifier> ] [ `,' ] ;
123
124
\end {grammar }
@@ -343,4 +344,4 @@ \section{Aggregations}
343
344
\section {Subroutines }
344
345
\label {sec:subroutines }
345
346
346
- % XXX explain how subroutines are different from actions.
347
+ % XXX explain how subroutines are different from actions.
0 commit comments