BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Streaming systems: CoCo/R rocks!

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OO design
View previous topic :: View next topic  
Author Message
Martin Harvey (Demon Acco
Guest





PostPosted: Mon Feb 07, 2005 12:41 am    Post subject: Streaming systems: CoCo/R rocks! Reply with quote



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





PostPosted: Fri Feb 11, 2005 3:43 pm    Post subject: Re: Streaming systems: CoCo/R rocks! Reply with quote



Sorry for the intromision... you can help me in use it for traslate
http://cvs.apache.org/viewcvs.cgi/jakarta-lucene/src/java/org/apache/lucene/queryParser/QueryParser.jj?view=markup

to delphi?
Back to top
Martin Harvey (Demon Acco
Guest





PostPosted: Fri Feb 11, 2005 11:58 pm    Post subject: Re: Streaming systems: CoCo/R rocks! Reply with quote



On Fri, 11 Feb 2005 10:43:53 -0500, mamcx <thismail (AT) notexist (DOT) com>
wrote:

Quote:
Sorry for the intromision... you can help me in use it for traslate
http://cvs.apache.org/viewcvs.cgi/jakarta-lucene/src/java/org/apache/lucene/queryParser/QueryParser.jj?view=markup

to delphi?

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





PostPosted: Tue Feb 15, 2005 2:02 pm    Post subject: Re: Streaming systems: CoCo/R rocks! Reply with quote

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





PostPosted: Tue Feb 15, 2005 11:27 pm    Post subject: Re: Streaming systems: CoCo/R rocks! Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OO design All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.