Added the possibility to disable range-checks

This commit is contained in:
ceriel
1987-08-11 10:50:30 +00:00
parent d0b452373b
commit a7b7fa4162
8 changed files with 71 additions and 18 deletions

View File

@@ -22,6 +22,8 @@
#include "node.h"
static int loopcount = 0; /* Count nested loops */
int Roption;
extern char options[];
extern struct node *EmptyStatement;
}
@@ -30,6 +32,23 @@ statement(register struct node **pnd;)
register struct node *nd;
extern int return_occurred;
} :
/* We need some method for making sure lookahead is done, so ...
*/
[ PROGRAM
/* LLlex never returns this */
| %default
{ if (options['R'] != Roption) {
Roption = options['R'];
nd = dot2leaf(Option);
nd->nd_symb = 'R';
*pnd = nd =
dot2node(Link, nd, NULLNODE);
nd->nd_symb = ';';
pnd = &(nd->nd_right);
}
}
]
[
/*
* This part is not in the reference grammar. The reference grammar
* states : assignment | ProcedureCall | ...
@@ -88,6 +107,7 @@ statement(register struct node **pnd;)
{ return_occurred = 1; }
|
/* empty */ { *pnd = EmptyStatement; }
]
;
/*
@@ -105,12 +125,13 @@ ProcedureCall:
StatementSequence(register struct node **pnd;)
{
struct node *nd;
register struct node *nd1;
} :
statement(pnd)
[ %persistent
';' statement(&nd)
{ register struct node *nd1 = dot2node(Link, *pnd, nd);
';'
statement(&nd)
{ nd1 = dot2node(Link, *pnd, nd);
*pnd = nd1;
nd1->nd_symb = ';';
pnd = &(nd1->nd_right);