bison-patches
[Top][All Lists]
Advanced

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

Re: m4sugar


From: Akim Demaille
Subject: Re: m4sugar
Date: Fri, 10 Feb 2006 07:34:11 +0100


Le 10 févr. 06 à 02:35, Bob Rossi a écrit :

[bison patches in CC]

The first place to look at is certainly yacc.c.  Rename it push.c for
instance, and toy with it.  Try to port the work from Odd into it.
Maybe you should try to diff yacc.c and odd's skeleton at that time,
and port that diff to the current yacc.c.

Hi Akim,

At this point, I'm simply trying to understand how m4 is invoked to
create the generated c file from yacc.c. If I run bison with --trace I
see the command
  /usr/bin/m4
/home/bob/download/bison/bison-2.1/target/share/bison/m4sugar/ m4sugar.m4
  - /home/bob/download/bison/bison-2.1/target/share/bison/c.m4
    /home/bob/download/bison/bison-2.1/target/share/bison/yacc.c

Since I'm learning m4 for the first time, I was hoping you could confirm
some of the understanding I have of what's going on above.

Are you sure you are using the CVS version of Bison?  c.m4 should be
included by yacc.c, not fed to m4 by bison.


So, it's getting input from stdin I'm assuming. For each of the rest of
the files, m4 reads them in and remembers all the macro's it has
learned. Probably m4sugar.m4 and c.m4 only contain macro's and yacc.c is
the file that has to be expanded.

Is this a correct assumption?

Correct.


Finally, do you know why the '-' is the second argument to m4 instead of
the first?

Because its stdin uses features defined by m4sugar.m4.

I know this may be trivial stuff, but it's all new to me. I hate to
start editing yacc.c until I have at least a minimal understanding
behind the concepts of m4. After looking at the manual for a while, and
your examples in m4sugar.m4, I'm finally catching on.

Thanks,
Bob Rossi





reply via email to

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