*/
enum statetp {Oct,OptHex,Hex,Dec,OctEndOrHex,End,OptReal,Real};
register enum statetp state;
- register int base;
+ register int base = 8;
register char *np = &buf[1];
/* allow a '-' to be added */
LoadChar(ch);
}
if (ch == 'B' || ch == 'C') {
- base = 8;
state = OctEndOrHex;
break;
}
UnloadChar(ch);
ch = *--np;
*np++ = '\0';
- base = 8;
/* Fall through */
case End: {
PRID = $(EMHOME)/bin/prid
CID = $(EMHOME)/bin/cid
CURRDIR = .
+LINT = lint
INCLUDES = -I$(MHDIR) -I$(EMHOME)/h -I$(PKGDIR)
OLIBS = $(LIBDIR)/libem_mes.a $(OBJECTCODE) $(LIBDIR)/libinput.a $(LIBDIR)/libassert.a $(LIBDIR)/liballoc.a $(MALLOC) $(LIBDIR)/libprint.a $(LIBDIR)/libstring.a $(LIBDIR)/libsystem.a
LLGENOPTIONS = -v
PROFILE =
COPTIONS=
-CFLAGS = $(PROFILE) $(INCLUDES) $(COPTIONS) -O -DSTATIC=
+OPTIM=-O
+CFLAGS = $(PROFILE) $(INCLUDES) $(COPTIONS) $(OPTIM) -DSTATIC=
LINTFLAGS = -DSTATIC= -DNORCSID
MALLOC = $(LIBDIR)/malloc.o
LDFLAGS = -i $(PROFILE)
#INCLINCLINCLINCL
Xlint:
- lint $(INCLUDES) $(LINTFLAGS) $(SRC) \
+ $(LINT) $(INCLUDES) $(LINTFLAGS) $(SRC) \
$(LIBDIR)/llib-lem_mes.ln \
$(LIBDIR)/llib-lemk.ln \
$(LIBDIR)/llib-linput.ln \
{
register t_node *arg = nd->nd_right;
register t_node *left = 0;
- register t_type *tp;
+ register t_type *tp = 0;
int std = nd->nd_left->nd_def->df_value.df_stdname;
if (arg) {
break;
case OR:
case AND: {
- label l_maybe = ++text_label, l_end;
+ label l_maybe = ++text_label, l_end = NO_LABEL;
t_desig *Des = new_desig();
- int genlabels = 0;
if (true_label == NO_LABEL) {
- genlabels = 1;
true_label = ++text_label;
false_label = ++text_label;
l_end = ++text_label;
def_ilb(l_maybe);
clear((char *) Des, sizeof(t_desig));
CodeExpr(rightop, Des, true_label, false_label);
- if (genlabels) {
+ if (l_end != NO_LABEL) {
def_ilb(true_label);
c_loc(1);
C_bra(l_end);
expression below it, and the result restored in expp.
*/
register t_node *right = expp->nd_right;
- arith o1;
+ arith o1 = right->nd_INT;
switch(expp->nd_symb) {
/* Should not get here
*/
case '-':
- if (right->nd_INT == min_int[(int)(right->nd_type->tp_size)])
+ if (o1 == min_int[(int)(right->nd_type->tp_size)])
overflow(expp);
- o1 = -right->nd_INT;
+ o1 = -o1;
break;
case NOT:
case '~':
- o1 = !right->nd_INT;
+ o1 = !o1;
break;
default:
#include "Lpars.h"
#include "warning.h"
+extern char *sprint();
+
STATIC
internal(c)
register char *c;
*/
register t_def *df;
register t_scope *scope;
- extern char *sprint();
static int nmcount;
char buf[256];
register t_scope *sc;
static int modulecount = 0;
char buf[256];
- extern char *sprint();
extern int proclevel;
sprint(buf, "_%d%s_", ++modulecount, id->id_text);
ForeignFlag = 0;
DefId = id;
open_scope(CLOSEDSCOPE);
+ vis = CurrVis;
if (!strcmp(id->id_text, "SYSTEM")) {
do_SYSTEM();
df = lookup(id, GlobalScope, D_IMPORTED, 0);
df = lookup(id, GlobalScope, D_IMPORTED, 0);
newsc->sc_name = id->id_text;
}
- vis = CurrVis;
}
close_scope(SC_CHKFORW);
if (! df) {
#include "f_info.h"
#include "warning.h"
+extern t_def *GetDefinitionModule();
+
}
/*
The grammar as given by Wirth is already almost LL(1); the
t_node *ImportList;
register t_node *FromId = 0;
register t_def *df;
- extern t_def *GetDefinitionModule();
} :
+ /*
+ When parsing a global module, this is the place where we must
+ read already compiled definition modules.
+ If the FROM clause is present, the identifier in it is a module
+ name, otherwise the names in the import list are module names.
+ */
[ FROM
IDENT { FromId = dot2leaf(Name);
if (local) {
}
else df = GetDefinitionModule(dot.TOK_IDF, 1);
}
+ IMPORT IdentList(&ImportList) ';'
+ { EnterFromImportList(ImportList, df, FromId); }
|
+ IMPORT IdentList(&ImportList) ';'
+ { EnterImportList(ImportList,
+ local,
+ enclosing(CurrVis)->sc_scope);
+ }
]
- IMPORT IdentList(&ImportList) ';'
- /*
- When parsing a global module, this is the place where we must
- read already compiled definition modules.
- If the FROM clause is present, the identifier in it is a module
- name, otherwise the names in the import list are module names.
- */
- { if (FromId) {
- EnterFromImportList(ImportList, df, FromId);
- }
- else EnterImportList(ImportList,
- local,
- enclosing(CurrVis)->sc_scope);
+ {
FreeNode(ImportList);
}
;
ProgramModule
{
- extern t_def *GetDefinitionModule();
register t_def *df;
} :
MODULE
WalkDefList(procscope->sc_def, UseWarnings);
}
-static int
+static
WalkDef(df)
register t_def *df;
{
}
}
-static int
+static
MkCalls(df)
register t_def *df;
{
ForLoopVarExpr(nd);
C_stl(tmp2);
}
- }
- WalkNode(right, exit_label);
- nd->nd_def->df_flags &= ~D_FORLOOP;
- if (good_forvar) {
+ WalkNode(right, exit_label);
+ nd->nd_def->df_flags &= ~D_FORLOOP;
if (tmp2 != 0) {
label x = ++text_label;
C_lol(tmp2);
CodeDStore(nd);
}
}
+ else {
+ WalkNode(right, exit_label);
+ nd->nd_def->df_flags &= ~D_FORLOOP;
+ }
C_bra(l1);
def_ilb(l2);
FreeInt(tmp);
free_desig(dsr);
}
-static int
+static
RegisterMessage(df)
register t_def *df;
{
register t_type *tp;
- arith sz;
- int regtype;
if (df->df_kind == D_VARIABLE) {
if ( !(df->df_flags & D_NOREG)) {
/* Examine type and size
*/
- regtype = -1;
tp = BaseType(df->df_type);
if ((df->df_flags & D_VARPAR) ||
(tp->tp_fund&(T_POINTER|T_HIDDEN|T_EQUAL))) {
- sz = pointer_size;
- regtype = reg_pointer;
+ C_ms_reg(df->var_off,
+ pointer_size,
+ reg_pointer,
+ 0);
}
else if (tp->tp_fund & T_NUMERIC) {
- sz = tp->tp_size;
- regtype = tp->tp_fund == T_REAL ?
- reg_float : reg_any;
- }
- if (regtype >= 0) {
- C_ms_reg(df->var_off, sz, regtype, 0);
+ C_ms_reg(df->var_off,
+ tp->tp_size,
+ tp->tp_fund == T_REAL ?
+ reg_float : reg_any,
+ 0);
}
}
}
}
-static int
+static
UseWarnings(df)
register t_def *df;
{