Solved

C grammer for YACC

Posted on 2000-02-23
4
243 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
  • 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
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 and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now