?
Solved

C grammer for YACC

Posted on 2000-02-23
4
Medium Priority
?
285 Views
Last Modified: 2010-04-15
I need C grammer for YACC. It would be better if I also have code for a parser for it (which I can interface with a lexer).
What I am trying to do is to make a C to Pascal converter. I have made the lexer. Next I want to make the parser. And then the unparser. I am keen on keeping all these stages isolated. So I want a clean grammer code for YACC.
Thanks
0
Comment
Question by:pankajgupta
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 2552249
You can download the source code to GCC, the GNU C compiler from many places.  It uses YACC (actually bison) and is a good example that is readily available.
0
 
LVL 5

Accepted Solution

by:
laeuchli earned 800 total points
ID: 2552514
0
 

Author Comment

by:pankajgupta
ID: 2557962
Thanks!
Though I also need to know what exactly should be done in the parser phase of the compiler except just parsing the language! I mean like handling the symbol table and stuff like that. But this was helpful!
0
 

Author Comment

by:pankajgupta
ID: 2557963
Thanks!
Though I also need to know what exactly should be done in the parser phase of the compiler except just parsing the language! I mean like handling the symbol table and stuff like that. But this was helpful!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question