Skip to content

Commit 827baa7

Browse files
committed
some lesson 5 grammar fixes
1 parent 352b9a3 commit 827baa7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tutorial/en/5-Variables.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
In this chapter we are going to use EBNF to describe the grammer of our C
2-
interpreter, and add the support of variable.
2+
interpreter, and add the support of variables.
33

4-
Parser is more complicated than lexer, thus we will split it into 3 parts:
4+
The parser is more complicated than the lexer, thus we will split it into 3 parts:
55
variables, functions and expressions.
66

77
## EBNF grammar
@@ -11,7 +11,7 @@ We've talked about BNF in the previous chapter,
1111
Extended-BNF. If you are familiar with regular expression, you should feel
1212
right at home. Personally I think it is more powerful and straightforward than
1313
BNF. Here is the EBNF grammar of our C interpreter, feel free to skip it if
14-
you feel too hard to understand.
14+
you feel it's too hard to understand.
1515

1616
```
1717
program ::= {global_declaration}+
@@ -61,15 +61,15 @@ void program() {
6161
```
6262

6363
I know that we havn't defined `global_declaration`, sometimes we need wishful
64-
thinking that maybe someone(say Bob) will implement that for you. So you can
64+
thinking that maybe someone (say Bob) will implement that for you. So you can
6565
focus on the big picture at first instead of drill down into all the details.
6666
That's the essence of top-down thinking.
6767

6868
## global_declaration()
6969

70-
Now it is our duty(not Bob's) to implement `global_declaration`. It will try
71-
to parse variable definition, type definition(only enum is supported) and
72-
function definition:
70+
Now it is our duty (not Bob's) to implement `global_declaration`. It will try
71+
to parse variable definitions, type definitions (only enum is supported) and
72+
function definitions:
7373

7474
```c
7575
int basetype; // the type of a declaration, make it global for convenience

0 commit comments

Comments
 (0)