[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Lexical Analyzer and parser for C/C++

Posted on 2004-11-03
8
Medium Priority
?
653 Views
Last Modified: 2008-02-01
I need lexical analyzer and parser that deals with our own language. lexical and parser can be in c/c++.

keywords will be our own like for int, myint and for char, mychar and so on

Thanks.

0
Comment
Question by:zeeshansaleem
5 Comments
 
LVL 12

Accepted Solution

by:
andrewjb earned 128 total points
ID: 12491632
I really like the one from BumbleBeeSoftware.com, and it's only $60. An O-O implementation of lex and yacc, basically.

0
 
LVL 22

Assisted Solution

by:grg99
grg99 earned 124 total points
ID: 12493403
Try googling "tiny c compiler source".  You'll find lots of hits.  OF COURSE do NOT just steal the source... look it over and get the general idea of how it's done, then write your own.

BTW watch out:  there's two ways to do it:  doing all the lexical stuff yourself, or using tools like lex and/or yacc to do some of the work.  Make sure you choose the correct path before starting out!

0
 
LVL 2

Assisted Solution

by:pb_india
pb_india earned 124 total points
ID: 12493974
Refer to this site.
It has lexical analyser and parser sample code. Very helpful.

http://www.codeguru.com/Cpp/Cpp/cpp_mfc/parsing/article.php/c871/
0
 

Assisted Solution

by:AniOnLine
AniOnLine earned 124 total points
ID: 12532448
Try http://spirit.sourceforge.net/

Spirit is a C++ templates library that can be used to implement language parsers.
It is a very good tool (a bit involved though).

Ani
0
 
LVL 12

Expert Comment

by:andrewjb
ID: 12752691
PAQ it at least. Don't delete!
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

834 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