/* CM32 prototype file */ static S8 is_alpha(S8 chr); static S8 is_digit(S8 chr); static S8 is_alnum(S8 chr); static void copystring(S8 *dest, S8 *source); static S8 equal_string(S8 *str1, S8 *str2); static S8 skip_blanks(void); static S32 more_parms(void); static void skip_comment(void); static void copy_name(void); static void copy_string(void); static U32 lookup_macro(S8 eflag); static void resolve_macro(void); static U32 match(S8 *ptr); static long compareT(S8 *ptable, long peep); static void exchange(U32 old, S8 *pnew); static char *fgetcode(char *pout, long maxout); static S32 read_line(void); static void write_line(void); static void optimize(void); static S32 readline(void); static U32 test_exit(void); static void t_warn(S8 *msg, S8 *txt); static void t_error(S8 *msg, S8 *txt); static void symbol_error(S8 *msg); static void syntax_error(void); static void type_error(void); static char test_token(U32 token); static void expect(U32 token); static void UTC_error(void); static void line_error(S8 *message); static void fatal_error(S8 *string); static void check_loop(U32 stack[]); static U32 check_switch(void); static void test_jump(U32 label); static void cond_jump(S8 cond, U32 label, S8 ljmp); static U32 get_number(U32 base, U32 digits); static void clean_up(void); static S8 read_char(void); static void unget_token(U32 token); static U32 read_special(S8 delim); static U32 get_token(void); static U32 lookup_local(void); static U32 lookup_global(void); static U32 lookup_member(U32 CrntStruc); static void define_symbol(U32 type, U32 dim_index); static void push(U32 token, U32 value, U32 type, U32 offset); static void pop(U32 *token, U32 *value, U32 *type, U32 *offset); static void get_constant(U32 *token, U32 *value); static void define_var(U32 type); static void check_func(void); static void declare(U32 token, U32 type); static void define_func(U32 type); static void sub_eval(U32 term); static void eval(U32 term, char flag); static void out_inst(S8 *ptr); static void write_oper(U32 token, U32 value, U32 type, U32 offset); static void GenCodeOper(char *ptr, U32 token, U32 value, U32 type, U32 offset); static void StackAcc(void); static void StackTop(void); static void StackIndex(void); static void load_index(U32 t, U32 v, U32 tt, U32 o); static void do_unary(U32 oper); static S8 eval_index(U32 t, U32 v, U32 tp, U32 ofs, U32 *tpRet); static void get_value(void); static U32 combine(U32 type1, U32 type2); static U32 do_oper(U32 token); static void do_lr2op(U32 oper); static U32 CheckStack(U32 token, U32 type); static void accval(U32 oper, U32 rtype, U32 token, U32 value, U32 type, U32 offset); static void test_not(void); static void LoadAcc(U32 token, U32 value, U32 type, U32 offset); static void store(U32 atype, U32 token, U32 value, U32 type, U32 offset); static void LoadSec(U32 token, U32 value, U32 type, U32 offset); static U32 ispStruct(U32 type, U32 value); static U32 isp32(U32 type); static U32 isp16(U32 type); static void do_asm(S8 *ptr); static void out_source(S8 *line); static void init_static(U32 token, U32 value, S8 word); static void end_static(void); static void gen_global(U32 symbol, U32 size); static void gen_extern(U32 symbol); static void gen_extern_DASM (U32 symbol); static void gen_ext_data_DASM (U32 symbol); static void enter_func(U32 symbol, U32 size); static void end_func(U32 stackpop); static void gen_label(U32 label); static void gen_literal(U8 *ptr, U32 size); static void call(U32 token, U32 value, U32 type, U32 offset, U32 clean); static void jump(U32 label, S8 ljmp); static void jump_if(S8 cond, U32 label, S8 ljmp); static void do_switch(U32 label); static void build_switch(U32 d); static void index_ptr(U32 token, U32 value, U32 type, U32 offset); static void index_adr(U32 token, U32 value, U32 type, U32 offset); static void code_global(U32 symbol); static void data_global(U32 symbol); static void code_chr(S8 chr); static void code_str(S8 *ptr); static void code_num(U32 value); static void data_chr(S8 chr); static void data_str(S8 *ptr); static void data_num(U32 value); static void put_num(U32 value, FILE *outfile); static void statement(U32 token); static void begin_data(void); static void begin_code(void); static void compile(void); void main(S32 argc, S8 *argv[]); /* END of PROTOTYPES */