Solved

C grammer for YACC

Posted on 2000-02-23
4
278 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 200 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
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.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

739 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