home *** CD-ROM | disk | FTP | other *** search
- /*
- * 68K/386 32-bit C compiler.
- *
- * copyright (c) 1996, David Lindauer
- *
- * This compiler is intended for educational use. It may not be used
- * for profit without the express written consent of the author.
- *
- * It may be freely redistributed, as long as this notice remains intact
- * and sources are distributed along with any executables derived from them.
- *
- * The author is not responsible for damages, either direct or consequential,
- * that may arise from use of this software.
- *
- * v1.5 August 1996
- * David Lindauer, gclind01@starbase.spd.louisville.edu
- *
- * Credits to Mathew Brandt for original K&R C compiler
- *
- */
- #include <stdio.h>
- #include "expr.h"
- #include "c.h"
- #include "gen.h"
- #include "cglbdec.h"
- #include "list.h"
-
- ENODE *callctr(ENODE *name,char *func,ENODE *pnode,int elms,int size);
- {
- ENODE *pnode,**qnode,*snode,*anode;
- qnode = &pnode;
- while ((*qnode)->nodetype == en_void)
- qnode =&(*qnode)->v.ep2;
- *qnode = makenode(en_void,*qnode,name);
- pnode =makenode(en_cp,pnode,0);
- snode = makenode(en_napccon,func,0);
- pnode = makenode(en_fcall,snode,pnode);
- if (elms > 1) {
- anode = makenode(en_void,makenode(en_icon,(char *)elms,0),makenode(en_icon,(char *)size,0));
- pnode = makenode(en_repeat,anode,pnode);
- }
- return pnode;
- }
- ENODE *calldtr(ENODE *name, char *func)
- {
- ENODE *pnode,*qnode;
- pnode = makenode(en_cp,0,0);
- qnode = makenode(en_napccon,func,0);
- pnode = makenode(en_fcall,qnode,pnode);
- return pnode;
- }
- ENODE *ctrhead(SYM *sp)
- {
- }
- ENODE *dtrtail(SYM *sp)
- {
- }