Parser Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
shpric002
Knows some wx things
Knows some wx things
Posts: 43
Joined: Thu Jun 23, 2005 8:30 am

Parser

Post by shpric002 »

Hi All,

Can anyone tell me if WX contains a parser (e.g. recursive descent parser)?

I know there is wxRegEx for regular expressions, but for more complex grammar's a full parser would be nice.

regards,
"Programming today is a race between software engineers striving to build bigger and better idiot-proff programs, and the Universe trying to produce bigger and better idiots. So far the Universe is winning." -- Rich Cook
phlox81
wxWorld Domination!
wxWorld Domination!
Posts: 1387
Joined: Thu Aug 18, 2005 7:49 pm
Location: Germany
Contact:

Post by phlox81 »

Take a look at boost::spirit
shpric002
Knows some wx things
Knows some wx things
Posts: 43
Joined: Thu Jun 23, 2005 8:30 am

Post by shpric002 »

Hi,

Looked at it but it contains templates, which from the portability point of view is a no no (hence I am using wx toolset).

regards
"Programming today is a race between software engineers striving to build bigger and better idiot-proff programs, and the Universe trying to produce bigger and better idiots. So far the Universe is winning." -- Rich Cook
upCASE
Moderator
Moderator
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE »

Hi!
Although I'm not really sure, I guess Jorg was writing a parser or a wrapper to one. Unfortunatly his site has no link to them anymore.

Maybe ask him directly.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda
Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg »

I am working on wxLexer. It is a lexical expandable token analyzer. I did not write a recursive descendent parser yet however it can be made easier when my wxLexer is finished. It is based upon tokens that have only knowledge of a buffer and examine the input, to return back a token value when they are succesful and nothing when they are not. Every token knows the line pos and column they are found, so error reporting is made easier.

I was looking at writing wxTokenMatcher (that is why it took longer then expected to finish it) which will allow recursive rules, but is not LALR or LRn or whatever technique, it simply analyzes the tokens based upon rules.

If you want contact me directly jorgb [at] xs 4 {spam-go-away} all . nl. I will try to put the source together tonight for you ..

Regards,
- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb
phlox81
wxWorld Domination!
wxWorld Domination!
Posts: 1387
Joined: Thu Aug 18, 2005 7:49 pm
Location: Germany
Contact:

Post by phlox81 »

shpric002 wrote:Hi,

Looked at it but it contains templates, which from the portability point of view is a no no (hence I am using wx toolset).

regards
spirit is very powerful. And i don't understand why you can't use it,
with wx toolset ? You could implement your own Parserclasses with
spirit, independent from wx or any other Library.

phlox
shpric002
Knows some wx things
Knows some wx things
Posts: 43
Joined: Thu Jun 23, 2005 8:30 am

Post by shpric002 »

Hi,

The latest boost::spirit does not compile under MSVC6 :( because of the use of templates. Probably a few other compilers would also have compiler problems.

regards
"Programming today is a race between software engineers striving to build bigger and better idiot-proff programs, and the Universe trying to produce bigger and better idiots. So far the Universe is winning." -- Rich Cook
phlox81
wxWorld Domination!
wxWorld Domination!
Posts: 1387
Joined: Thu Aug 18, 2005 7:49 pm
Location: Germany
Contact:

Post by phlox81 »

shpric002 wrote:Hi,

The latest boost::spirit does not compile under MSVC6 :( because of the use of templates. Probably a few other compilers would also have compiler problems.

regards
Shouldn't use such an old Compiler.
There are a lot of free alternatives, even on windows.
(MingW / Free MS Compiler + Codeblocks)
lowjoel
Part Of The Furniture
Part Of The Furniture
Posts: 1511
Joined: Sun Jun 19, 2005 11:37 am
Location: Singapore
Contact:

Post by lowjoel »

may i ask what do you intend your parser to do? I wrote a mathematical expression parser (my m8 will be doing a SQL-like interface for dicrect dad manipulation).
shpric002
Knows some wx things
Knows some wx things
Posts: 43
Joined: Thu Jun 23, 2005 8:30 am

Post by shpric002 »

Hi,

It is needed to parse a test file containing "tags" that ctags generates. Later it will be needed to parse more complicated files, that need more than a simple text search (i.e. parsing a defined language).


regards
"Programming today is a race between software engineers striving to build bigger and better idiot-proff programs, and the Universe trying to produce bigger and better idiots. So far the Universe is winning." -- Rich Cook
prophet
Knows some wx things
Knows some wx things
Posts: 32
Joined: Wed Sep 01, 2004 6:19 am

Post by prophet »

shpric002 wrote:Hi,

Looked at it but it contains templates, which from the portability point of view is a no no (hence I am using wx toolset).

regards
Templates are very portable, i think wx is also moving toward templates and stl. VS6 has alot of problems with c++, it uses very old c++ standards, microsoft's newer compilers are much better.
Post Reply