Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
I've learnt C. I'd like to design a Compiler with that.At least just giving off output.I'd like to know at least how to give off output. I'm only familiar with C and will only try to use that. How exactly should I do.What what can I use.

What I have tried:

searching the internet and googling
Posted
Comments
F-ES Sitecore 10-Feb-16 10:12am    
So you've searched google and can't find any articles about how to write a compiler? What kind of "quick answer" are you expecting with this given writing compilers is incredibly complicated and there are libraries devoted to the subject?
jeron1 10-Feb-16 10:50am    
In my mind it's one of those "if you have to ask, you're gonna have trouble" types of topics. It's not for the faint of heart.

If you searched google and found nothing, then your google-fu needs serious practice...
A very quick search - write compiler c - Google Search[^] - found 24 million hits.
Start with some of them, and see what you can learn.
But...if your google-fu is that poor, then actually writing a compiler for any "real-world" programming language is going to be a difficult task - it's a lot of work.

Good luck - you are going to need it! :laugh:
 
Share this answer
 
Comments
Mayur Srivatsen 10-Feb-16 10:54am    
From where Do i start
OriginalGriff 10-Feb-16 11:03am    
Follow the link. There are loads of examples there.
The classical work of Fraser and Hanson might be worth a look: "lcc, A Retargetable Compiler for ANSI C"[^].
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 10-Feb-16 16:49pm    
5ed.
—SA
CPallini 10-Feb-16 16:52pm    
Thank you.
This question fall in a special category which can abstract as:
"If you need to ask, you will be unable to complete. If you can do it, you don't need to ask."

Said otherwise, it is a highly technical task, and you don't learn it over night.

As said in solution 1, you need some serious practice on your Google-fu because with the millions answers, you can't endup with nothing useful.

a few references:
To learn compilers technics: Compilers: Principles, Techniques, and Tools[^]
for faster practice, have a look at Lex & YACC: lex & yacc, 2nd Edition - O'Reilly Media[^]
or: Modern Compiler Implementation in C[^]

The 3 link are books (to give you an idea of the size of the task).

other links
The LEX & YACC Page[^]
http://epaperpress.com/lexandyacc/download/LexAndYaccTutorial.pdf[^]
 
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