2 #define MAXINBUFF 250000
5 #define pInBuff *(InBuff+i)
9 * value is either a non-negative decimal numer of a symbol referring to such a number
11 * C_COMMAND: dest = comp; jump
12 * either of the dest or jump fields may be empty
13 * if dest is empty, the "=" is omitted
14 * if jump is emprty, the ";" is omitted
23 * Resets command pointer to beginning of input buffer.
27 void init_parser(char *FilenameBuff
);
30 * Finds current line number of source file.
31 * This is done for the convenience of the user.
36 * Search current command for term.
37 * Ignores whitespace. Looks for one char only.
39 int search_command(const char *current_command
, const char term
);
42 * Print chars of current command to stdout.
44 void print_current_command();
47 * Confirms the existance of more commands in the input
49 int has_more_commands();
52 * Read next command from input and makes it the current command
53 * Should be called only if has_more_commands() is true
54 * Initialy there is no current command
59 * Returns type of current command
60 * See Commands comment for more info
65 * Returns symbol or decimal of current command
66 * Should be called only when command_type() is A_COMMAND or L_COMMAND
71 * Reads command and finds symbol chars. Loads into hash
76 * Returns the dest mnemonic in the current C_COMMAND
77 * Should be called only when command_type() is C_COMMAND
79 int dest(char dest
[]);
82 * Returns comp mnemonic in the current C_COMMAND
83 * Called only when command_type() is C_COMMAND
85 int comp(char comp
[]);
88 * Returns the jump mnemonic in the current C_COMMAND
89 * Called only when command_type() is C_COMMAND
91 int jump(char jump
[]);