You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ch02/2.3/2.3.md
+11-4Lines changed: 11 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,10 @@
2
2
3
3
### 2.3.1
4
4
5
-
Construct a syntax-directed translation scheme that trans lates arithmetic expressions from infix notation into prefix notation in which an operator appears before its operands; e.g. , -xy is the prefix notation for x - y . Give annotated parse trees for the inputs 9-5+2 and 9-5*2.。
5
+
Construct a syntax-directed translation scheme that translates arithmetic
6
+
expressions from infix notation into prefix notation in which an operator
7
+
appears before its operands; e.g. , -xy is the prefix notation for x - y. Give
8
+
annotated parse trees for the inputs 9-5+2 and 9-5*2.
6
9
7
10
#### answer
8
11
@@ -33,7 +36,9 @@ factor -> digit {print(digit)}
33
36
34
37
### 2.3.2
35
38
36
-
Construct a syntax-directed translation scheme that trans lates arithmetic expressions from postfix notation into infix notation. Give annotated parse trees for the inputs 95-2* and 952*-.
39
+
Construct a syntax-directed translation scheme that translates arithmetic
40
+
expressions from postfix notation into infix notation. Give annotated parse
41
+
trees for the inputs 95-2* and 952*-.
37
42
38
43
#### answer
39
44
@@ -65,7 +70,8 @@ E -> {print("(")} E {print(op)} E {print(")"}} op | digit {print(digit)}
65
70
66
71
### 2.3.3
67
72
68
-
Construct a syntax-directed translation scheme that trans lates integers into roman numerals
73
+
Construct a syntax-directed translation scheme that translates integers into
0 commit comments