From: David Given Date: Tue, 20 Sep 2016 18:44:51 +0000 (+0200) Subject: Import iburg. X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=5cb3fbb3d3576ed257754caa22bf2063fabc728c;p=ack.git Import iburg. --- 5cb3fbb3d3576ed257754caa22bf2063fabc728c diff --cc util/mcgg/README index 000000000,339ca1553..6cffcb058 mode 000000,100644..100644 --- a/util/mcgg/README +++ b/util/mcgg/README @@@ -1,0 -1,58 +1,11 @@@ -iburg -- A Code Generator Generator ++mcgg is very heavily based on the iburg code generator by C. W. Fraser, D. R. ++Hanson and T. A. Proebsting, described in ACM Letters on Prog. Languages and ++Systems 1, 3 (Sep. 1992), 213-226: + -iburg is a code-generator generator that uses dynamic programming at -compile time. It's described in - -C. W. Fraser, D. R. Hanson and T. A. Proebsting, -Engineering a simple, efficient code generator generator, -ACM Letters on Prog. Languages and Systems 1, 3 (Sep. 1992), 213-226. + http://storage.webhop.net/documents/iburg.pdf + -iburg is written in and generates ANSI C and thus must be compiled -with an ANSI C compiler and preprocessor, e.g., gcc or lcc. To compile -iburg, type "make". There should be no warnings or errors (except -perhaps in the system-dependent YACC skeleton). If you need to -customize the makefile, edit custom.mk, which is included in makefile. -The default custom.mk is empty. - -sample.brg is from the paper in burg.ps, sample4.brg is from the paper -in iburg.ps, and sample5.brg is an example from a compilers course. -"make test" runs iburg on sample[45].brg and executes the resulting -programs. The output should be something like: - -% make test -./iburg -I sample4.brg sample4.c; cc -o test4 sample4.c; ./test4 -sample4.c -i = c + 4; -stmt: ASGNI(disp,reg) - disp: ADDRLP - reg: disp - disp: ADDI(reg,con) - reg: CVCI(INDIRC(disp)) - disp: ADDRLP - con: CNSTI -./iburg -I sample5.brg sample5.c; cc -o test5 sample5.c; ./test5 -sample5.c -stm: MOVE(MEM(loc),reg) - loc: NAME - reg: PLUS(MEM(loc),reg) - loc: PLUS(NAME,reg) - reg: MEM(loc) - loc: NAME - reg: con - con: CONST -% - -To install iburg, copy it and its man page to the appropriate local -directories, e.g., on UNIX: - -% cp iburg /usr/local -% cp iburg.1 /usr/local/man/man1 - -"make clobber" removes the executables and all derived files except -gram.c; "make clean" removes just object, core, and sample*.c files. ++For the original source, see the iburg-import branch (this is the version with ++all the mcgg extensions). + -Mail bug reports along with the shortest input that exposes them to -drh@drhanson.net. ++iburg is licensed under the MIT open source license; see the LICENSE file. + -$Id$