 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Martin Harvey (Demon Acco Guest
|
Posted: Mon Feb 07, 2005 12:41 am Post subject: Streaming systems: CoCo/R rocks! |
|
|
Hey folks,
Thanks for previous feedback concerning my comments on object
streaming systems. I've spent this weekend evaluating CoCo/R (a lexer
and parser generator) for Delphi.
I'm pleased to say, it rocks! Since it generates a recursive descent
parser (not a table driven one) it's much easier to understand than
those generated with TP Lex/Yacc. Additionally, the Delphi specific
extensions and default code template mean that it's nicely OO
encapsulated and works with streams. All in all, a nice piece of kit,
and with it, it's going to be very easy to construct what I need.
Right - time to crack on with my intermediate object representation
:-)
MH.
|
|
| Back to top |
|
 |
mamcx Guest
|
|
| Back to top |
|
 |
Martin Harvey (Demon Acco Guest
|
Posted: Fri Feb 11, 2005 11:58 pm Post subject: Re: Streaming systems: CoCo/R rocks! |
|
|
On Fri, 11 Feb 2005 10:43:53 -0500, mamcx <thismail (AT) notexist (DOT) com>
wrote:
Well, there are 2 issues:
1. It's not Java ... it looks like the input to a Java version of
LEX/YACC.
2. Unfortunately, I don't think so, because your grammar includes:
LOOKAHEAD(2), and I suspect CoCo/R only translates LL(1) grammars.
Having said that, you could work your way around it, but it requires
an understanding of parser design.
I suggest you get an EBNF description of the grammar (which you can
cut out of that file), and then start from scratch.
MH.
|
|
| Back to top |
|
 |
mamcx Guest
|
Posted: Tue Feb 15, 2005 2:02 pm Post subject: Re: Streaming systems: CoCo/R rocks! |
|
|
| Quote: | I suggest you get an EBNF description of the grammar (which you can
cut out of that file), and then start from scratch.
|
Ok, so how understand it? How "code" it? I read a lot this days but not
can get it... i not found a simple step-by-step guide... so I tink in
build this using regular expressions....
|
|
| Back to top |
|
 |
Martin Harvey (Demon Acco Guest
|
Posted: Tue Feb 15, 2005 11:27 pm Post subject: Re: Streaming systems: CoCo/R rocks! |
|
|
On Tue, 15 Feb 2005 09:02:45 -0500, mamcx <thismail (AT) notexist (DOT) com>
wrote:
| Quote: | Ok, so how understand it? How "code" it? I read a lot this days but not
can get it... i not found a simple step-by-step guide... so I tink in
build this using regular expressions....
|
I'd suggest that instead of using that parser (which is *not* simple
to understand), you get a description of the query language... i.e. a
specification, NOT code, and then download CoCo/R or TP lexx and Yacc,
and work through some examples.
e.g.: start out by writing a parser to parse arithmetic expressions,
like (1 + 2) * 3 and then work on from there.
MH.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|