else { /* read ahead and return the old one */
#ifdef LINT
lint_comment_ahead();
-#endif LINT
+#endif /* LINT */
dot = ahead;
/* the following test is performed due to the dual
task of LLlex(): it is also called for parsing the
ptok->tk_fund = INT;
return ptok->tk_symb = INTEGER;
}
-#endif NOPP
+#endif /* NOPP */
ptok->tk_symb = (
idef->id_reserved
? idef->id_reserved
#ifdef LINT
lint_start_comment();
lint_comment_char(c);
-#endif LINT
+#endif /* LINT */
do {
while (c != '*') {
if (class(c) == STNL) {
NoUnstack--;
#ifdef LINT
lint_end_comment();
-#endif LINT
+#endif /* LINT */
return;
}
oldc = c;
c = GetChar();
#ifdef LINT
lint_comment_char(c);
-#endif LINT
+#endif /* LINT */
} /* last Character seen was '*' */
c = GetChar();
if ( c != '/' && oldc == '/')
oldc = '*';
#ifdef LINT
lint_comment_char(c);
-#endif LINT
+#endif /* LINT */
} while (c != '/');
#ifdef LINT
lint_end_comment();
-#endif LINT
+#endif /* LINT */
NoUnstack--;
}
#endif /* NOPP */
extern int AccDefined; /* "LLlex.c" */
extern int Unstacked; /* "LLlex.c" */
extern int UnknownIdIsZero; /* "LLlex.c" */
-#endif NOPP
+#endif /* NOPP */
extern int EoiForNewline; /* "LLlex.c" */
extern int AccFileSpecifier; /* "LLlex.c" */
extern int File_Inserted; /* "LLlex.c" */
echo '#ifndef lint' > Version.c
echo 'char Version[] = "ACK ANSI C compiler Version XXX";' | \
sed "s/XXX/`RC -i`/" >> Version.c
- echo '#endif lint' >> Version.c
+ echo '#endif' >> Version.c
float_align, double_align, lngdbl_align,
pointer_align,
struct_align, union_align;
-#else NOCROSS
+#else /* NOCROSS */
#define short_align ((int)AL_SHORT)
#define word_align ((int)AL_WORD)
#define int_align ((int)AL_INT)
#define pointer_align ((int)AL_POINTER)
#define struct_align ((int)AL_STRUCT)
#define union_align ((int)AL_UNION)
-#endif NOCROSS
+#endif /* NOCROSS */
extern arith align();
want to keep enums and ints separate
*/
int2int(expp, int_type);
-#endif LINT
+#endif /* LINT */
break;
case FLOAT:
/* only when it is a parameter and the default promotion should
case FIELD:
field2arith(expp);
break;
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
default:
expr_error(*expp, "operator %s on non-numerical operand (%s)",
symbol2str(oper), symbol2str(fund));
else
if (fund == FIELD)
field2arith(expp);
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
switch (fund = (*expp)->ex_type->tp_fund) {
case CHAR:
case SHORT:
case FIELD:
field2arith(expp);
break;
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
}
}
ch3bin(expp, RIGHT, intexpr(other_bits, INT));
}
}
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
/* switch_sign_fp() negates the given floating constant expression,
* and frees the string representing the old value.
#include <em_arith.h> /* obtain definition of "arith" */
-#else SPECIAL_ARITHMETICS
+#else /* SPECIAL_ARITHMETICS */
/* All preprocessor arithmetic should be done in longs.
*/
#define arith long /* dummy */
-#endif SPECIAL_ARITHMETICS
+#endif /* SPECIAL_ARITHMETICS */
#define arith_size (sizeof(arith))
#define arith_sign ((arith) 1 << (arith_size * 8 - 1))
#else
#define ASSERT(exp)
#define NOTREACHED()
-#endif DEBUG
+#endif /* DEBUG */
extern arith NewLocal();
#define LocalPtrVar() NewLocal(pointer_size, pointer_align, reg_pointer, REGISTER)
#define LocalIntVar() NewLocal(int_size, int_align, reg_any, REGISTER)
-#endif STB
+#endif /* STB */
/* Because EM does not support the loading and storing of
objects having other sizes than word fragment and multiple,
C_asp(ATW(sz));
FreeLocal(dst);
FreeLocal(src);
-#else STB
+#else /* STB */
/* address of destination lies on the stack */
/* push address of first byte of block on stack onto
C_loc(sz); /* number of bytes to transfer */
C_cal("__stb"); /* call transfer routine */
C_asp(pointer_size + pointer_size + int_size + ATW(sz));
-#endif STB
+#endif /* STB */
}
}
copy_loop(sz, src, dst);
FreeLocal(dst);
FreeLocal(src);
-#else STB
+#else /* STB */
arith esz = ATW(sz) - pointer_size;
C_asp(-esz); /* allocate stack block */
C_lor((arith)1); /* push & of stack block as dst */
C_loc(sz); /* # bytes to copy */
C_cal("__stb"); /* library copy routine */
C_asp(int_size + pointer_size + pointer_size);
-#endif STB
+#endif /* STB */
}
}
copy_loop(sz, src, dst);
FreeLocal(dst);
FreeLocal(src);
-#else STB
+#else /* STB */
C_loc(sz); /* # bytes to copy */
C_cal("__stb"); /* library copy routine */
C_asp(int_size + pointer_size + pointer_size);
-#endif STB
+#endif /* STB */
}
}
C_df_ilb(l_stop);
FreeLocal(tmp_sz);
}
-#endif STB
+#endif /* STB */
-#endif LINT
+#endif /* LINT */
ch3cast(expp, oper, tp->tp_up);
return;
}
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
switch (oper) {
default: qual_lev = -1; break;
case CAST: qual_lev = -999; break; /* ??? hack */
else {
int2int(expp, tp);
}
-#else LINT
+#else /* LINT */
int2int(expp, tp);
-#endif LINT
+#endif /* LINT */
}
else
if (oldi && !i) {
else {
int2float(expp, tp);
}
-#else LINT
+#else /* LINT */
int2float(expp, tp);
-#endif LINT
+#endif /* LINT */
}
else
if (!oldi && i) {
else {
float2int(expp, tp);
}
-#else LINT
+#else /* LINT */
float2int(expp, tp);
-#endif LINT
+#endif /* LINT */
}
else {
/* !oldi && !i */
else {
float2float(expp, tp);
}
-#else LINT
+#else /* LINT */
float2float(expp, tp);
-#endif LINT
+#endif /* LINT */
}
}
else
#ifdef LINT
if (oper != CAST)
lint_ptr_conv(oldtp->tp_up->tp_fund, tp->tp_up->tp_fund);
-#endif LINT
+#endif /* LINT */
exp->ex_type = tp; /* free conversion */
}
else
#ifndef NOBITFIELD
exp = new_oper(fund == FIELD ? exp->ex_type->tp_up : exp->ex_type,
exp, oper, expr);
-#else NOBITFIELD
+#else /* NOBITFIELD */
exp = new_oper(exp->ex_type, exp, oper, expr);
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
exp->OP_TYPE = tp; /* for EVAL() */
exp->ex_flags |= EX_SIDEEFFECTS;
*expp = exp;
#ifndef NOBITFIELD
case FIELD:
return is_integral_type(tp->tp_up);
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
default:
return 0;
}
#ifndef NOBITFIELD
case FIELD:
return is_arith_type(tp->tp_up);
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
default:
return 0;
}
) {
hwarning("operands of : are constant and equal");
}
-#endif LINT
+#endif /* LINT */
*expp = new_oper((*expp)->ex_type, *expp, oper, expr);
break;
if (is_cp_cst(*expp)) {
#ifdef LINT
hwarning("condition in ?: expression is constant");
-#endif LINT
+#endif /* LINT */
*expp = (*expp)->VL_VALUE ?
expr->OP_LEFT : expr->OP_RIGHT;
(*expp)->ex_flags |= EX_ILVALUE;
if (is_cp_cst(*expp)) {
#ifdef LINT
hwarning("constant expression ignored");
-#endif LINT
+#endif /* LINT */
*expp = expr;
}
else {
if ((*expp)->ex_type->tp_fund == FIELD)
expr_error(*expp, "& applied to field variable");
else
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
if (!(*expp)->ex_lvalue)
expr_error(*expp, "& applied to non-lvalue");
else if ((*expp)->ex_flags & EX_ILVALUE)
#else
#include "l_em.h"
#include "l_lint.h"
-#endif LINT
+#endif /* LINT */
#include "botch_free.h"
#include <alloc.h>
#include "dataflow.h"
#include "LLlex.h"
#ifdef LINT
#include "l_lint.h"
-#endif LINT
+#endif /* LINT */
#ifdef DBSYMTAB
#include <stb.h>
#endif /* DBSYMTAB */
#ifdef USE_TMP
static int tmp_id;
static int pro_id;
-#endif USE_TMP
+#endif /* USE_TMP */
extern char options[];
extern char *symbol2str();
#ifdef USE_TMP
#ifdef PREPEND_SCOPES
C_insertpart(tmp_id = C_getid());
-#endif PREPEND_SCOPES
-#endif USE_TMP
+#endif /* PREPEND_SCOPES */
+#endif /* USE_TMP */
}
-#endif LINT
+#endif /* LINT */
struct string_cst *str_list = 0;
C_ms_src((int)(LineNumber - 2), FileName);
C_close();
}
-#endif LINT
+#endif /* LINT */
#ifdef PREPEND_SCOPES
prepend_scopes()
#ifdef USE_TMP
C_beginpart(tmp_id);
-#endif USE_TMP
+#endif /* USE_TMP */
while (se != 0) {
register struct def *df = se->se_idf->id_def;
}
#ifdef USE_TMP
C_endpart(tmp_id);
-#endif USE_TMP
+#endif /* USE_TMP */
}
-#endif PREPEND_SCOPES
+#endif /* PREPEND_SCOPES */
code_scope(text, def)
char *text;
}
#ifndef PREPEND_SCOPES
code_scope(name, def);
-#endif PREPEND_SCOPES
+#endif /* PREPEND_SCOPES */
#ifdef DATAFLOW
if (options['d'])
DfaStartFunction(name);
-#endif DATAFLOW
+#endif /* DATAFLOW */
/* set global function info */
#ifdef DATAFLOW
if (options['d'])
DfaEndFunction();
-#endif DATAFLOW
+#endif /* DATAFLOW */
C_df_ilb(return2_label);
if (return_expr_occurred && func_res_label == 0) {
C_asp(-func_size);
if (expr) { /* code only if initialized */
#ifndef PREPEND_SCOPES
code_scope(idf->id_text, def);
-#endif PREPEND_SCOPES
+#endif /* PREPEND_SCOPES */
def->df_alloc = ALLOC_DONE;
C_df_dnam(idf->id_text);
}
vl.vl_value = (arith)0;
store_val(&vl, tp);
}
-#else LINT
+#else /* LINT */
id->id_def->df_set = 1;
-#endif LINT
+#endif /* LINT */
free_expression(expr);
}
}
#ifndef PREPEND_SCOPES
code_scope(idf->id_text, df);
-#endif PREPEND_SCOPES
+#endif /* PREPEND_SCOPES */
#ifdef DBSYMTAB
if (options['g']) {
stb_string(df, df->df_sc, idf->id_text);
LoadLocal(df->df_address, double_size);
#ifndef LINT
conversion(double_type, float_type);
-#endif LINT
+#endif /* LINT */
StoreLocal(df->df_address, tp->tp_size);
}
}
#ifdef LINT
/*ARGSUSED*/
-#endif LINT
+#endif /* LINT */
code_expr(expr, val, code, tlbl, flbl)
struct expr *expr;
label tlbl, flbl;
if (options['g']) db_line(expr->ex_file, (unsigned int)expr->ex_line);
#endif
EVAL(expr, val, code, tlbl, flbl);
-#else LINT
+#else /* LINT */
lint_expr(expr, code ? USED : IGNORED);
-#endif LINT
+#endif /* LINT */
}
/* The FOR/WHILE/DO/SWITCH stacking mechanism:
return 0;
}
-#endif LINT
+#endif /* LINT */
print("DFA: %s: %s\n", CurrentFunction, s);
++NumberOfCalls;
}
-#endif DATAFLOW
+#endif /* DATAFLOW */
#include "level.h"
#ifdef LINT
#include "l_lint.h"
-#endif LINT
+#endif /* LINT */
extern char options[];
}
declare_idf(ds, &Dc, level);
#ifdef LINT
lint_declare_idf(Dc.dc_idf, ds->ds_sc);
-#endif LINT
+#endif /* LINT */
}
[
initializer(Dc.dc_idf, ds->ds_sc)
{
#ifdef LINT
add_auto(Dc.dc_idf);
-#endif LINT
+#endif /* LINT */
remove_declarator(&Dc);
}
;
if (AHEAD != '{' && AHEAD != STRING ) autoagg = 0;
#ifdef LINT
lint_statement();
-#endif LINT
+#endif /* LINT */
if (globalflag) {
struct expr ex;
code_declaration(idf, &ex, level, sc);
}
#ifdef DEBUG
print_expr("initializer-expression", expr);
-#endif DEBUG
+#endif /* DEBUG */
#ifdef LINT
change_state(idf, SET);
-#endif LINT
+#endif /* LINT */
#ifdef DBSYMTAB
if (options['g'] && level >= L_LOCAL && expr) {
db_line(expr->ex_file, (unsigned) expr->ex_line);
free_expression(expr);
#ifdef NOBITFIELD
error("bitfields are not implemented");
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
}
;
char df_set;
int df_firstbrace; /* brace number of its first occurrence */
int df_minlevel; /* the lowest level needed for this def */
-#endif LINT
+#endif /* LINT */
arith df_address;
};
return (*s == '\0') && (*t == '\0');
}
}
-#else NOPP
+#else /* NOPP */
struct idf *
GetIdentifier(skiponerr)
EoiForNewline = 0;
SkipToNewLine();
}
-#endif NOPP
+#endif /* NOPP */
do_line(l)
}
print(" macro");
}
-#endif NOPP
+#endif /* NOPP */
if ((opt&2) && idf->id_reserved) {
if (!started++) {
newline();
print("L%d: ", sdef->sd_level);
#ifndef NOBITFIELD
if (sdk == selector)
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
print("selector %s at offset %lu in %s;",
type2str(sdef->sd_type),
sdef->sd_offset, type2str(sdef->sd_stype)
else print("field %s at offset %lu;",
type2str(sdef->sd_type), sdef->sd_offset
);
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
sdef = (sdk == selector ? sdef->next : sdef->sd_sdef);
}
dumplevel--;
fd->fd_shift, fd->fd_width);
}
else
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
ops = 0;
break;
}
fd->fd_shift, fd->fd_width);
}
else
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
ops = 0;
break;
}
while (lvl--)
print(" ");
}
-#endif DEBUG
+#endif /* DEBUG */
#include <em.h>
#else
#include "l_em.h"
-#endif LINT
+#endif /* LINT */
#include "debug.h"
#include "lint.h"
extern char options[];
#ifdef LINT
extern char loptions[];
-#endif LINT
+#endif /* LINT */
/* There are three general error-message functions:
lexerror() lexical and pre-processor error messages
}
va_end(ap);
}
-#endif DEBUG
+#endif /* DEBUG */
/*VARARGS*/
warning(va_alist)
va_end(ap);
}
-#endif LINT
+#endif /* LINT */
/*VARARGS*/
lexerror(va_alist) /* fmt, args */
C_close();
#ifdef DEBUG
sys_stop(S_ABORT);
-#else DEBUG
+#else /* DEBUG */
sys_stop(S_EXIT);
-#endif DEBUG
+#endif /* DEBUG */
/* NOTREACHED */
}
case WARNING:
#ifndef LINT
remark = "(warning)";
-#else LINT
+#else /* LINT */
remark = 0;
-#endif LINT
+#endif /* LINT */
break;
case ERROR:
case DO_DEBUG:
remark = "(debug)";
break;
-#endif DEBUG
+#endif /* DEBUG */
default:
/*NOTREACHED*/;
}
/* we skip this message */
return;
}
-#endif LINT
+#endif /* LINT */
if (fn)
fprint(ERROUT, "\"%s\", line %u: ", fn, ln);
eval_field(expr, gencode);
break;
}
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
if (is_struct_or_union(tp->tp_fund) && ! gencode) {
EVAL(right, LVAL, TRUE, NO_LABEL, NO_LABEL);
EVAL(left, LVAL, TRUE, NO_LABEL, NO_LABEL);
eval_field(expr, gencode);
break;
}
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
if (left->ex_class == Value) {
compl = 0; /* Value */
}
DfaCallFunction(
left->VL_IDF->id_text);
}
-#endif DATAFLOW
+#endif /* DATAFLOW */
}
else {
EVAL(left, LVAL, TRUE, NO_LABEL, NO_LABEL);
EVAL(expr->OP_LEFT, RVAL, gencode, NO_LABEL, NO_LABEL);
EVAL(expr->OP_RIGHT, RVAL, gencode, NO_LABEL, NO_LABEL);
}
-#endif LINT
+#endif /* LINT */
def->df_used = 1;
}
}
-#endif LINT
+#endif /* LINT */
expr->ex_type = def->df_type;
if (expr->ex_type == error_type) {
expr->ex_flags |= EX_ERROR;
expr->VL_LBL = def->df_address;
expr->VL_VALUE = (arith)0;
}
-#endif LINT
+#endif /* LINT */
else {
expr->VL_CLASS = Name;
expr->VL_IDF = idf;
op->op_right = e2;
#ifdef LINT
lint_new_oper(expr);
-#endif LINT
+#endif /* LINT */
return expr;
}
#ifdef DEBUG
print_expr("constant_expression", expr);
-#endif DEBUG
+#endif /* DEBUG */
switch(expr->ex_type->tp_fund) {
case CHAR:
case SHORT:
#ifdef LINT
if (expr->ex_class == String)
return 1;
-#endif LINT
+#endif /* LINT */
return expr->ex_lvalue == 0 && expr->ex_class == Value;
}
FreeLocal(tmpvar);
}
}
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
-#endif LINT
+#endif /* LINT */
#ifdef LINT
check_hiding(idf, lvl, sc); /* of some idf by this idf */
-#endif LINT
+#endif /* LINT */
if (def && lvl == L_LOCAL && def->df_level == L_FORMAL2) {
error("%s redeclared", idf->id_text);
}
#ifdef LINT
newdef->df_set = 0;
newdef->df_firstbrace = 0;
-#endif LINT
+#endif /* LINT */
/* link it into the name list in the proper place */
idf->id_def = newdef;
update_ahead(idf);
#ifdef DEBUG
if (options['t'])
dumpidftab("start declare_formals", 0);
-#endif DEBUG
+#endif /* DEBUG */
while (se) {
register struct def *def = se->se_idf->id_def;
#ifndef NOPP
struct macro *idd_macro;
int idd_resmac; /* if nonzero: keyword of macroproc. */
-#endif NOPP
+#endif /* NOPP */
int idd_reserved; /* non-zero for reserved words */
char *idd_file; /* file containing the occurrence */
unsigned int idd_line; /* line number of the occurrence */
/* defined(??) */
macro_def(str2idf("defined", 0), "", 1, 1, NOUNDEF | FUNC);
}
-#endif NOPP
+#endif /* NOPP */
int InputLevel;
extern int nestlevel;
-#endif NOPP
+#endif /* NOPP */
int NoUnstack;
#ifndef NOPP
InputLevel--;
unstackrepl();
-#endif NOPP
+#endif /* NOPP */
return 0;
}
#ifndef NOPP
if (nestlevel != nestlow) lexwarning("missing #endif");
else
-#endif NOPP
+#endif /* NOPP */
if (NoUnstack) lexerror("unexpected EOF");
#ifndef NOPP
nestlevel = nestlow;
#else
#include "l_em.h"
#include "l_lint.h"
-#endif LINT
+#endif /* LINT */
#include "debug.h"
#include <alloc.h>
#include <assert.h>
{
#ifdef LINT
lint_expr(*expp, USED);
-#endif LINT
+#endif /* LINT */
if ((*expp)->ex_type->tp_fund == ARRAY)
array2pointer(*expp);
if (tpp) {
put_bf(tp, (arith)0);
return;
}
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
if (tp->tp_align >= word_align) while (sz >= word_size) {
C_con_cst((arith) 0);
expr = *expp;
#ifdef DEBUG
print_expr("init-expr after cast", expr);
-#endif DEBUG
+#endif /* DEBUG */
if (!is_ld_cst(expr))
illegal_init_cst(expr);
else
expr = *expp;
#ifdef DEBUG
print_expr("init-expr after cast", expr);
-#endif DEBUG
+#endif /* DEBUG */
if (expr->ex_class == Float) {
char buf[FLT_STRLEN];
else
illegal_init_cst(expr);
}
-#endif NOTDEF
+#endif /* NOTDEF */
else
illegal_init_cst(expr);
break;
expr = *expp;
#ifdef DEBUG
print_expr("init-expr after cast", expr);
-#endif DEBUG
+#endif /* DEBUG */
if (is_cp_cst(expr))
put_bf(tp, expr->VL_VALUE);
else
illegal_init_cst(expr);
break;
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
case ERRONEOUS:
if (! gen_error) gen_error = pack_level;
offset = (arith)-1;
}
}
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
int
zero_bytes(sd)
*newf++ = '\0';
}
-#endif LINT
+#endif /* LINT */
#include "assert.h"
#ifdef ANSI
#include <flt_arith.h>
-#endif ANSI
+#endif /* ANSI */
#include "arith.h" /* definition arith */
#include "label.h" /* definition label */
#include "expr.h"
}
}
-#endif LINT
+#endif /* LINT */
#include "assert.h"
#ifdef ANSI
#include <flt_arith.h>
-#endif ANSI
+#endif /* ANSI */
#include "arith.h" /* definition arith */
#include "label.h" /* definition label */
#include "expr.h"
}
print(">\n");
}
-#endif DEBUG
+#endif /* DEBUG */
-#endif LINT
+#endif /* LINT */
#include "interface.h"
#ifdef ANSI
#include <flt_arith.h>
-#endif ANSI
+#endif /* ANSI */
#include "arith.h" /* definition arith */
#include "label.h" /* definition label */
#include "expr.h"
}
}
-#endif LINT
+#endif /* LINT */
#include "interface.h"
#ifdef ANSI
#include <flt_arith.h>
-#endif ANSI
+#endif /* ANSI */
#include "arith.h"
#include "assert.h"
#include "type.h"
output_def(&od);
/* The other fields are not used for this class. */
}
-#endif IMPLICIT
+#endif /* IMPLICIT */
fill_outcall(ex, used)
struct expr *ex;
/* IFDC, first time */
implicit_func_decl(idf, ex->ex_file, ex->ex_line);
}
-#endif IMPLICIT
+#endif /* IMPLICIT */
OutCall.od_type = def->df_type->tp_up;
OutCall.od_statnr = (def->df_sc == STATIC ? stat_number : 0);
OutCall.od_nrargs++;
}
-#endif LINT
+#endif /* LINT */
#include "debug.h"
#ifdef ANSI
#include <flt_arith.h>
-#endif ANSI
+#endif /* ANSI */
#include "arith.h"
#include "label.h"
#include "expr.h"
#define dbg_lint_stack(m) /*print_lint_stack(m) /* or not */
#else
#define dbg_lint_stack(m)
-#endif DEBUG
+#endif /* DEBUG */
extern char *symbol2str();
extern char *func_name;
case GLOBAL:
#ifdef IMPLICIT
case IMPLICIT:
-#endif IMPLICIT
+#endif /* IMPLICIT */
if (fund == ERRONEOUS)
break;
print(" |--------------\n\n");
}
-#endif DEBUG
+#endif /* DEBUG */
-#endif LINT
+#endif /* LINT */
#define K_PRAGMA 11
#define K_UNDEF 12
#define K_FILE 100 /* for dependency generator */
-#endif NOPP
+#endif /* NOPP */
static File *dep_fd = STDOUT;
extern char *getwdir();
-#endif NOPP
+#endif /* NOPP */
struct sp_id special_ids[] = {
{"__setjmp", SP_SETJMP}, /* non-local goto's are registered */
pointer_align = AL_POINTER,
struct_align = AL_STRUCT,
union_align = AL_UNION;
-#endif NOCROSS
+#endif /* NOCROSS */
#ifndef NOPP
arith ifval; /* ifval will contain the result of the #if expression */
-#endif NOPP
+#endif /* NOPP */
char *prog_name;
inc_max = 10;
init_pp(); /* initialise the preprocessor macros */
-#endif NOPP
+#endif /* NOPP */
/* Note: source file "-" indicates that the source is supplied
as standard input. This is only allowed if INP_READ_IN_ONE is
*/
#ifdef INP_READ_IN_ONE
while (argc > 1 && *argv[1] == '-')
-#else INP_READ_IN_ONE
+#else /* INP_READ_IN_ONE */
while (argc > 1 && *argv[1] == '-' && argv[1][1] != '\0')
-#endif INP_READ_IN_ONE
+#endif /* INP_READ_IN_ONE */
{
char *par = &argv[1][1];
}
#ifdef LINT
lint_init();
-#endif LINT
+#endif /* LINT */
compile(argc - 1, &argv[1]);
#ifdef DEBUG
if (options['h']) hash_stat();
if (options['m']) Info();
-#endif DEBUG
+#endif /* DEBUG */
#ifndef NOPP
if (do_dependencies) {
else fprint(dep_fd, "%s\n", s);
}
-#endif NOPP
+#endif /* NOPP */
char *source = 0;
#ifdef GEN_NM_LIST
char *nmlist = 0;
-#endif GEN_NM_LIST
+#endif /* GEN_NM_LIST */
compile(argc, argv)
char *argv[];
char *result;
#ifndef LINT
register char *destination = 0;
-#endif LINT
+#endif /* LINT */
#ifdef DEBUG
#ifndef NOPP
int pp_only = options['E'] || options['P'] || options['C'];
-#endif NOPP
+#endif /* NOPP */
#endif
switch (argc) {
#ifdef DEBUG
#ifndef NOPP
if (!pp_only)
-#endif NOPP
+#endif /* NOPP */
#endif
fatal("%s: destination file not specified", prog_name);
-#endif LINT
+#endif /* LINT */
break;
#ifndef LINT
nmlist = argv[2];
destination = argv[1];
break;
-#endif GEN_NM_LIST
-#endif LINT
+#endif /* GEN_NM_LIST */
+#endif /* LINT */
default:
#ifndef LINT
#ifdef GEN_NM_LIST
fatal("use: %s source destination [namelist]", prog_name);
-#else GEN_NM_LIST
+#else /* GEN_NM_LIST */
fatal("use: %s source destination", prog_name);
-#endif GEN_NM_LIST
-#else LINT
+#endif /* GEN_NM_LIST */
+#else /* LINT */
fatal("use: %s source", prog_name);
-#endif LINT
+#endif /* LINT */
break;
}
&& strcmp(destination, "-") != 0
? destination
: 0);
-#endif LINT
+#endif /* LINT */
#ifndef NOPP
WorkingDir = getwdir(source);
PushLex(); /* initialize lex machine */
-#else NOPP
+#else /* NOPP */
GetToken(&ahead);
-#endif NOPP
+#endif /* NOPP */
#ifdef DEBUG
#ifndef NOPP
if (pp_only) /* run the preprocessor as if it is stand-alone */
preprocess();
else
-#endif NOPP
-#endif DEBUG
+#endif /* NOPP */
+#endif /* DEBUG */
{
/* compile the source text */
C_program();
#ifdef PREPEND_SCOPES
prepend_scopes();
-#endif PREPEND_SCOPES
+#endif /* PREPEND_SCOPES */
#ifndef LINT
end_code();
-#endif LINT
+#endif /* LINT */
#ifdef DEBUG
if (options['u']) {
}
if (options['f'] || options['t'])
dumpidftab("end of main", options['f'] ? 7 : 0);
-#endif DEBUG
+#endif /* DEBUG */
}
#ifndef NOPP
PopLex();
}
}
}
-#endif NOPP
+#endif /* NOPP */
Info()
{
}
-#endif DEBUG
+#endif /* DEBUG */
No_Mem() /* called by alloc package */
{
int do_dependencies = 0;
char *dep_file = 0;
-#endif NOPP
+#endif /* NOPP */
char options[128]; /* one for every char */
#ifdef LINT
char loptions[128]; /* one for every char */
-#endif LINT
+#endif /* LINT */
extern int idfsize;
extern int density;
default:
#ifndef LINT
fatal("illegal option: %c", opt);
-#else LINT
+#else /* LINT */
warning("illegal option: %c", opt);
-#endif LINT
+#endif /* LINT */
break;
case '-':
case 'm':
options[opt] = 1;
break;
-#endif NOPP
-#endif LINT
+#endif /* NOPP */
+#endif /* LINT */
#ifdef DBSYMTAB
case 'g': /* symbol table for debugger */
options['g'] = 1;
#ifndef LINT
#ifdef DATAFLOW
case 'd':
-#endif DATAFLOW
+#endif /* DATAFLOW */
case 'p': /* procentry/procexit */
case 'L' : /* no fil/lin */
case 'n': /* use no registers */
options['w'] = 1; /* implies -a */
options['s'] = 1;
goto next_option;
-#endif LINT
+#endif /* LINT */
#ifdef LINT
case 'h': /* heuristic tests */
case 'L': /* lintlibrary */
loptions[opt] = 1;
goto next_option;
-#endif LINT
+#endif /* LINT */
#ifndef NOPP
case 'D' : { /* -Dname : predefine name */
}
else inctable[inc_pos] = 0;
break;
-#endif NOPP
+#endif /* NOPP */
case 'M': /* maximum identifier length */
idfsize = txt2int(&text);
stat_number = txt2int(&text);
break;
}
-#endif LINT
+#endif /* LINT */
case 'T' : {
#ifdef USE_TMP
C_tmpdir = text;
else
C_tmpdir = ".";
-#else USE_TMP
+#else /* USE_TMP */
warning("-T option ignored");
-#endif USE_TMP
+#endif /* USE_TMP */
break;
}
case 'U' : /* -Uname : undefine predefined */
if (*text) do_undef(str2idf(text, 0));
break;
-#endif NOPP
+#endif /* NOPP */
#ifndef LINT
#ifndef NOCROSS
case 'r': /* adjust bitfields right */
#ifndef NOBITFIELD
options['r'] = 1;
-#else NOBITFIELD
+#else /* NOBITFIELD */
warning("bitfields are not implemented");
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
break;
case 'S': /* initial struct alignment */
if (sz != (arith)0)
case 'S':
density = txt2int(&text);
break;
-#endif NOCROSS
-#endif LINT
+#endif /* NOCROSS */
+#endif /* LINT */
}
}
#include "def.h"
#ifdef LINT
#include "l_lint.h"
-#endif LINT
+#endif /* LINT */
#ifndef NOPP
extern arith ifval;
-#endif NOPP
+#endif /* NOPP */
extern error();
}
"sizeof not allowed in preprocessor");
ifval = expr->VL_VALUE;
free_expression(expr);
-#endif NOPP
+#endif /* NOPP */
}
;
declare_idf(&Ds, &Dc, level);
#ifdef LINT
lint_ext_def(Dc.dc_idf, Ds.ds_sc);
-#endif LINT
+#endif /* LINT */
}
[
function(&Ds, &Dc)
{
#ifdef LINT
lint_non_function_decl(ds, dc);
-#endif LINT
+#endif /* LINT */
}
[
','
{
#ifdef LINT
lint_start_function();
-#endif LINT
+#endif /* LINT */
idf_initialized(idf);
stack_level(); /* L_FORMAL1 declarations */
declare_params(dc);
declare_formals(idf, &fbytes);
#ifdef LINT
lint_formals();
-#endif LINT
+#endif /* LINT */
}
compound_statement
{
end_proc(fbytes);
#ifdef LINT
lint_implicit_return();
-#endif LINT
+#endif /* LINT */
unstack_level(); /* L_FORMAL2 declarations */
#ifdef LINT
lint_end_formals();
-#endif LINT
+#endif /* LINT */
unstack_level(); /* L_FORMAL1 declarations */
#ifdef LINT
lint_end_function();
-#endif LINT
+#endif /* LINT */
}
;
#ifdef DEBUG
if (options['t'])
dumpidftab("start declare_protos", 0);
-#endif DEBUG
+#endif /* DEBUG */
du = dc->dc_decl_unary;
while (du) {
if (du->du_fund == FUNCTION) {
#ifdef DEBUG
if (options['t'])
dumpidftab("end declare_protos", 0);
-#endif DEBUG
+#endif /* DEBUG */
}
*args->a_rawptr++ = ch;
}
}
-#endif NOPP
+#endif /* NOPP */
pointer_size;
extern arith max_int, max_unsigned; /* cstoper.c */
-#else NOCROSS
+#else /* NOCROSS */
#define short_size ((arith)SZ_SHORT)
#define word_size ((arith)SZ_WORD)
#define dword_size ((arith)2*SZ_WORD)
#define max_int ((arith)2147483647)
#define max_unsigned ((arith)4294967295)
#endif
-#endif NOCROSS
+#endif /* NOCROSS */
return ch;
}
}
-#endif NOPP
+#endif /* NOPP */
SkipToNewLine()
{
}
}
-#endif DBSYMTAB
+#endif /* DBSYMTAB */
#include <em.h>
#else
#include "l_em.h"
-#endif LINT
+#endif /* LINT */
#include "debug.h"
#include "botch_free.h"
#include <alloc.h>
local_level = stl;
#ifdef LINT
lint_start_local();
-#endif LINT
+#endif /* LINT */
}
stack_idf(idf, stl)
#ifdef DEBUG
if (options['t'])
dumpidftab("before unstackidfs", 0);
-#endif DEBUG
+#endif /* DEBUG */
#ifdef LINT
lint_end_local(local_level);
-#endif LINT
+#endif /* LINT */
/* The implementation below is more careful than strictly
necessary. Optimists may optimize it afterwards.
#ifdef DEBUG
if (options['t'])
dumpidftab("after unstackidfs", 0);
-#endif DEBUG
+#endif /* DEBUG */
}
unstack_world()
#ifdef LINT
lint_end_global(local_level);
-#endif LINT
+#endif /* LINT */
#ifdef GEN_NM_LIST
open_name_list();
-#endif GEN_NM_LIST
+#endif /* GEN_NM_LIST */
while (se) {
register struct idf *idf = se->se_idf;
def->df_initialized ? "init" : "no init",
def->df_used ? "used" : "not used");
}
-#endif DEBUG
+#endif /* DEBUG */
if (def->df_sc == STATIC
&& def->df_type->tp_fund == FUNCTION
&& !def->df_initialized) {
#ifdef GEN_NM_LIST
if (def->df_sc != STATIC)
namelist(idf->id_text); /* may be common */
-#endif GEN_NM_LIST
+#endif /* GEN_NM_LIST */
def->df_alloc = ALLOC_DONE; /* see Note below */
}
se = se->next;
sys_write(nfp, "\n", 1);
}
}
-#endif GEN_NM_LIST
+#endif /* GEN_NM_LIST */
#else
#include "l_em.h"
#include "l_lint.h"
-#endif LINT
+#endif /* LINT */
#include "debug.h"
#include "botch_free.h"
{
#ifdef LINT
lint_statement();
-#endif LINT
+#endif /* LINT */
}
:
%if (AHEAD != ':')
code_break();
#ifdef LINT
lint_break_stmt();
-#endif LINT
+#endif /* LINT */
}
';'
|
code_continue();
#ifdef LINT
lint_continue_stmt();
-#endif LINT
+#endif /* LINT */
}
';'
|
{
#ifdef DEBUG
print_expr("expression_statement", expr);
-#endif DEBUG
+#endif /* DEBUG */
code_expr(expr, RVAL, FALSE, NO_LABEL, NO_LABEL);
free_expression(expr);
}
*/
#ifdef LINT
lint_label();
-#endif LINT
+#endif /* LINT */
define_label(idf);
C_df_ilb((label)idf->id_label->df_address);
}
/* else fall through */
#ifdef LINT
start_if_part(1);
-#endif LINT
+#endif /* LINT */
}
else {
code_expr(expr, RVAL, TRUE, l_true, l_false);
C_df_ilb(l_true);
#ifdef LINT
start_if_part(0);
-#endif LINT
+#endif /* LINT */
}
free_expression(expr);
}
{
#ifdef LINT
start_else_part();
-#endif LINT
+#endif /* LINT */
C_bra(l_end);
C_df_ilb(l_false);
}
{ C_df_ilb(l_end);
#ifdef LINT
end_if_else_stmt();
-#endif LINT
+#endif /* LINT */
}
|
empty
{ C_df_ilb(l_false);
#ifdef LINT
end_if_stmt();
-#endif LINT
+#endif /* LINT */
}
]
;
}
#ifdef LINT
start_while_stmt(expr);
-#endif LINT
+#endif /* LINT */
}
')'
statement
#ifdef LINT
end_loop_body();
end_loop_stmt();
-#endif LINT
+#endif /* LINT */
}
;
stack_stmt(l_break, l_continue);
#ifdef LINT
start_do_stmt();
-#endif LINT
+#endif /* LINT */
}
statement
WHILE
{
#ifdef LINT
end_loop_body();
-#endif LINT
+#endif /* LINT */
C_df_ilb(l_continue);
}
expression(&expr)
}
#ifdef LINT
end_do_stmt(1, expr->VL_VALUE != (arith)0);
-#endif LINT
+#endif /* LINT */
}
else {
code_expr(expr, RVAL, TRUE, l_body, l_break);
#ifdef LINT
end_do_stmt(0, 0);
-#endif LINT
+#endif /* LINT */
}
C_df_ilb(l_break);
}
{
#ifdef LINT
start_for_stmt(e_test);
-#endif LINT
+#endif /* LINT */
}
statement
{
#ifdef LINT
end_loop_body();
-#endif LINT
+#endif /* LINT */
C_df_ilb(l_continue);
if (e_incr)
code_expr(e_incr, RVAL, FALSE,
free_expression(e_incr);
#ifdef LINT
end_loop_stmt();
-#endif LINT
+#endif /* LINT */
}
;
code_startswitch(&expr);
#ifdef LINT
start_switch_part(is_cp_cst(expr));
-#endif LINT
+#endif /* LINT */
}
')'
statement
{
#ifdef LINT
end_switch_stmt();
-#endif LINT
+#endif /* LINT */
code_endswitch();
free_expression(expr);
}
{
#ifdef LINT
lint_case_stmt(0);
-#endif LINT
+#endif /* LINT */
code_case(expr);
free_expression(expr);
}
{
#ifdef LINT
lint_case_stmt(1);
-#endif LINT
+#endif /* LINT */
code_default();
}
':'
{
#ifdef LINT
lint_ret_conv(expr);
-#endif LINT
+#endif /* LINT */
do_return_expr(expr);
free_expression(expr);
#ifdef LINT
lint_return_stmt(VALRETURNED);
-#endif LINT
+#endif /* LINT */
}
|
empty
do_return();
#ifdef LINT
lint_return_stmt(NOVALRETURNED);
-#endif LINT
+#endif /* LINT */
}
]
';'
C_bra((label)idf->id_label->df_address);
#ifdef LINT
lint_jump_stmt(idf);
-#endif LINT
+#endif /* LINT */
}
;
arith offset;
#ifndef NOBITFIELD
extern arith add_field();
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
struct tag *tg = stp->tp_idf->id_tag; /* or union */
struct sdef *sdef = idf->id_sdef;
*/
offset = add_field(szp, fd, &tp, idf, stp);
}
-#else NOBITFIELD
+#else /* NOBITFIELD */
offset = align(*szp, tp->tp_align);
field_busy = 0;
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
}
else { /* (stp->tp_fund == UNION) */
if (fd) offset = add_field(szp, fd, &tp, idf, stp);
#ifndef NOBITFIELD
if (tp->tp_fund == FIELD)
tp->tp_field->fd_sdef = newsdef;
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
stack_idf(idf, stack_level_of(lvl));
return field_offset;
}
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
/* some utilities */
int
#include <em.h>
#else
#include "l_em.h"
-#endif LINT
+#endif /* LINT */
#include "debug.h"
#include "botch_free.h"
#include <alloc.h>
{FLOATING, "floating"},
{0, ""}
};
-#endif ____
+#endif /* ____ */
#ifdef ____
struct tokenname tkcomp[] = { /* names of the composite tokens */
{ELLIPSIS, "..."},
{0, ""}
};
-#endif ____
+#endif /* ____ */
struct tokenname tkidf[] = { /* names of the identifier tokens */
{AUTO, "auto"},
{FLOAT2FLOAT, "float2float"},
{0, ""}
};
-#endif ____
+#endif /* ____ */
reserve(resv)
register struct tokenname resv[];
extern struct type *function_of(), *array_of();
#ifndef NOBITFIELD
extern struct type *field_of();
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
/* To be created dynamically in main() from defaults or from command
line parameters.
case FIELD:
dtp = field_of(tp, qual);
break;
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
case FUNCTION:
if (tp->tp_fund == FUNCTION) {
dtp->tp_typequal = qual;
return dtp;
}
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
arith
size_of_type(tp, nm)
#ifndef NOBITFIELD
extern struct type *field_of();
-#endif NOBITFIELD
+#endif /* NOBITFIELD */
extern struct type
*schar_type, *uchar_type,
#include <em.h>
#else
#include "l_em.h"
-#endif LINT
+#endif /* LINT */
#include <em_arith.h>
#include <em_reg.h>
#include <alloc.h>
static struct localvar *FreeTmps;
#ifdef USE_TMP
static int loc_id;
-#endif USE_TMP
+#endif /* USE_TMP */
#ifdef PEEPHOLE
#undef REGCOUNT
{
#ifdef USE_TMP
C_insertpart(loc_id = C_getid());
-#endif USE_TMP
+#endif /* USE_TMP */
}
arith
if (p) p->t_regtype = -1;
C_lal(off);
}
-#endif LINT
+#endif /* LINT */