Related articles |
---|
Parser generator for package based protocols torbjoern.mattsson@gmail.com (2006-04-28) |
Re: Parser generator for package based protocols cfc@shell01.TheWorld.com (Chris F Clark) (2006-04-30) |
Re: Parser generator for package based protocols DrDiettrich@compuserve.de (Hans-Peter Diettrich) (2006-05-09) |
Re: Parser generator for package based protocols Meyer-Eltz@t-online.de (Detlef Meyer-Eltz) (2006-05-12) |
From: | Chris F Clark <cfc@shell01.TheWorld.com> |
Newsgroups: | comp.compilers |
Date: | 30 Apr 2006 18:36:46 -0400 |
Organization: | The World Public Access UNIX, Brookline, MA |
References: | 06-04-169 |
Keywords: | lex, parse |
Posted-Date: | 30 Apr 2006 18:36:46 EDT |
torbjoern.mattsson@gmail.com asked:
> It seems like it should be a much simpler problem writing parsers for
> this case than for languages like C so I would think that there should
> exist numerous free tools to do this but so far I have found none! All
> parser generators seems to require that the syntax can be described in
> a way where tokens are separated by delimiter characters.
>
> Are there really no tools for this, or are I seraching with the wrong
> terminology?
Although the problem isn't that "hard", it is outside what most lexers
handle. The problem is that the FSM solution for the problem is very
inefficient. One makes lots of states in the process of creating an
FSM that solves the problem, where what is really wanted is a few
states and some separate counter registers. Where you are likely to
find a solution to your problem is in a Perl Compatible Regular
Expression library. You pay an interpretation price for using such a
library, so it isn't a complete solution. What you want (and as far
as I am aware) it doesn't exist yet is a "Perl Compatible Lexer
Generator". We have roughly enough technology to solve this problem
today, but no one has written one yet--there was a recent thread which
referenced the work or Lauri Kari who has essentially solved the last
remaining theoretical problem. It's just that no one (as far as I
know) has taken that work, filled in all the details and released such
a tool. Note when somone does you will get more than what you are
asking, but I doubt that will be a problem. (I myself am working on
such a beast, but it is a spare time project and I have less of that
than I want.)
Hope this helps,
-Chris
*****************************************************************************
Chris Clark Internet : compres@world.std.com
Compiler Resources, Inc. Web Site : http://world.std.com/~compres
23 Bailey Rd voice : (508) 435-5016
Berlin, MA 01503 USA fax : (978) 838-0263 (24 hours)
------------------------------------------------------------------------------
[I suppose an alternative would be to use flex and do the counting in
C action code. -John]
Return to the
comp.compilers page.
Search the
comp.compilers archives again.