Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 132,674 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,201 people online right now. Registration is fast and FREE... Join Now!




source code for scanner in a compiler

 
Reply to this topicStart new topic

source code for scanner in a compiler

hemapriya
post 19 Jul, 2007 - 05:47 PM
Post #1


New D.I.C Head

*
Joined: 19 Jul, 2007
Posts: 1



Thanked 1 times
My Contributions


i'm a third year student.i am asked to do a project on how to write a scanner in c language for testing whether a given regular expression belongs to the grammar or not.the module should also include how to implement NFA and DFA.
User is offlineProfile CardPM

Go to the top of the page

PennyBoki
post 19 Jul, 2007 - 06:03 PM
Post #2


system("revolution");

Group Icon
Joined: 11 Dec, 2006
Posts: 2,009



Thanked 5 times

Dream Kudos: 500

Expert In: Java,C++,C

My Contributions


Hi hemapriya, your project sounds really interesting. Try the code snippets we have here at dream in code, but I'm skeptical about it. But if you do find something please don't hesitate to share with us.
User is offlineProfile CardPM

Go to the top of the page

dogboi
post 19 Jul, 2007 - 07:43 PM
Post #3


D.I.C Head

Group Icon
Joined: 10 Jul, 2007
Posts: 93



Dream Kudos: 25
My Contributions


You might want to look at Bison, the GNU parser generator. I don't recommend you cheat and use the code it generates for your project. Your instructor WILL know. But it might help you work out how it's done.

User is offlineProfile CardPM

Go to the top of the page

Amadeus
post 20 Jul, 2007 - 04:31 AM
Post #4


g++ -o drink whiskey.cpp

Group Icon
Joined: 12 Jul, 2002
Posts: 12,178



Thanked 33 times

Dream Kudos: 25
My Contributions


I'd also suggest the following:

http://en.wikipedia.org/wiki/Compilers:_Pr...es%2C_and_Tools

http://en.wikipedia.org/wiki/Principles_of_Compiler_Design

Taught me how to build a compiler! smile.gif
User is offlineProfile CardPM

Go to the top of the page

NickDMax
post 21 Jul, 2007 - 07:12 PM
Post #5


2B||!2B

Group Icon
Joined: 18 Feb, 2007
Posts: 2,858



Thanked 47 times

Dream Kudos: 550
My Contributions


QUOTE
Taught me how to build a compiler! smile.gif

I bet. biggrin.gif

I have been meaning to write a tutorial on FSM's and other automata for a while now and just can never find the time to do it justice.

you can find some good examples and information here
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 11/23/08 06:25AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month