From 474b2eb453c7aa15f0904635a58c21f39bade6b4 Mon Sep 17 00:00:00 2001 From: kaashoek Date: Wed, 3 Feb 1988 10:47:08 +0000 Subject: [PATCH] Previous version saw C_INSTR CONDITION as CALL ( e.g. C_asp ( $1 == 1) ). --- util/ceg/EM_parser/common/mylex.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/util/ceg/EM_parser/common/mylex.c b/util/ceg/EM_parser/common/mylex.c index 373bfb650..667737362 100644 --- a/util/ceg/EM_parser/common/mylex.c +++ b/util/ceg/EM_parser/common/mylex.c @@ -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 * CONDITION. */ +int CALL_pos = FALSE; /* Needed to distinguish between + * C_INSTR CONDITION and CALL + */ @@ -65,6 +68,7 @@ int mylex() */ if ( special) CD_pos = TRUE; + CALL_pos = FALSE; return( '.'); } break; @@ -73,12 +77,14 @@ int mylex() case '=' : if ( arrow()) { CD_pos = FALSE; + CALL_pos = TRUE; return( ARROW); } break; case ':' : if ( equiv()) { CD_pos = FALSE; + CALL_pos = TRUE; return( EQUIV); } break; @@ -102,14 +108,19 @@ int mylex() } if ( isalpha( c)) { read_ident(); - c = skip_space(); - if ( c == '(') { - *next++ = c; - read_call(); - return( CALL); + if ( CALL_pos) { + c = skip_space(); + if ( c == '(') { + *next++ = c; + read_call(); + return( CALL); + } + else { + backc( c); + return( ERROR); + } } else { - backc( c); if ( is_DEF_C_INSTR( yytext)) { CD_pos = TRUE; return( DEF_C_INSTR);