[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Solution to a Flex problem
From: |
Steve Litt |
Subject: |
Solution to a Flex problem |
Date: |
Tue, 12 Dec 2023 03:06:42 -0500 |
Hi all,
I know this is a Bison and not a Flex venue, but just in case somebody
experiences the deletion of the letter "s" from their Bison output,
here's how I solved this symptom by changing my Flex program...
Originally my Flex program had the following:
\s*\n {strcpy (yylval.y_char, yytext); return NL; }
I was ignoring all whitespace at the end of every line. But my parser
deleted the letter "s" from the output. So I made the following change:
[ \t]*\n {strcpy (yylval.y_char, yytext); return NL; }
After the preceding change, all occurrences of "s" were passed through.
I hope this helps somebody.
SteveT
Steve Litt
Autumn 2023 featured book: Rapid Learning for the 21st Century
http://www.troubleshooters.com/rl21
- Solution to a Flex problem,
Steve Litt <=