Simplified subroutine parser.
[Jack-Compiler.git] / ERRORS
blobd0295157a519a080503497490180aa3e989d30c4
1 This is a complete and detailed list of errors for the Jack Compiler.
3 It should provide assistance to the user in the correct and efficient use of the software.
5 The errors are listed in order. Each error entry contains a detailed explanation of the error as well as optional tips for reducing or eliminating its occurrence.
7 1: No Input Files.
8         Compiler does not have a file to compile.
9         Retry command with a filename as an argument.
11 2: Too Many Files Listed.
12         Compiler may only work on one file at a time in this version.
13         Retry command with only one argument.
15 3: Cannot Open Input (Source) File.
16         There are several factors that can cause this error:
17                 A. File does not exist on system.
18                 B. Your account does not have permission to open file.
19                 C. File locked by either the operating system or another program.
21 4: Filename Extension Not Correct.
22         Compiler only accepts file extension "jack".
23         File extension must be in lower case.
25 5: Input File Has No Extension.
26         Input filename does not include a period.
27         Example:  filename.jack
29 6: Cannot Open Output (Object) File.
30         There are several factors that can cause this error:
31                 A. File does not exist on system.
32                 B. Your account does not have permission to open file.
33                 C. File locked by either the operating system or another program.
35 7: Cannot Allocate Memory For Source.
36         Operating system could not allocate enough free memory for source file.
38 8: Incorrect Token Found: Must be 'constructor', 'function', or 'method'.
39         Parser required one of these keywords at this location.
40         Could be caused by missing token or spelling error of token.
41         
42 9: Could Not Complete Parse Tree of Subroutine. Incomplete Program.
43         Parser found beginning of subroutine but could not complete construct
44         before running out of source code.
46 10: Incorrect Token Type. Looking for Keyword or Identifier.
47         Token at this location is of an incorrect type. At this location only a keyword or
48         identifier is allowed.
50 11: Name of Function Must be an Identifier.
51         Token should be the name of this function. At this location another type of
52         token was found.
54 12: Parameter List for Function Missing.
55         Beginning parenthesis for the parameter list is missing from source.
57 13: Could Not Complete Parameter List for Function.
58         Found beginning of parameter list, but could not find the corresponding parenthesis.
60 14: Incorrect Token Type in Parameter List. Looking for Datatype name.
61         Acceptable datatypes are 'int', 'char' and 'boolean'.
63 15: Incorrect Token Type in Parameter List. Looking for Variable Identifier.
64         Proper identifiers must not start with a symbol or a keyword.
66 16: Incorrect Token Type in Parameter List. Looking for Comma or Parenthesis.
68 17: Could Not Complete Variable List of Subroutine. Incomplete Program.
69         Subroutine was started and not completed in source file.
71 18: Incorrect Data Type in Variable Declaration
72         Datatype listed in declaration is not valid. Acceptable datatypes are 'int', 'char',
73         'boolean' and 'Array'.
75 19: Improperly Terminated Variable Declaration