help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getting a copy of all characters flex has processed


From: John P. Hartmann
Subject: Re: getting a copy of all characters flex has processed
Date: Fri, 26 Apr 2019 16:15:54 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1

Not what you asked for (each keystroke individually), but look into

#define YY_USER_ACTION

It has ytext and yyleng for you.

On 4/26/19 11:26, Rainer Gerhards wrote:
Hi there,

sorry if there is an obvious solution - I didn't find it.

I have a config file parser created with flex/bison. It includes
"include" functionality. Includes works with files as well as
user-provided strings (via yy_scan_buffer()).

As an end-user debugging tool, I would like to optionally generate a
single output file which contains the full configuration with the
includes expanded.

E.g. I have
file1:
f1l1
f1l2
include file 2
f1l3
include text "included text"
f1l4

file2:
f2l1

Output file should be:
f1l1
f1l2
f2l1
f1l3
included text
f1l4

I would like to generate that output file during regular configuration
processing. So in short I need a capability to see each character that
flex processes at exactly the time it processes the character. I did
not find a documented override to do this.

Is there any way to handle this with flex?

Any help is deeply appreciated.
Rainer

_______________________________________________
address@hidden https://lists.gnu.org/mailman/listinfo/help-bison




reply via email to

[Prev in Thread] Current Thread [Next in Thread]