@@ -11,7 +11,7 @@ three important analysis methods and some commonly used terms.
11
11
\section representations_section Representations
12
12
13
13
One of the first questions we should be considering is how we represent programs
14
- in such a way that we can easily analyze and reason them.
14
+ in such a way that we can easily analyze and reason about them.
15
15
16
16
As it turns out, the best way to do this is to use a variety of
17
17
different representations, each representing a different level of
@@ -81,12 +81,12 @@ The key data structure that stores the result of this step is known as an
81
81
(cf. [Wikipedia](https://en.wikipedia.org/wiki/Abstract_syntax_tree)).
82
82
ASTs are still relatively
83
83
close to the source code, and represent the structure of the source code
84
- while abstracting away from irrelevant details, e.g., dropping
84
+ while abstracting away from syntactic details, e.g., dropping
85
85
parentheses, semicolons and braces as long as those are only used for
86
86
grouping.
87
87
88
88
Considering the example of the C program given above, we first notice
89
- that the program describes (in C terms) a single *compilation unit*,
89
+ that the program describes (in C terms) a single *translation unit*,
90
90
consisting of four top-level *declarations* (the two function forward
91
91
declarations of `atoi` and `printf`, and the function definitions of
92
92
`factorial` and `main`). Let us start considering the specification of
@@ -112,9 +112,9 @@ it has a child node initiating a parameter list, and there is a node in
112
112
the parameter list for each parameter, giving its type and name, if a
113
113
name is given.
114
114
115
- More interestingly , we can represent the structure of the `factorial`
115
+ Extending this idea , we can represent the structure of the `factorial`
116
116
function using ASTs. The idea here is that the code itself has a
117
- hierarchical structure. In the case of C, this start with the block
117
+ hierarchical structure. In the case of C, this starts with the block
118
118
structure of the code: At the top, we start with a block of code, having
119
119
three children, each being a ''statement'' node:
120
120
1. `unsigned long fac = 1`
0 commit comments