made to fit on PDP-11 ...

This commit is contained in:
ceriel 1988-07-05 19:06:40 +00:00
parent 44014704a0
commit afc4d5211b
7 changed files with 28 additions and 38 deletions

View file

@ -71,7 +71,7 @@
!File: nostrict.h !File: nostrict.h
#undef NOSTRICT 1 /* define when STRICT warnings disabled #define NOSTRICT 1 /* define when STRICT warnings disabled
(yet another squeezing method) (yet another squeezing method)
*/ */

View file

@ -178,7 +178,7 @@ ChkArr(expp, flags)
register t_type *tpl; register t_type *tpl;
assert(expp->nd_class == Arrsel); assert(expp->nd_class == Arrsel);
assert(expp->nd_symb == '['); assert(expp->nd_symb == '[' || expp->nd_symb == ',');
expp->nd_type = error_type; expp->nd_type = error_type;

View file

@ -642,7 +642,7 @@ CodeDesig(nd, ds)
break; break;
case Arrsel: case Arrsel:
assert(nd->nd_symb == '['); assert(nd->nd_symb == '[' || nd->nd_symb == ',');
CodeDesig(nd->nd_left, ds); CodeDesig(nd->nd_left, ds);
CodeAddress(ds); CodeAddress(ds);

View file

