/* ** open an include file */ doinclude() { blanks(); /* skip over to name */ if((input2=fopen(lptr,"r"))==NULL) { input2=EOF; error("open failure on include file"); } kill(); /* clear rest of line */ /* so new read will come from */ /* new file (if open) */ } /* ** test for global declarations */ dodeclare(class) int class; { if(amatch("char",4)) { declglb(CCHAR, class); ns(); return 1; } else if((amatch("int",3))|(class==EXTERNAL)) { declglb(CINT, class); ns(); return 1; } return 0; } /* ** declare a static variable */ declglb(type, class) int type, class; { int k, j; while(1) { if(endst()) return; /* do line */ if(match("(*")|match("*")) { /*03*/ j=POINTER; k=0; } else { j=VARIABLE; k=1; } if (symname(ssname, YES)==0) illname(); if(findglb(ssname)) multidef(ssname); if(match(")")) ; /*03*/ if(match("()")) j=FUNCTION; else if (match("[")) { k=needsub(); /* get size */ j=ARRAY; /* !0=array */ } if(class==EXTERNAL) external(ssname); else if(j!=FUNCTION) j=initials(type>>2, j, k); /*16*/ addsym(ssname, j, type, k, &glbptr, class); if (match(",")==0) return; /* more? */ } } /* ** declare local variables */ declloc(typ) int typ; { int k,j; if(swactive) error("not allowed in switch"); /*08*/ #ifdef STGOTO if(noloc) error("not allowed with goto"); #endif /* STGOTO */ if(declared < 0) error("must declare first in block"); while(1) { while(1) { if(endst()) return; if(match("*")) j=POINTER; else j=VARIABLE; if (symname(ssname, YES)==0) illname(); /* no multidef check, block-locals are together */ k=BPW; if (match("[")) { if(k=needsub()) { /*25*/ j=ARRAY; if(typ==CINT)k=k<