Previous version saw C_INSTR CONDITION as CALL ( e.g. C_asp ( $1 == 1) ).

This commit is contained in:
kaashoek 1988-02-03 10:47:08 +00:00
parent e8f2566542
commit 474b2eb453

View file

@ -40,6 +40,9 @@ int CD_pos = FALSE; /* 'CD_pos' is used as a flag to signal if it is
* This flag is needed because CALL is a subset of * This flag is needed because CALL is a subset of
* CONDITION. * CONDITION.
*/ */
int CALL_pos = FALSE; /* Needed to distinguish between
* C_INSTR CONDITION and CALL
*/
@ -65,6 +68,7 @@ int mylex()
*/ */
if ( special) if ( special)
CD_pos = TRUE; CD_pos = TRUE;
CALL_pos = FALSE;
return( '.'); return( '.');
} }
break; break;
@ -73,12 +77,14 @@ int mylex()
case '=' : if ( arrow()) { case '=' : if ( arrow()) {
CD_pos = FALSE; CD_pos = FALSE;
CALL_pos = TRUE;
return( ARROW); return( ARROW);
} }
break; break;
case ':' : if ( equiv()) { case ':' : if ( equiv()) {
CD_pos = FALSE; CD_pos = FALSE;
CALL_pos = TRUE;
return( EQUIV); return( EQUIV);
} }
break; break;
@ -102,14 +108,19 @@ int mylex()
} }
if ( isalpha( c)) { if ( isalpha( c)) {
read_ident(); read_ident();
c = skip_space(); if ( CALL_pos) {
if ( c == '(') { c = skip_space();
*next++ = c; if ( c == '(') {
read_call(); *next++ = c;
return( CALL); read_call();
return( CALL);
}
else {
backc( c);
return( ERROR);
}
} }
else { else {
backc( c);
if ( is_DEF_C_INSTR( yytext)) { if ( is_DEF_C_INSTR( yytext)) {
CD_pos = TRUE; CD_pos = TRUE;
return( DEF_C_INSTR); return( DEF_C_INSTR);