16 token_print("class", OPEN
);
20 if(has_more_tokens(pC
) == true)
25 compiler_error(40, "Incomplete Class Declaration", pS
, pC
, pT
);
28 if(strcmp(pT
, "class") == 0 ) {
29 if(settings
.tokens
) { token_print("keyword", BOTH
); }
31 compiler_error(43, "Incorrect Token Found: Must be 'class'", pS
, pC
, pT
);
34 /* look for class name */
35 if(has_more_tokens(pC
) == true)
40 compiler_error(40, "Incomplete Class Declaration", pS
, pC
, pT
);
43 if (tk
== IDENTIFIER
){
44 if(settings
.tokens
) { token_print("identifier", BOTH
); }
46 compiler_error(44, "Could Not Find Class Name or Subroutine Name at This Location", pS
, pC
, pT
);
49 /* look for '{' symbol */
50 if(has_more_tokens(pC
) == true)
55 compiler_error(40, "Incomplete Class Declaration", pS
, pC
, pT
);
60 if(settings
.tokens
) { token_print("symbol", BOTH
); }
62 compiler_error(44, "Could Not Find Class Name or Subroutine Name at This Location", pS
, pC
, pT
);
65 if(has_more_tokens(pC
) == true)
70 compiler_error(40, "Incomplete Class Declaration", pS
, pC
, pT
);
73 while(strcmp(pT
, "static") == 0 || strcmp(pT
, "field") == 0)
75 parse_class_var_dec();
76 if(has_more_tokens(pC
) == true)
81 compiler_error(40, "Incomplete Class Declaration", pS
, pC
, pT
);
85 while(strcmp(pT
, "constructor") == 0 || strcmp(pT
, "function") == 0 || strcmp(pT
, "method") == 0)
88 if(has_more_tokens(pC
) == true)
93 compiler_error(40, "Incomplete Class Declaration", pS
, pC
, pT
);
99 if(settings
.tokens
) { token_print("symbol", BOTH
); }
101 compiler_error(40, "Incomplete Class Declaration", pS
, pC
, pT
);
107 token_print("class", CLOSE
);
111 void parse_class_var_dec()
115 token_print("classVarDec", OPEN
);
119 /* look for 'static' or 'field' */
120 if(settings
.tokens
) { token_print("keyword", BOTH
); }
121 if(has_more_tokens(pC
) == true)
123 pC
= advance(pC
, pT
);
126 compiler_error(40, "Incomplete Class Declaration", pS
, pC
, pT
);
130 if(tk
== IDENTIFIER
) {
131 if(settings
.tokens
) { token_print("identifier", BOTH
); }
132 } else if (tk
== KEYWORD
) {
133 if(strcmp(pT
, "int") == 0 || strcmp(pT
, "char") == 0 || strcmp(pT
, "boolean") == 0) {
134 if(settings
.tokens
) { token_print("keyword", BOTH
); }
136 compiler_error(41, "Token Must be Data Type.", pS
, pC
, pT
);
139 compiler_error(41, "Token Must be Data Type", pS
, pC
, pT
);
142 /* look or variable name */
143 if(has_more_tokens(pC
) == true)
145 pC
= advance(pC
, pT
);
148 compiler_error(40, "Incomplete Class Declaration", pS
, pC
, pT
);
150 if(tk
== IDENTIFIER
) {
151 if(settings
.tokens
) { token_print("identifier", BOTH
); }
153 compiler_error(42, "Token Must be Variable Name", pS
, pC
, pT
);
157 if(has_more_tokens(pC
) == true)
159 pC
= advance(pC
, pT
);
162 compiler_error(40, "Incomplete Class Declaration", pS
, pC
, pT
);
167 if(settings
.tokens
) { token_print("symbol", BOTH
); }
168 if(has_more_tokens(pC
) == true)
170 pC
= advance(pC
, pT
);
173 compiler_error(40, "Incomplete Class Declaration", pS
, pC
, pT
);
175 if(tk
== IDENTIFIER
) {
176 if(settings
.tokens
) { token_print("identifier", BOTH
); }
178 compiler_error(42, "Token Must be Variable Name", pS
, pC
, pT
);
180 if(has_more_tokens(pC
) == true)
182 pC
= advance(pC
, pT
);
185 compiler_error(40, "Incomplete Class Declaration", pS
, pC
, pT
);
187 } while (*pT
== ',');
191 if(settings
.tokens
) { token_print("symbol", BOTH
); }
193 compiler_error(33, "Could Not Find ';' Symbol At This Location", pS
, pC
, pT
);
199 token_print("classVarDec", CLOSE
);
203 void parse_subroutine()
207 token_print("subroutineDec", OPEN
);
212 if(strcmp(pT
, "constructor") == 0 || strcmp(pT
, "function") == 0 || strcmp(pT
, "method") == 0)
214 if(settings
.tokens
) { token_print("keyword", BOTH
); }
216 compiler_error(8, "Incorrect Token Found: Must be 'constructor', 'function', or 'method'", pS
, pC
, pT
);
220 /* look for return type of function */
221 if(has_more_tokens(pC
) == true)
223 pC
= advance(pC
, pT
);
225 if(tk
== KEYWORD
|| tk
== IDENTIFIER
)
227 if(strcmp(pT
, "void") == 0)
229 if(settings
.tokens
) { token_print("keyword", BOTH
); }
231 if(settings
.tokens
) { token_print("identifier", BOTH
); }
234 compiler_error(9, "Could Not Complete Parse Tree of Subroutine. Incomplete Program", pS
, pC
, pT
);
237 compiler_error(29, "Incorrect Token Type", pS
, pC
, pT
);
240 /* look for subroutine name */
241 if(has_more_tokens(pC
) == true)
243 pC
= advance(pC
, pT
);
247 if(settings
.tokens
) { token_print("identifier", BOTH
); }
249 compiler_error(9, "Could Not Complete Parse Tree of Subroutine. Incomplete Program", pS
, pC
, pT
);
252 compiler_error(10, "Incorrect Token Type. Looking for Keyword or Identifier.", pS
, pC
, pT
);
255 /* look for symbol '(' that specifies beginning of parameter list */
256 if(has_more_tokens(pC
) == true)
258 pC
= advance(pC
, pT
);
262 if(settings
.tokens
) { token_print("symbol", BOTH
); }
265 compiler_error(12, "Parameter List for Function Missing", pS
, pC
, pT
);
268 compiler_error(11, "Name of Function Must be an Identifier", pS
, pC
, pT
);
271 /* look for end of parameter list */
276 token_print("symbol", BOTH
);
277 token_print("subroutineBody", OPEN
);
281 compiler_error(13, "Could Not Complete Parameter List for Function", pS
, pC
, pT
);
284 /* look for opening brace for block */
285 if(has_more_tokens(pC
) == true)
287 pC
= advance(pC
, pT
);
291 if(settings
.tokens
) { token_print("symbol", BOTH
); }
292 if(has_more_tokens(pC
) == true)
294 pC
= advance(pC
, pT
);
297 compiler_error(17, "Could Not Complete Variable List of Subroutine. Incomplete Program", pS
, pC
, pT
);
302 compiler_error(9, "Could Not Complete Parse Tree of Subroutine. Incomplete Program", pS
, pC
, pT
);
309 if(settings
.tokens
) { token_print("symbol", BOTH
); }
311 compiler_error(17, "Could Not Complete Subroutine. Incomplete Program", pS
, pC
, pT
);
317 token_print("subroutineBody", CLOSE
);
319 token_print("subroutineDec", CLOSE
);
325 if(*pT
== '(') { if(settings
.tokens
) { token_print("parameterList", OPEN
); space_count
++; } }
327 /* look for datatype in parameter list */
328 if(has_more_tokens(pC
) == true)
330 pC
= advance(pC
, pT
);
333 if(strcmp(pT
, "int") == 0 || strcmp(pT
, "char") == 0 || strcmp(pT
, "boolean") == 0)
335 if(settings
.tokens
) { token_print("keyword", BOTH
); }
337 compiler_error(14, "Incorrect Token Type in Parameter List. Looking for Datatype name.", pS
, pC
, pT
);
339 } else if(tk
== SYMBOL
&& *pT
== ')') {
343 token_print("parameterList", CLOSE
);
348 compiler_error(13, "Could Not Complete Parameter List for Function", pS
, pC
, pT
);
351 /* look for identifier for this parameter */
352 if(has_more_tokens(pC
) == true)
354 pC
= advance(pC
, pT
);
356 if(tk
== IDENTIFIER
) {
357 if(settings
.tokens
) { token_print("identifier", BOTH
); }
359 compiler_error(15, "Incorrect Token Type in Parameter List. Looking for Variable Identifier.", pS
, pC
, pT
);
362 compiler_error(13, "Could Not Complete Parameter List for Function", pS
, pC
, pT
);
365 /* are there more parameters? */
366 if(has_more_tokens(pC
) == true)
368 pC
= advance(pC
, pT
);
371 if(settings
.tokens
) { token_print("symbol", BOTH
); }
373 } else if (*pT
== ')') { /* exit parse_params */
377 token_print("parameterList", CLOSE
);
381 compiler_error(16, "Incorrect Token Type in Parameter List. Looking for ',' or ')'", pS
, pC
, pT
);
384 compiler_error(13, "Could Not Complete Parameter List for Function", pS
, pC
, pT
);
390 /* look for token named 'var' */
391 if(strcmp(pT
, "var") == 0)
395 token_print("varDec", OPEN
);
396 token_print("keyword", BOTH
);
400 /* look for variable data type */
401 if(has_more_tokens(pC
) == true)
403 pC
= advance(pC
, pT
);
405 if(strcmp(pT
, "int") == 0 || strcmp(pT
, "char") == 0 || strcmp(pT
, "boolean") == 0)
407 if(settings
.tokens
) { token_print("keyword", BOTH
); }
409 } else if (tk
== IDENTIFIER
) { /* could also be a custom class name */
410 if(settings
.tokens
) { token_print("identifier", BOTH
); }
412 compiler_error(17, "Could Not Complete Variable List of Subroutine. Incomplete Program", pS
, pC
, pT
);
416 /* look for identifier(s) for variable(s) */
418 if(has_more_tokens(pC
) == true)
420 pC
= advance(pC
, pT
);
423 compiler_error(17, "Could Not Complete Variable List of Subroutine. Incomplete Program", pS
, pC
, pT
);
427 if(settings
.tokens
) { token_print("identifier", BOTH
); }
430 if(has_more_tokens(pC
) == true)
432 pC
= advance(pC
, pT
);
435 compiler_error(17, "Could Not Complete Variable List of Subroutine. Incomplete Program", pS
, pC
, pT
);
439 if(settings
.tokens
) { token_print("symbol", BOTH
); }
441 } while (*pT
== ',');
443 if(has_more_tokens(pC
) == true)
445 pC
= advance(pC
, pT
);
448 compiler_error(17, "Could Not Complete Variable List of Subroutine. Incomplete Program", pS
, pC
, pT
);
450 if(settings
.tokens
) { token_print("varDec", CLOSE
); }
454 void parse_statements()
458 token_print("statements", OPEN
);
462 if(strcmp(pT
, "let") == 0)
465 } else if(strcmp(pT
, "if") == 0)
468 } else if(strcmp(pT
, "while") == 0)
471 } else if(strcmp(pT
, "do") == 0)
474 } else if(strcmp(pT
, "return") == 0)
479 if(has_more_tokens(pC
) == true)
481 pC
= advance(pC
, pT
);
485 } while (strcmp(pT
, "let") == 0 || strcmp(pT
, "if") == 0 || strcmp(pT
, "while") == 0 || \
486 strcmp(pT
, "do") == 0 || strcmp(pT
, "return") == 0 );
490 token_print("statements", CLOSE
);
498 token_print("doStatement", OPEN
);
500 token_print("keyword", BOTH
);
503 if(has_more_tokens(pC
) == true)
505 pC
= advance(pC
, pT
);
508 compiler_error(20, "Could Not Complete Do Statement. Incomplete Program", pS
, pC
, pT
);
511 /* must be an identifier */
512 if(tk
== IDENTIFIER
) {
513 parse_subroutine_call();
515 compiler_error(30, "Subroutine Name Must Be Listed Here", pS
, pC
, pT
);
520 if(settings
.tokens
) { token_print("symbol", BOTH
); }
522 compiler_error(33, "Could Not Find ';' Symbol At This Location.", pS
, pC
, pT
);
528 token_print("doStatement", CLOSE
);
537 token_print("letStatement", OPEN
);
539 token_print("keyword", BOTH
);
542 if(has_more_tokens(pC
) == true)
544 pC
= advance(pC
, pT
);
547 compiler_error(20, "Could Not Complete Let Statement. Incomplete Program", pS
, pC
, pT
);
550 /* look for an identifier - must be a variable name */
553 if(settings
.tokens
) { token_print("identifier", BOTH
); }
555 compiler_error(31, "Could Not Find Identifier At This Location", pS
, pC
, pT
);
558 /* optional '[' for an array offset value */
559 if(has_more_tokens(pC
) == true)
561 pC
= advance(pC
, pT
);
564 compiler_error(20, "Could Not Complete Let Statement. Incomplete Program", pS
, pC
, pT
);
570 if(settings
.tokens
) { token_print("symbol", BOTH
); }
571 if(has_more_tokens(pC
) == true)
573 pC
= advance(pC
, pT
);
576 compiler_error(20, "Could Not Complete Let Statement. Incomplete Program", pS
, pC
, pT
);
581 /* should be closing ']' here if variable was array */
582 if(found_array
&& *pT
== ']')
584 if(settings
.tokens
) { token_print("symbol", BOTH
); }
585 if(has_more_tokens(pC
) == true)
587 pC
= advance(pC
, pT
);
590 compiler_error(20, "Could Not Find ']' Symbol At This Location", pS
, pC
, pT
);
596 if(settings
.tokens
) { token_print("symbol", BOTH
); }
598 compiler_error(32, "Could Not Find '=' Symbol At This Location", pS
, pC
, pT
);
601 if(has_more_tokens(pC
) == true)
603 pC
= advance(pC
, pT
);
606 compiler_error(20, "Could Not Complete Let Statement. Incomplete Program", pS
, pC
, pT
);
613 if(settings
.tokens
) { token_print("symbol", BOTH
); }
615 compiler_error(33, "Could Not Find ';' Symbol At This Location", pS
, pC
, pT
);
621 token_print("letStatement", CLOSE
);
629 token_print("whileStatement", OPEN
);
631 token_print("keyword", BOTH
);
634 if(has_more_tokens(pC
) == true)
636 pC
= advance(pC
, pT
);
639 compiler_error(47, "Could Not Complete While Statement. Incomplete Program", pS
, pC
, pT
);
644 if(settings
.tokens
) { token_print("symbol", BOTH
); }
646 compiler_error(39, "Could Not Find '(' Symbol At This Location", pS
, pC
, pT
);
649 if(has_more_tokens(pC
) == true)
651 pC
= advance(pC
, pT
);
654 compiler_error(47, "Could Not Complete While Statement. Incomplete Program", pS
, pC
, pT
);
661 if(settings
.tokens
) { token_print("symbol", BOTH
); }
663 compiler_error(38, "Could Not Find ')' Symbol At This Location", pS
, pC
, pT
);
666 if(has_more_tokens(pC
) == true)
668 pC
= advance(pC
, pT
);
671 compiler_error(47, "Could Not Complete While Statement. Incomplete Program", pS
, pC
, pT
);
676 if(settings
.tokens
) { token_print("symbol", BOTH
); }
678 compiler_error(45, "Could Not Find '{' Symbol At This Location", pS
, pC
, pT
);
681 if(has_more_tokens(pC
) == true)
683 pC
= advance(pC
, pT
);
686 compiler_error(47, "Could Not Complete While Statement. Incomplete Program", pS
, pC
, pT
);
693 if(settings
.tokens
) { token_print("symbol", BOTH
); }
695 compiler_error(46, "Could Not Find '}' Symbol At This Location", pS
, pC
, pT
);
701 token_print("whileStatement", CLOSE
);
709 token_print("returnStatement", OPEN
);
711 token_print("keyword", BOTH
);
715 if(has_more_tokens(pC
) == true)
717 pC
= advance(pC
, pT
);
720 compiler_error(20, "Could Not Complete Let Statement. Incomplete Program", pS
, pC
, pT
);
723 if (*pT
!= ';') { parse_expression(0); }
727 if(settings
.tokens
) { token_print("symbol", BOTH
); }
729 compiler_error(33, "Could Not Find ';' Symbol At This Location", pS
, pC
, pT
);
734 token_print("returnStatement", CLOSE
);
744 token_print("ifStatement", OPEN
);
746 token_print("keyword", BOTH
);
749 if(has_more_tokens(pC
) == true)
751 pC
= advance(pC
, pT
);
754 compiler_error(47, "Could Not Complete If Statement. Incomplete Program", pS
, pC
, pT
);
759 if(settings
.tokens
) { token_print("symbol", BOTH
); }
761 compiler_error(39, "Could Not Find '(' Symbol At This Location", pS
, pC
, pT
);
764 if(has_more_tokens(pC
) == true)
766 pC
= advance(pC
, pT
);
769 compiler_error(47, "Could Not Complete If Statement. Incomplete Program", pS
, pC
, pT
);
776 if(settings
.tokens
) { token_print("symbol", BOTH
); }
778 compiler_error(38, "Could Not Find ')' Symbol At This Location", pS
, pC
, pT
);
781 if(has_more_tokens(pC
) == true)
783 pC
= advance(pC
, pT
);
786 compiler_error(47, "Could Not Complete If Statement. Incomplete Program", pS
, pC
, pT
);
791 if(settings
.tokens
) { token_print("symbol", BOTH
); }
793 compiler_error(45, "Could Not Find '{' Symbol At This Location", pS
, pC
, pT
);
796 if(has_more_tokens(pC
) == true)
798 pC
= advance(pC
, pT
);
801 compiler_error(47, "Could Not Complete If Statement. Incomplete Program", pS
, pC
, pT
);
808 pTemp
= pC
; /* store pointer to where we are - in case no 'else' clause exists */
809 if(settings
.tokens
) { token_print("symbol", BOTH
); }
811 compiler_error(46, "Could Not Find '}' Symbol At This Location", pS
, pC
, pT
);
814 /* Look forward and see if 'else' clause is there*/
815 if(has_more_tokens(pC
) == true)
817 pC
= advance(pC
, pT
);
820 compiler_error(47, "Could Not Complete If Statement. Incomplete Program", pS
, pC
, pT
);
823 if(strcmp(pT
, "else") == 0)
825 if(settings
.tokens
) { token_print("keyword", BOTH
); };
827 if(has_more_tokens(pC
) == true)
829 pC
= advance(pC
, pT
);
832 compiler_error(47, "Could Not Complete If Statement. Incomplete Program", pS
, pC
, pT
);
837 if(settings
.tokens
) { token_print("symbol", BOTH
); }
839 compiler_error(45, "Could Not Find '{' Symbol At This Location", pS
, pC
, pT
);
846 if(settings
.tokens
) { token_print("symbol", BOTH
); }
848 compiler_error(46, "Could Not Find '}' Symbol At This Location", pS
, pC
, pT
);
851 pC
= pTemp
-1; /* rewind back to end of 'if' statement */
852 if(has_more_tokens(pC
) == true)
854 pC
= advance(pC
, pT
);
857 compiler_error(47, "Could Not Complete If Statement. Incomplete Program", pS
, pC
, pT
);
864 token_print("ifStatement", CLOSE
);
868 void parse_expression(int count
)
870 if(settings
.tokens
&& count
== 0)
872 token_print("expression", OPEN
);
878 if(strchr(BINARY_OP
, *pT
) != NULL
)
880 if(settings
.tokens
) { token_print("symbol", BOTH
); }
881 if(has_more_tokens(pC
) == true)
883 pC
= advance(pC
, pT
);
886 compiler_error(34, "Could Not Parse Expression. Incomplete Program", pS
, pC
, pT
);
888 parse_expression(count
);
890 if(settings
.tokens
&& count
== 1)
893 token_print("expression", CLOSE
);
901 token_print("term", OPEN
);
907 if(settings
.tokens
) { token_print("integerConstant", BOTH
); }
908 if(has_more_tokens(pC
) == true)
910 pC
= advance(pC
, pT
);
913 compiler_error(25, "Could Not Complete Term. Incomplete Program", pS
, pC
, pT
);
919 token_print("term", CLOSE
);
924 if(strchr(UNARY_OP
, *pT
) != NULL
)
926 if(settings
.tokens
) { token_print("unaryOperator", BOTH
); }
927 if(has_more_tokens(pC
) == true)
929 pC
= advance(pC
, pT
);
932 compiler_error(25, "Could Not Complete Term. Incomplete Program", pS
, pC
, pT
);
939 if(settings
.tokens
) { token_print("keyword", BOTH
); }
941 if(has_more_tokens(pC
) == true)
943 pC
= advance(pC
, pT
);
946 compiler_error(25, "Could Not Complete Term. Incomplete Program", pS
, pC
, pT
);
952 if(settings
.tokens
) { token_print("identifier", BOTH
); }
954 if(has_more_tokens(pC
) == true)
956 pC
= advance(pC
, pT
);
959 compiler_error(25, "Could Not Complete Term. Incomplete Program", pS
, pC
, pT
);
966 if(settings
.tokens
) { token_print("symbol", BOTH
); }
968 if(has_more_tokens(pC
) == true)
970 pC
= advance(pC
, pT
);
973 compiler_error(25, "Could Not Complete Term. Incomplete Program", pS
, pC
, pT
);
978 if(settings
.tokens
) { token_print("symbol", BOTH
); }
979 /* parse_expression(0); */
981 compiler_error(26, "Improperly Terminated Array Expression. Symbol ']' Required at this Location.", pS
, pC
, pT
);
984 if(has_more_tokens(pC
) == true)
986 pC
= advance(pC
, pT
);
989 compiler_error(25, "Could Not Complete Term. Incomplete Program", pS
, pC
, pT
);
993 if(settings
.tokens
) { token_print("symbol", BOTH
); }
995 if(has_more_tokens(pC
) == true)
997 pC
= advance(pC
, pT
);
1000 compiler_error(25, "Could Not Complete Term. Incomplete Program", pS
, pC
, pT
);
1003 parse_expression(0);
1006 if(settings
.tokens
) { token_print("symbol", BOTH
); }
1008 compiler_error(38, "Could Not Find Symbol ')' At This Location", pS
, pC
, pT
);
1011 if(has_more_tokens(pC
) == true)
1013 pC
= advance(pC
, pT
);
1014 tk
= token_type(pT
);
1016 compiler_error(25, "Could Not Complete Term. Incomplete Program", pS
, pC
, pT
);
1020 if(settings
.tokens
) { token_print("symbol", BOTH
); }
1022 if(has_more_tokens(pC
) == true)
1024 pC
= advance(pC
, pT
);
1025 tk
= token_type(pT
);
1027 compiler_error(25, "Could Not Complete Term. Incomplete Program", pS
, pC
, pT
);
1030 parse_subroutine_call();
1037 token_print("term", CLOSE
);
1041 void parse_subroutine_call()
1043 if(tk
== IDENTIFIER
)
1045 if(settings
.tokens
) { token_print("identifier", BOTH
); }
1047 compiler_error(35, "Could Not Find Class Name or Subroutine Name at This Location", pS
, pC
, pT
);
1050 if(has_more_tokens(pC
) == true)
1052 pC
= advance(pC
, pT
);
1053 tk
= token_type(pT
);
1055 compiler_error(36, "Could Not Complete Subroutine Call. Incomplete Program", pS
, pC
, pT
);
1059 if(settings
.tokens
) { token_print("symbol", BOTH
); }
1060 if(has_more_tokens(pC
) == true)
1062 pC
= advance(pC
, pT
);
1063 tk
= token_type(pT
);
1065 compiler_error(36, "Could Not Complete Subroutine Call. Incomplete Program", pS
, pC
, pT
);
1067 if(tk
== IDENTIFIER
)
1069 if(settings
.tokens
) { token_print("identifier", BOTH
); }
1071 compiler_error(37, "Could Not Find Method Name or Subroutine Name at This Location", pS
, pC
, pT
);
1075 if(*pT
!= '(') /* this for calls with no class name at beginning */
1077 if(has_more_tokens(pC
) == true)
1079 pC
= advance(pC
, pT
);
1080 tk
= token_type(pT
);
1082 compiler_error(36, "Could Not Complete Subroutine Call. Incomplete Program", pS
, pC
, pT
);
1088 if(settings
.tokens
) { token_print("symbol", BOTH
); }
1090 compiler_error(39, "Could Not Find Symbol '(' At This Location", pS
, pC
, pT
);
1093 if(has_more_tokens(pC
) == true)
1095 pC
= advance(pC
, pT
);
1096 tk
= token_type(pT
);
1098 compiler_error(36, "Could Not Complete Subroutine Call. Incomplete Program", pS
, pC
, pT
);
1105 if(settings
.tokens
) { token_print("symbol", BOTH
); }
1107 compiler_error(38, "Could Not Find Symbol ')' At This Location", pS
, pC
, pT
);
1110 if(has_more_tokens(pC
) == true)
1112 pC
= advance(pC
, pT
);
1113 tk
= token_type(pT
);
1115 compiler_error(24, "Could Not Complete Subroutine Call. Incomplete Program", pS
, pC
, pT
);
1119 void parse_expr_lst()
1121 if(settings
.tokens
) { token_print("expressionList", OPEN
); }
1126 if(settings
.tokens
) { token_print("symbol", BOTH
); }
1127 if(has_more_tokens(pC
) == true)
1129 pC
= advance(pC
, pT
);
1130 tk
= token_type(pT
);
1132 compiler_error(24, "Could Not Complete Expression List. Incomplete Program", pS
, pC
, pT
);
1135 parse_expression(0);
1138 if(settings
.tokens
) { token_print("expressionList", CLOSE
); }