@ -236,7 +236,7 @@ EnterParamList(ppr, Idlist, type, VARp, off)
STATIC t_def *DoImport(); STATIC t_def *DoImport();
ImportEffects(idef, scope, flag) ImportEffects(idef, scope, flag)
t_def *idef; register t_def *idef;
t_scope *scope; t_scope *scope;
{ {
/* Handle side effects of an import: /* Handle side effects of an import:
@ -256,6 +256,7 @@ ImportEffects(idef, scope, flag)
/* Also import all enumeration literals /* Also import all enumeration literals
*/ */
for (df = tp->enm_enums; df; df = df->enm_next) { for (df = tp->enm_enums; df; df = df->enm_next) {
df->df_flags |= D_QEXPORTED;
if (! DoImport(df, scope, flag|D_USED)) assert(0); if (! DoImport(df, scope, flag|D_USED)) assert(0);
/* don't complain when not used ... */ /* don't complain when not used ... */
} }
@ -292,7 +293,7 @@ DoImport(df, scope, flag)
{ {
/* Definition "df" is imported to scope "scope". /* Definition "df" is imported to scope "scope".
*/ */
t_def *idef = define(df->df_idf, scope, D_IMPORT); register t_def *idef = define(df->df_idf, scope, D_IMPORT);
idef->imp_def = df; idef->imp_def = df;
idef->df_flags |= flag; idef->df_flags |= flag;
@ -310,7 +311,7 @@ ForwModule(df, nd)
We could also end up here for not found DEFINITION MODULES. We could also end up here for not found DEFINITION MODULES.
Create a declaration and a scope for this module. Create a declaration and a scope for this module.
*/ */
t_scopelist *vis; register t_scopelist *vis;
if (df->df_scope != GlobalScope) { if (df->df_scope != GlobalScope) {
df->df_scope = enclosing(CurrVis)->sc_scope; df->df_scope = enclosing(CurrVis)->sc_scope;
@ -456,7 +457,7 @@ EnterFromImportList(idlist, FromDef, FromId)
{ {
/* Import the list Idlist from the module indicated by Fromdef. /* Import the list Idlist from the module indicated by Fromdef.
*/ */
register t_scope *sc; t_scope *sc;
register t_def *df; register t_def *df;
char *module_name = FromDef->df_idf->id_text; char *module_name = FromDef->df_idf->id_text;

View file

@ -51,7 +51,7 @@ qualident(t_node **p;)
]* ]*
; ;
selector(t_node **pnd;): selector(register t_node **pnd;):
'.' { *pnd = dot2node(Link,*pnd,NULLNODE); } '.' { *pnd = dot2node(Link,*pnd,NULLNODE); }
IDENT { (*pnd)->nd_IDF = dot.TOK_IDF; } IDENT { (*pnd)->nd_IDF = dot.TOK_IDF; }
; ;
@ -94,7 +94,7 @@ ConstExpression(t_node **pnd;)
} }
; ;
expression(t_node **pnd;) expression(register t_node **pnd;)
{ {
} : } :
SimpleExpression(pnd) SimpleExpression(pnd)
@ -113,7 +113,7 @@ relation:
; ;
*/ */
SimpleExpression(t_node **pnd;) SimpleExpression(register t_node **pnd;)
{ {
register t_node *nd = 0; register t_node *nd = 0;
} : } :
@ -168,7 +168,8 @@ MulOperator:
factor(register t_node **p;) factor(register t_node **p;)
{ {
t_node *nd; register t_node *nd;
t_node *nd1;
} : } :
qualident(p) qualident(p)
[ [
@ -179,8 +180,8 @@ factor(register t_node **p;)
| |
] ]
| |
bare_set(&nd) bare_set(&nd1)
{ nd->nd_left = *p; *p = nd; } { nd = nd1; nd->nd_left = *p; *p = nd; }
] ]
| |
bare_set(p) bare_set(p)
@ -241,18 +242,15 @@ ActualParameters(t_node **pnd;):
'(' ExpList(pnd)? ')' '(' ExpList(pnd)? ')'
; ;
element(register t_node *nd;) element(register t_node *nd;) :
{ expression(&(nd->nd_right))
t_node *nd1;
} :
expression(&nd1)
[ [
UPTO UPTO
{ nd1 = dot2node(Link, nd1, NULLNODE);} { nd->nd_right = dot2node(Link, nd->nd_right, NULLNODE);}
expression(&(nd1->nd_right)) expression(&(nd->nd_right->nd_right))
| |
] ]
{ nd->nd_right = dot2node(Link, nd1, NULLNODE); { nd->nd_right = dot2node(Link, nd, NULLNODE);
nd->nd_right->nd_symb = ','; nd->nd_right->nd_symb = ',';
} }
; ;
@ -263,7 +261,7 @@ designator(t_node **pnd;)
designator_tail(pnd) designator_tail(pnd)
; ;
designator_tail(t_node **pnd;): designator_tail(register t_node **pnd;):
visible_designator_tail(pnd) visible_designator_tail(pnd)
[ %persistent [ %persistent
%default %default
@ -278,19 +276,16 @@ visible_designator_tail(t_node **pnd;)
{ {
register t_node *nd = *pnd; register t_node *nd = *pnd;
}: }:
[
'[' { nd = dot2node(Arrsel, nd, NULLNODE); } '[' { nd = dot2node(Arrsel, nd, NULLNODE); }
expression(&(nd->nd_right)) expression(&(nd->nd_right))
[ [
',' ','
{ nd = dot2node(Arrsel, nd, NULLNODE); { nd = dot2node(Arrsel, nd, NULLNODE);
nd->nd_symb = '[';
} }
expression(&(nd->nd_right)) expression(&(nd->nd_right))
]* ]*
']' ']'
|
'^' { nd = dot2node(Arrow, NULLNODE, nd); }
]
{ *pnd = nd; } { *pnd = nd; }
|
'^' { *pnd = dot2node(Arrow, NULLNODE, nd); }
; ;

View file

@ -38,8 +38,8 @@ char options[128];
int DefinitionModule; int DefinitionModule;
char *ProgName; char *ProgName;
char **DEFPATH; char **DEFPATH;
int nDEF, mDEF; int nDEF = 1, mDEF = 10;
int pass_1; int pass_1 = 1;
t_def *Defined; t_def *Defined;
extern int err_occurred; extern int err_occurred;
extern int fp_used; /* set if floating point used */ extern int fp_used; /* set if floating point used */
@ -53,10 +53,7 @@ main(argc, argv)
register char **Nargv = &argv[0]; register char **Nargv = &argv[0];
ProgName = *argv++; ProgName = *argv++;
warning_classes = W_INITIAL; DEFPATH = (char **) Malloc(mDEF * sizeof(char *));
DEFPATH = (char **) Malloc(10 * sizeof(char *));
mDEF = 10;
nDEF = 1;
while (--argc > 0) { while (--argc > 0) {
if (**argv == '-') if (**argv == '-')
@ -105,7 +102,6 @@ Compile(src, dst)
C_magic(); C_magic();
C_ms_emx(word_size, pointer_size); C_ms_emx(word_size, pointer_size);
CheckForLineDirective(); CheckForLineDirective();
pass_1 = 1;
CompUnit(); CompUnit();
C_ms_src((int)LineNumber - 1, FileName); C_ms_src((int)LineNumber - 1, FileName);
if (!err_occurred) { if (!err_occurred) {
@ -225,9 +221,7 @@ AddStandards()
df = Enter("TRUE", D_ENUM, bool_type, 0); df = Enter("TRUE", D_ENUM, bool_type, 0);
df->enm_val = 1; df->enm_val = 1;
df->enm_next = Enter("FALSE", D_ENUM, bool_type, 0); df->enm_next = Enter("FALSE", D_ENUM, bool_type, 0);
df = df->enm_next; assert(df->enm_next->enm_val == 0 && df->enm_next->enm_next == 0);
df->enm_val = 0;
df->enm_next = 0;
} }
do_SYSTEM() do_SYSTEM()

View file

@ -33,7 +33,7 @@ recognize some keywords!
extern int idfsize; extern int idfsize;
static int ndirs = 1; static int ndirs = 1;
int warning_classes; int warning_classes = W_INITIAL;
DoOption(text) DoOption(text)
register char *text; register char *text;