File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ Errors.class: Errors.java
45
45
# clean
46
46
# ##
47
47
clean :
48
- rm -f * ~ * .class parser.java Little.jlex.java sym.java
48
+ rm -f * ~ * .class parser.java Little.jlex.java sym.java * .c
49
49
50
50
# ##
51
51
# run provided parser
58
58
# ##
59
59
run : P3.class
60
60
java -classpath ${CP} P3 test.Little test.c
61
+
62
+ runrun : P3.class
63
+ java -classpath ${CP} P3 test.Little test.c
64
+ java -classpath ${CP} P3 test.c testtest.c
Original file line number Diff line number Diff line change @@ -762,8 +762,10 @@ public PlusPlusNode(IdNode id) {
762
762
763
763
// ** unparse **
764
764
public void unparse (PrintWriter p , int indent ) {
765
+ p .print ("(" );
765
766
myExp .unparse (p , indent );
766
767
p .print ("++" );
768
+ p .print (")" );
767
769
}
768
770
}
769
771
@@ -774,8 +776,10 @@ public MinusMinusNode(IdNode id) {
774
776
775
777
// ** unparse **
776
778
public void unparse (PrintWriter p , int indent ) {
779
+ p .print ("(" );
777
780
myExp .unparse (p , indent );
778
781
p .print ("--" );
782
+ p .print (")" );
779
783
}
780
784
}
781
785
@@ -786,8 +790,10 @@ public UnaryMinusNode(ExpNode exp) {
786
790
787
791
// ** unparse **
788
792
public void unparse (PrintWriter p , int indent ) {
793
+ p .print ("(" );
789
794
p .print ("-" );
790
795
myExp .unparse (p , indent );
796
+ p .print (")" );
791
797
}
792
798
}
793
799
@@ -798,8 +804,10 @@ public NotNode(ExpNode exp) {
798
804
799
805
// ** unparse **
800
806
public void unparse (PrintWriter p , int indent ) {
807
+ p .print ("(" );
801
808
p .print ("!" );
802
809
myExp .unparse (p , indent );
810
+ p .print (")" );
803
811
}
804
812
}
805
813
Original file line number Diff line number Diff line change @@ -47,7 +47,20 @@ double myfunc3() {
47
47
int g;
48
48
49
49
/* nested if statements */
50
- if(1 < 2) {}
50
+ if(1 < 2) {
51
+ while(a < b) {
52
+ int swiss;
53
+ double havarti;
54
+
55
+ if(1 < 2) {
56
+ int d;
57
+ int e;
58
+ }
59
+
60
+ swiss = 10;
61
+ havarti = 0.4 + swiss;
62
+ }
63
+ }
51
64
f = f + a;
52
65
}
53
66
else {
You can’t perform that action at this time.
0 commit comments