Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am studying the bison ( yacc ), but I have a doubt, how can I make processing files included in the source (# include) and how can I create functions and to analyze and yacc generate the code for these functions ?

I made a simple test code: https://github.com/bencz/YaccStudy

but, don't have the function system and #include system... I just tried to make, but did it wrong, it gave error at compile time, and when compiled, it did not work ... then deleted the sources that had these changes, and made ​​a new...
Posted
Comments
KarstenK 25-Jul-13 7:50am    
It is confusing what you write. Make at first step a professionell plan what you want to do.

http://en.wikipedia.org/wiki/Unified_Modeling_Language
Alexandre Bencz 25-Jul-13 8:03am    
Sorry... so, I whant to create the function system using the Yacc, and, how I can create the #include system using the Yacc...

1 solution

It has been a long time since I have used YACC and I have never used bison.
Maybe this will help...

C#
inc_def   : INC        {printf("#include <%s>\n",yytext);}
          ;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900