* Reduce the degree-of-reference by one.
* e.g. turn "ptr-to-int" into "int".
error("Illegal indirection");
return((t
>>TYLEN
) & ~TYPE
| t
&TYPE
);
* Increase the degree of reference by
* one; e.g. turn "int" to "ptr-to-int".
return(((t
&~TYPE
)<<TYLEN
) | (t
&TYPE
) | PTR
);
* Make a tree that causes a branch to lbl
* if the tree's value is non-zero together with the cond.
rcexpr(block(1,CBRANCH
,tree
,lbl
,cond
));
outcode("BN", EXPR
, line
);
register struct tnode
*tree
;
outcode("BNN", NAME
, tree
->class, tree
->type
);
outcode("S", tree
->nname
);
outcode("N", tree
->nloc
);
outcode("BNN", tree
->op
, tree
->type
, tree
->value
);
outcode("BNN", tree
->op
, tree
->type
, tree
->tr2
);
outcode("BNN", tree
->op
, tree
->lbl
, tree
->cond
);
if (opdope
[tree
->op
]&BINARY
)
outcode("BN", tree
->op
, tree
->type
);
outcode("BN", BRANCH
, lab
);
* ap is a tree node whose type
* is some kind of pointer; return the size of the object
* to which the pointer points.
register struct tname
*p
;
if (p
==0 || ((t
=p
->type
)&~TYPE
) == 0) /* not a reference */
* return the number of bytes in the object
* whose tree node is acs.
register struct tnode
*cs
;
while ((t
&XTYPE
) == ARRAY
) {
n
= dimtab
[cs
->ssp
&0377];
return(n
* dimtab
[cs
->lenp
&0377]);
error("Compiler error (length)");
* The number of bytes in an object, rounded up to a word.
return((length(cs
)+ALIGN
) & ~ALIGN
);
* After an "if (...) goto", look to see if the transfer
register struct hshtab
*csp
;
if ((peeksym
=symbol())==NAME
&& nextchar()==';') {
if (csp
->hclass
==0 && csp
->htype
==0) {
if ((csp
->hclass
==0||csp
->hclass
==STATIC
)
* Return the next non-white-space character
while (spnextchar()==' ')
* Return the next character, translating all white space
* to blank and handling line-ends.
} else if (c
=='\001') { /* SOH, insert marker */
* is a break or continue legal?
error("Break/continue error");
register struct tnode
*np
;
rcexpr(block(1,JUMP
,0,0,np
));
* The return statement, which has to convert
* the returned object to the function's type.
register struct tnode
*t
;
* write out a character to the usual output
putw(*ap
++ | (0376<<8), bufp
);
error("Botch in outcode");