Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 6th, 2005, 8:44 AM   #1
mikaoj
Programmer
 
mikaoj's Avatar
 
Join Date: Aug 2005
Location: Norway
Posts: 56
Rep Power: 0 mikaoj is an unknown quantity at this point
Hello Folks! One question about Compiler-compiler

Hello!

This is my second thread here. My first thread was wrong placed and little messed up.

So, I'm new here!

But I have a question!

Is Compiler-compiler used to let you make your own Compilers?

Excuse my English. I'm from Norway.
__________________
Heh.
mikaoj is offline   Reply With Quote
Old Aug 6th, 2005, 8:46 AM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Yes, generally in conjunction with other tools such as lexical analyzers. Welcome.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Aug 6th, 2005, 10:26 AM   #3
darkone916
Hobbyist Programmer
 
darkone916's Avatar
 
Join Date: Jul 2005
Location: Oman
Posts: 125
Rep Power: 4 darkone916 is on a distinguished road
Send a message via MSN to darkone916
welcome ... i never heard about a compiler-compiler.
__________________
From the bottom of the stone steps...
...i'm calling still.
darkone916 is offline   Reply With Quote
Old Aug 6th, 2005, 10:56 AM   #4
prolog
Programmer
 
Join Date: Jul 2005
Location: Germany
Posts: 69
Rep Power: 4 prolog is on a distinguished road
Welcome,

and i think this is topic is the wrong place for your question again

i think what u mean is a parser generator. It takes more to build a compiler than parsing correct syntax (lexical-analysis,semantic-actions and so on).

Usually compilerbuilders build a "dirty" compiler in a different language than the one the compiler is supposed to compile. They then use this dirty compiler to compile a compiler written in the language the compiler is supposed to compile. This is called boot-strapping. So this dirty compiler is what i call a compiler-compiler gg
__________________
-= C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do succeed, you will blow away your whole leg. =- Bjarne Stroustrup
prolog is offline   Reply With Quote
Old Aug 6th, 2005, 11:47 AM   #5
mikaoj
Programmer
 
mikaoj's Avatar
 
Join Date: Aug 2005
Location: Norway
Posts: 56
Rep Power: 0 mikaoj is an unknown quantity at this point
I read some place that Pascal was built for making Compilers.
My dream is to make a powerfull Compiler, there is one goal: To make your own Compilers.
__________________
Heh.
mikaoj is offline   Reply With Quote
Old Aug 6th, 2005, 2:05 PM   #6
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
One of the early Unix utilities was YACC, which stands for "Yet Another Compiler Compiler."
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Aug 6th, 2005, 7:46 PM   #7
prolog
Programmer
 
Join Date: Jul 2005
Location: Germany
Posts: 69
Rep Power: 4 prolog is on a distinguished road
@DaWei nomen est (not allways) omen.

I think the naming is a bit confusing as , and i'm sure u know that, yacc which is a predecessor of bison just eats in grammar-files and spits out a parser written in C.
It does not a compile a compiler or things like that.

The grammarsyntax is very similar to BNF or EBNF i believe, though my bison-times are over for a fair few years by now. I don't know it for sure but i think yacc produces a bottom-up (shift-reduce)-parser as it is capable of handling left-recursion as far as i'm concerned. But again you do not have a full-blown compiler just by generating a parser.
__________________
-= C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do succeed, you will blow away your whole leg. =- Bjarne Stroustrup
prolog is offline   Reply With Quote
Old Aug 6th, 2005, 9:11 PM   #8
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Quote:
One of the early Unix utilities was YACC, which stands for "Yet Another Compiler Compiler."
That's hardly a tutorial. Since I haven't even looked at it since the early '80s, and my memory has gone to hell in a handbasket, I can't comment on anything but the name .
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:18 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC