diff --git a/src/Makefile.in b/src/Makefile.in index 60e69e1afd586128cbaf585ca3a2cec433fc663d..b1f28d70dc77e2f480929e1c2624187f0458db23 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -67,7 +67,7 @@ MAKE_FLAGS = "prefix=$(prefix)" "exex_prefix=$(exex_prefix)" "CC=$(CC)" "OTHERFL # Add alloca.o if you don't have alloca() on your machine. # Add ualarm.o if you don't have ualarm() on your machine. # -OBJ=language.o add_efun.o array.o builtin_efuns.o backend.o \ +OBJ=language.o peep.o add_efun.o array.o builtin_efuns.o backend.o \ call_out.o docode.o dynamic_buffer.o error.o fd_control.o \ fsort.o hashtable.o interpret.o lex.o las.o list.o \ lpc_types.o main.o mapping.o memory.o module.o object.o \ @@ -168,6 +168,10 @@ export: $(SRCDIR)/test/testsuite chmod +x $(SRCDIR)/install-sh $(RUNULPC) $(TMP_BINDIR)/export.lpc +peep_engine.c: peep.in + echo "" >$(SRCDIR)/peep_engine.c + -$(RUNULPC) $(TMP_BINDIR)/mkpeep.lpc $(SRCDIR)/peep.in >$(SRCDIR)/peep_engine.c + # make dependencies (requires compiled uLPC) depend: language.c gcc -MM $(PREFLAGS) *.c $(SRCDIR)/*.c | $(FIXDEP) $(SRCDIR)/Makefile.in @@ -268,6 +272,22 @@ array.o: array.c \ fsort.h \ builtin_efuns.h \ gc.h +backend.o: backend.c \ + global.h machine.h \ + config.h \ + port.h \ + backend.h \ + interpret.h \ + program.h \ + object.h \ + svalue.h \ + error.h \ + call_out.h \ + fd_control.h \ + main.h \ + callback.h \ + array.h las.h \ + dynamic_buffer.h builtin_efuns.o: builtin_efuns.c \ global.h machine.h \ config.h \ @@ -316,23 +336,6 @@ callback.o: callback.c \ svalue.h \ dynamic_buffer.h \ program.h -docode.o: docode.c \ - global.h machine.h \ - config.h \ - port.h las.h \ - svalue.h \ - dynamic_buffer.h \ - program.h language.h \ - lpc_types.h \ - stralloc.h \ - interpret.h \ - add_efun.h \ - hashtable.h \ - array.h \ - macros.h \ - error.h \ - main.h lex.h \ - builtin_efuns.h dynamic_buffer.o: dynamic_buffer.c \ global.h machine.h \ config.h \ @@ -368,7 +371,14 @@ fsort.o: fsort.c \ gc.o: gc.c \ global.h machine.h \ config.h \ - port.h gc.h \ + port.h \ + array.h las.h \ + svalue.h \ + dynamic_buffer.h \ + program.h \ + list.h \ + mapping.h \ + object.h gc.h \ main.h hashtable.o: hashtable.c \ global.h machine.h \ @@ -455,7 +465,8 @@ list.o: list.c \ macros.h \ error.h \ interpret.h \ - builtin_efuns.h + builtin_efuns.h \ + gc.h lpc_signal.o: lpc_signal.c \ global.h machine.h \ config.h \ @@ -520,7 +531,8 @@ mapping.o: mapping.c \ array.h \ macros.h language.h \ error.h \ - interpret.h + interpret.h \ + gc.h memory.o: memory.c \ global.h machine.h \ config.h \ @@ -583,6 +595,12 @@ operators.o: operators.c \ docode.h \ add_efun.h \ hashtable.h +peep.o: peep.c \ + global.h machine.h \ + config.h \ + port.h \ + peep_engine.c +peep_engine.o: peep_engine.c port.o: port.c \ global.h machine.h \ config.h \ diff --git a/src/docode.h b/src/docode.h index 8f87b05b8d3acf2e28f39b1ff45364cbcc71939f..6e3d0de9e8e8591f9a013339e3090fa2bf457397 100644 --- a/src/docode.h +++ b/src/docode.h @@ -14,20 +14,22 @@ extern int store_linenumbers; extern int comp_stackp; extern INT32 comp_stack[COMPILER_STACK_SIZE]; +#define emit(X,Y) insert_opcode((X),(Y),current_line, current_file) +#define emit2(X) insert_opcode2((X),current_line, current_file) + /* Prototypes begin here */ void ins_byte(unsigned char b,int area); void ins_signed_byte(char b,int area); void ins_short(INT16 l,int area); -void ins_long(INT32 l,int area); -void ins_f_byte(unsigned int b); +void ins_int(INT32 l,int area); +void upd_int(int offset, INT32 tmp); +INT32 read_int(int offset); void push_address(); void push_explicit(INT32 address); INT32 pop_address(); -struct jump; -struct jump_list; int do_docode(node *n,INT16 flags); -int docode(node *n); void do_code_block(node *n); +int docode(node *n); /* Prototypes end here */ #endif diff --git a/src/program.h b/src/program.h index b8a8fed9fdd4d7274050be83c7dc76048338f5a1..07edbb8a3cdac3361b2736d2f093525a1c68c7ce 100644 --- a/src/program.h +++ b/src/program.h @@ -170,7 +170,7 @@ int find_identifier(char *name,struct program *prog); int store_prog_string(struct lpc_string *str); int store_constant(struct svalue *foo, int equal); void start_line_numbering(void); -void store_linenumber(void); +void store_linenumber(INT32 current_line, struct lpc_string *current_string); char *get_line(unsigned char *pc,struct program *prog,INT32 *linep); void my_yyerror(char *fmt,...); void compile();