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


Lexical Analyzer and parser for C/C++

Posted on 2004-11-03
Medium Priority
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


Question by:zeeshansaleem
LVL 12

Accepted Solution

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.

LVL 22

Assisted Solution

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!


Assisted Solution

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


Assisted Solution

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).

LVL 12

Expert Comment

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

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