ASSERT(LexSP < 2);
ASSERT(ASIDE == 0); /* ASIDE = 0; */
GetToken(&ahead);
- ahead.tk_line = LineNumber;
- ahead.tk_file = FileName;
LexStack[LexSP++] = dot;
}
else
DOT = EOF;
}
- /* keep track of the place of the token in the file */
- ahead.tk_file = FileName;
- ahead.tk_line = LineNumber;
return DOT;
}
File_Inserted = 0;
goto firstline;
}
+
again: /* rescan the input after an error or replacement */
#ifndef NOPP
if (Unstacked) EnableMacros();
go_on: /* rescan, the following character has been read */
if ((ch & 0200) && ch != EOI) /* stop on non-ascii character */
fatal("non-ascii '\\%03o' read", ch & 0377);
+ /* keep track of the place of the token in the file */
+ ptok->tk_file = FileName;
+ ptok->tk_line = LineNumber;
+
switch (class(ch)) { /* detect character class */
case STNL: /* newline, vertical space or formfeed */
firstline:
LineNumber++; /* also at vs and ff */
+ ptok->tk_file = FileName;
+ ptok->tk_line = LineNumber;
if (EoiForNewline) /* called in control line */
/* a newline in a control line indicates the
end-of-information of the line.
C_asp(word_size);
}
#endif STB
+
ch7cast(&expr, '=', tp); /* may modify expr */
EVAL(expr, RVAL, TRUE, NO_LABEL, NO_LABEL);
- free_expression(expr);
vl.vl_class = Name;
vl.vl_data.vl_idf = id;
vl.vl_value = (arith)0;
store_val(&vl, tp);
+ free_expression(expr);
}
}
signed, unsigned or floating
*/
int
-fundamental(tp)
+fundamental(tp)/* bad name ???*/
register struct type *tp;
{
switch (tp->tp_fund) {
}
return 0;
}
+
#include "debug.h"
#include "arith.h"
#include "LLlex.h"
+#include "label.h"
+#include "code.h"
#include "idf.h"
#include "type.h"
#include "struct.h"
IDENTIFIER
{
error("%s is not a type identifier", dot.tk_idf->id_text);
- ds->ds_type = error_type;
+ ds->ds_type = error_type;
if (dot.tk_idf->id_def) {
- dot.tk_idf->id_def->df_type = error_type;
- dot.tk_idf->id_def->df_sc = TYPEDEF;
+ dot.tk_idf->id_def->df_type = error_type;
+ dot.tk_idf->id_def->df_sc = TYPEDEF;
}
}
|
{ code_declaration(Dc.dc_idf, (struct expr *) 0, level, ds->ds_sc); }
]
]
- {remove_declarator(&Dc);}
+ {
+ remove_declarator(&Dc);
+ }
;
/* 8.6: initializer */
external_definition, q.v.
*/
]
- { if (globalflag) {
+ {
+ if (globalflag) {
struct expr ex;
code_declaration(idf, &ex, level, sc);
- }
+ }
}
initial_value(globalflag ? &(idf->id_def->df_type) : (struct type **)0,
&expr)
print_expr("initializer-expression", expr);
#endif DEBUG
code_declaration(idf, expr, level, sc);
- }
- init_idf(idf);
+ }
+ init_idf(idf);
}
;
/* $Header$ */
/* IDENTIFIER DEFINITION DESCRIPTOR */
+
struct def { /* for ordinary tags */
struct def *next;
int df_level;
#include "arith.h"
#include "label.h"
#include "expr.h"
+#include "def.h"
#include "LLlex.h"
/* This file contains the error-message and diagnostic
extern char *symbol2str();
extern char options[];
+extern char loptions[];
/* There are three general error-message functions:
lexerror() lexical and pre-processor error messages
expression, whereas other errors use the information in the token.
*/
-/*VARARGS1*/
-error(va_alist)
+/*VARARGS*/
+error(va_alist) /* fmt, args */
va_dcl
{
va_list ap;
va_end(ap);
}
-/*VARARGS2*/
-expr_error(va_alist)
+/*VARARGS*/
+expr_error(va_alist) /* expr, fmt, args */
va_dcl
{
va_list ap;
va_end(ap);
}
-/*VARARGS1*/
-warning(va_alist)
+/*VARARGS*/
+warning(va_alist) /* fmt, args */
va_dcl
{
va_list ap;
va_end(ap);
}
-/*VARARGS2*/
-expr_warning(va_alist)
+/*VARARGS*/
+expr_warning(va_alist) /* expr, fmt, args */
va_dcl
{
va_list ap;
va_end(ap);
}
-/*VARARGS1*/
-lexerror(va_alist)
+/*VARARGS*/
+lexerror(va_alist) /* fmt, args */
va_dcl
{
va_list ap;
}
#ifndef NOPP
-/*VARARGS1*/
-lexwarning(va_alist)
+/*VARARGS*/
+lexwarning(va_alist) /* fmt, args */
va_dcl
{
va_list ap;
}
#endif NOPP
-/*VARARGS1*/
-crash(va_alist)
+/*VARARGS*/
+crash(va_alist) /* fmt, args */
va_dcl
{
va_list ap;
#else DEBUG
sys_stop(S_EXIT);
#endif DEBUG
+ /* NOTREACHED */
}
-/*VARARGS1*/
-fatal(va_alist)
+/*VARARGS*/
+fatal(va_alist) /* fmt, args */
va_dcl
{
va_list ap;
store_block(tp->tp_size, tp->tp_align);
}
else if (newcode)
- store_val(&(left->ex_object.ex_value),
- left->ex_type);
+ store_val(&(left->EX_VALUE), left->ex_type);
}
break;
case PLUSAB:
assop(tp, oper);
conversion(tp, left->ex_type);
if (compl == 0) {
- store_val(&(left->ex_object.ex_value),
+ store_val(&(left->EX_VALUE),
left->ex_type);
if (dupval) load_val(left, RVAL);
}
C_loi(siz);
}
}
+
};
/* some abbreviated selections */
-#define VL_CLASS ex_object.ex_value.vl_class
-#define VL_VALUE ex_object.ex_value.vl_value
-#define VL_IDF ex_object.ex_value.vl_data.vl_idf
-#define VL_LBL ex_object.ex_value.vl_data.vl_lbl
+#define EX_VALUE ex_object.ex_value
+#define VL_CLASS EX_VALUE.vl_class
+#define VL_VALUE EX_VALUE.vl_value
+#define VL_IDF EX_VALUE.vl_data.vl_idf
+#define VL_LBL EX_VALUE.vl_data.vl_lbl
#define SG_VALUE ex_object.ex_string.sg_value
#define SG_LEN ex_object.ex_string.sg_len
#define SG_DATLAB ex_object.ex_string.sg_datlab
#include "idf.h"
#include "label.h"
#include "expr.h"
+#include "code.h"
#include "noRoption.h"
extern char options[];
|
TYPE_IDENTIFIER
]
- {*idfp = dot.tk_idf;}
+ {
+ *idfp = dot.tk_idf;
+ }
;
load_val(leftop, RVAL);
C_and(asize);
C_ior(asize);
- store_val(&(leftop->ex_object.ex_value), atype);
+ store_val(&(leftop->EX_VALUE), atype);
}
else { /* complex case */
tmpvar = NewLocal(pointer_size, pointer_align,
load_val(leftop, RVAL);
C_and(asize);
C_ior(asize);
- store_val(&(leftop->ex_object.ex_value), atype);
+ store_val(&(leftop->EX_VALUE), atype);
}
else {
LoadLocal(tmpvar, pointer_size);
}
}
#endif NOBITFIELD
+
warning("redeclaring reserved word %s", idf->id_text);
}
#endif
+
if (def &&
( def->df_level == lvl ||
( lvl != L_GLOBAL && def->df_level > lvl )
/* $Header$ */
/* IDENTIFIER DESCRIPTOR */
-#include "nopp.h"
+#include "nopp.h"
/* Since the % operation in the calculation of the hash function
turns out to be expensive, it is replaced by the cheaper XOR (^).
#include "LLlex.h"
#include "noRoption.h"
#include "estack.h"
+#include "code.h"
#define con_nullbyte() C_con_ucon("0", (arith)1)
#define aggregate_type(tp) ((tp)->tp_fund == ARRAY || (tp)->tp_fund == STRUCT)
{ if (tpp) gen_tpcheck(tpp, 0); }
[
assignment_expression(expp)
- { if ((*expp)->ex_type->tp_fund == ARRAY)
+ {
+ if ((*expp)->ex_type->tp_fund == ARRAY)
array2pointer(*expp);
- if (tpp) {
+ if (tpp) {
gen_simple_exp(tpp, expp);
free_expression(*expp);
*expp = 0;
- }
}
+ }
|
initial_value_pack(tpp, expp)
]
#ifndef NOPP
WorkingDir = getwdir(source);
#endif NOPP
- PushLex();
+ PushLex(); /* initialize lex machine */
#ifdef DEBUG
#ifndef NOPP
default:
fatal("illegal option: %c", *--text);
-
+ break;
case '-':
options[*text] = 1; /* flags, debug options etc. */
break;
-#ifdef DATAFLOW
+#ifdef DATAFLOW
case 'd':
-#endif DATAFLOW
+#endif DATAFLOW
case 'p': /* procentry/procexit */
case 'L' : /* no fil/lin */
case 'n': /* use no registers */
case 'w': /* no warnings will be given */
-#ifndef NOROPTION
+#ifndef NOROPTION
case 'R': /* strict version */
#endif
options[*(text-1)] = 1;
break;
-#ifdef NOROPTION
+#ifdef NOROPTION
case 'R':
warning("-R option not implemented");
break;
#endif
-#ifdef ___XXX___
+#ifdef ___XXX___
deleted, is now a debug-flag
case 'C' : /* E option + comment output */
-#ifndef NOPP
+#ifndef NOPP
options['E'] = 1;
warning("-C: comment is not output");
#else NOPP
warning("-C option ignored");
-#endif NOPP
+#endif NOPP
break;
-#endif ___XXX___
+#endif ___XXX___
case 'D' : { /* -Dname : predefine name */
#ifndef NOPP
extern arith ifval;
#endif NOPP
-/*VARARGS*/
extern error();
}
ext_decl_specifiers(&Ds)
[
declarator(&Dc)
- {declare_idf(&Ds, &Dc, level);}
+ {
+ declare_idf(&Ds, &Dc, level);
+ }
[%if (Dc.dc_idf->id_def->df_type->tp_fund == FUNCTION)
/* int i (1) {2, 3}
is a function, not an old-fashioned
|
{ code_declaration(dc->dc_idf, (struct expr *) 0, level, ds->ds_sc); }
]
+ {
+ }
[
','
init_declarator(ds)
}
:
{ register struct idf *idf = dc->dc_idf;
-
init_idf(idf);
stack_level(); /* L_FORMAL1 declarations */
declare_params(dc);
/* 9 */
statement
+ {
+ }
:
%if (AHEAD != ':')
expression_statement
default_statement
|
BREAK
- {code_break();}
+ {
+ code_break();
+ }
';'
|
CONTINUE
- {code_continue();}
+ {
+ code_continue();
+ }
';'
|
return_statement
';'
expression(&e_incr)?
')'
+ {
+ }
statement
{
C_df_ilb(l_continue);
{ code_asm(asm_bts, asm_len);
}
;
+
/* $Header$ */
/* TYPE DESCRIPTOR */
-#include "nofloat.h"
-#include "nobitfield.h"
+#include "nofloat.h"
+#include "nobitfield.h"
struct type {
struct type *next; /* used only with ARRAY */