File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Assignment2/src/com/company Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ public static ParseTree parse(List<Token> tokens) throws SyntaxException {
106106 put ("ID" ,2 );
107107 put ("}}" ,3 );
108108 put (";" ,2 );
109+ put ("while" ,2 ); // +
109110 put ("}" ,3 );
110111 put ("for" ,2 );
111112 put ("if" ,2 );
@@ -155,6 +156,7 @@ public static ParseTree parse(List<Token> tokens) throws SyntaxException {
155156 put ("}}" ,20 );
156157 put (";" ,20 );
157158 put ("while" ,20 );
159+ put ("}" ,20 ); // +
158160 put ("for" ,20 );
159161 put ("if" ,20 );
160162 put ("else" ,19 );
@@ -169,7 +171,7 @@ public static ParseTree parse(List<Token> tokens) throws SyntaxException {
169171 }});
170172 parseTable .put ("Possif" , new HashMap <String , Integer >() {{
171173 put ("{" ,23 );
172- put ("for " ,22 );
174+ put ("if " ,22 ); // for -> if
173175 put ("" ,23 );
174176 }});
175177 parseTable .put ("Assign" , new HashMap <String , Integer >() {{
You can’t perform that action at this time.
0 commit comments