From 4b40bae4677cbdc872ea294644851f6c84aec896 Mon Sep 17 00:00:00 2001 From: ceriel Date: Fri, 11 Jan 1991 14:36:37 +0000 Subject: [PATCH] made acceptable for flex (no yyless() callable from other source file) --- modules/src/em_opt/parser.g | 2 +- modules/src/em_opt/syntax.l | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/src/em_opt/parser.g b/modules/src/em_opt/parser.g index 4f5220482..bb81999c7 100644 --- a/modules/src/em_opt/parser.g +++ b/modules/src/em_opt/parser.g @@ -487,7 +487,7 @@ LLmessage(insertedtok) fprintf(stderr,"parser: syntax error on line %d: ",linenum); if(insertedtok) { fprintf(stderr,"Inserted token %d\n",insertedtok); - yyless(0); + back_token(); } else fprintf(stderr,"Deleted token %d\n",LLsymb); } diff --git a/modules/src/em_opt/syntax.l b/modules/src/em_opt/syntax.l index 7cb7dda7b..510ca2661 100644 --- a/modules/src/em_opt/syntax.l +++ b/modules/src/em_opt/syntax.l @@ -58,3 +58,8 @@ offset return(OFFSET); \n { linenum++; return(yytext[0]);} . return(yytext[0]); %% + +back_token() +{ + yyless(0); +}