----- Original Message ----
From: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
To: [email protected]
Sent: Wednesday, August 15, 2007 8:00:01 AM
Subject: Delphi Digest, Vol 55, Issue 15
Send Delphi mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.elists.org/mailman/listinfo/delphi
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]
You can reach the person managing the list at
[EMAIL PROTECTED]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Delphi digest..."
Today's Topics:
1. RE: About compiler-compilers, parsers (Cosmin Prund)
2. RE: About compiler-compilers, parsers (Cosmin Prund)
3. RE: About compiler-compilers, parsers (Sid Gudes)
4. RE: About compiler-compilers, parsers (Cosmin Prund)
----------------------------------------------------------------------
Message: 1
Date: Tue, 14 Aug 2007 10:12:56 +0300
From: "Cosmin Prund" <[EMAIL PROTECTED]>
Subject: RE: About compiler-compilers, parsers
To: "Borland's Delphi Discussion List" <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="us-ascii"
On 14 august 2007 00:35
Rob Kennedy wrote:
Subject: Re: About compiler-compilers, parsers
> GNU Flex has a C++ mode, where the lexer it generates is a class
rather
> than a set of global variables and functions. It also lets you provide
> your own yyinput function, where you fill Flex's buffer from whatever
> source you want, including a stream. (In C, you can also simply
provide
> your own FILE* value, which is usually a file, but can also be any
> other C
> file handle.)
Unfortunately Delphi will not compile C++ so that's a bit more difficult
to use. I might be able to use a secondary compiler to compile the
parser and then link that into Delphi but then I'll need to write all my
data structures twice, that's not something I'm looking forward to.
Especially since C++ is like French to me: I can read it but I can only
write it with a dictionary.
>
> > (2) Are there any other tools similar to lex/yacc, commercial or
> open
> > source that can generate Delphi code? I've been following a few
other
> > parser projects but they don't generate Delphi code.
>
> Mike Lischke's Delphi Compiler Generator is based on TP Lex. Have you
> looked at it yet?
This project? http://www.grendelproject.nl/dyacclex/
I'm using a hacked version right now. I've modified it so the generated
files are class-based and it works, also it's *UGLY* - because I only
modified the libraries (lexlib and yacclib) and the .cod files; Anyway,
with all its ugliness it's an good system, it works fine. Looking
forward for a bigger project to test my new tools!
>
> You might try asking on the comp.compilers newsgroup.
>
I just registered to the email variant of comp.compilers newsgroup.
Thanks for the tip!
--
Cosmin Prund
------------------------------
Message: 2
Date: Tue, 14 Aug 2007 11:26:33 +0300
From: "Cosmin Prund" <[EMAIL PROTECTED]>
Subject: RE: About compiler-compilers, parsers
To: "Borland's Delphi Discussion List" <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="us-ascii"
Visual Parse++ looks like a really, really nice application.
Unfortunately I haven't been able to trial it before. I requested a
trial key about one year ago, but never got my answer back. I sent a new
email today. I'll wait a couple of days and send a fax if I don't get an
answer.
Anyway, are you using it with Delphi? Have you ever used lex+yacc? Does
it offer anything extra compared to those, except a visual editor and a
debugger?
Thanks for reminding me of Visual Parse++
--
Cosmin Prund
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
> Behalf Of Sid Gudes
> Sent: 13 august 2007 19:20
> To: Borland's Delphi Discussion List
> Subject: Re: About compiler-compilers, parsers
>
> Hi Cosmin,
>
> Take a look at Visual Parse++ at www.sand-stone.com. It provides lex
> and yacc functionality, and its run-time is native Delphi (or several
> other languages, you choose the target), so no DLL or ActiveX
> needed. It's not freeware or shareware, but not too pricey. We've
> been using it for almost 10 years and it works just great.
>
> It does accept input from several types of sources, including
> pchars. I've never tried to run multiple simultaneous instances, but
> it should work. It basically consists of 3 classes: a parser, a
> lexer, and a consumer (where the lexer gets it string data
> from). Since you can create as many instances of these classes as
> you want, there should be no problem running multiple simultaneous
> parsers.
>
> It also includes a visual interactive debugger, so you can debug your
> parser rules visually, which is a real time-saver. Note that the
> grammar is generated to a resource file (that you can include as a
> resource in your .exe or load as an individual file), so the Delphi
> code it provides is for a generic lexing/parsing engine, it does not
> generate specific code for the grammar, the grammar is data-driven by
> the resource file.
>
>
> At 12:13 PM 8/12/2007, Cosmin Prund wrote:
> >Hello everyone. I'm about to start a new program that requires an
> parser
> >(possibly complex parser). So I'm asking this question again: What
are
> >the options for an Delphi programmer dealing with parsers? Other then
> TP
> >yacc/lex or the Delphi variants?
> >
> >
> >Different wording:
> >
> >(1) Is there a Delphi clone of the UNIX tools lex and yacc that
> >generates "modern" output? By "modern" I mean something that can
> handle
> >two parsers running simultaneously and allows reading from something
> >other than TEXT files. All lex/yacc clones I've seen depend on a
> >"lexlib" library that's full of global variables and expects
> >input/output to be done on TEXT files. I almost never need to parse
> text
> >files, I'm always parsing text from in-memory "strings" or
TStringList
> >or TStream descendents. Also I expect my lexers/parsers to work in
> >multi-threaded environments so global variables are automatically
> >excluded!
> >
> >(2) Are there any other tools similar to lex/yacc, commercial or
> open
> >source that can generate Delphi code? I've been following a few other
> >parser projects but they don't generate Delphi code.
> >
> >I know I've asked those questions before, and I'll probably ask them
> >again until I'll find a good solution. For now I'm writing all my
> lexers
> >/ parsers by hand and it works but it's a bit messy - especially when
> >it's time to change bits of code that have been written years before!
> >
> >--
> >
> >Thanks,
> >
> >Cosmin Prund
> >_______________________________________________
> >Delphi mailing list -> [email protected]
> >http://www.elists.org/mailman/listinfo/delphi
>
> Regards,
> Sid Gudes
> PIA Systems Corporation
> [EMAIL PROTECTED]
>
>
> _______________________________________________
> Delphi mailing list -> [email protected]
> http://www.elists.org/mailman/listinfo/delphi
------------------------------
Message: 3
Date: Tue, 14 Aug 2007 11:44:24 -0600
From: Sid Gudes <[EMAIL PROTECTED]>
Subject: RE: About compiler-compilers, parsers
To: Borland's Delphi Discussion List <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="us-ascii"; format=flowed
At 02:26 AM 8/14/2007, Cosmin Prund wrote:
>Visual Parse++ looks like a really, really nice application.
>Unfortunately I haven't been able to trial it before. I requested a
>trial key about one year ago, but never got my answer back. I sent a new
>email today. I'll wait a couple of days and send a fax if I don't get an
>answer.
I believe they're a small shop, and I've had to call them (rather
than e-mail) in the past to get a response. OTOH once you're past
the learning curve, there's no need to call tech support, it's a very
solid product. (I don't think I've gotten in touch with them for
several years, and the last time was because of a bad product key,
not a technical issue.)
>Anyway, are you using it with Delphi?
Yes, starting with D1 and going forward. It uses 3 classes, and you
basically override the Reduce method in the Yacc class to get at the
parsed tokens and do whatever your target operation is. Calling it
is very simple (following omits error handling and cleanup):
consumer := ssLexStringConsumer.create (pchar(MyString));
lexer := mLexClass.create (consumer, expressLex);
parser := mYaccClass.createLex (lexer, expressYacc);
parser.parse;
In the above, "MyString" is the string to be parsed, "expressLex"
contains the resource file with Lex rules (loaded into RAM), and
"expressYacc" contains the resource file with Yacc rules (loaded into RAM).
>Have you ever used lex+yacc?
Yes, many years ago we used MKS Lex/Yacc in a DLL called by Delphi
(since MKS generates C) before switching to Visual Parse++.
>Does it offer anything extra compared to those, except a visual
>editor and a debugger?
There are several extensions that they added to make certain types of
parsing easier. If you're interested, e-mail me and I can send you a
couple of sample grammars showing these.
>Thanks for reminding me of Visual Parse++
>
>--
>Cosmin Prund
>
>
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
> > Behalf Of Sid Gudes
> > Sent: 13 august 2007 19:20
> > To: Borland's Delphi Discussion List
> > Subject: Re: About compiler-compilers, parsers
> >
> > Hi Cosmin,
> >
> > Take a look at Visual Parse++ at www.sand-stone.com. It provides lex
> > and yacc functionality, and its run-time is native Delphi (or several
> > other languages, you choose the target), so no DLL or ActiveX
> > needed. It's not freeware or shareware, but not too pricey. We've
> > been using it for almost 10 years and it works just great.
> >
> > It does accept input from several types of sources, including
> > pchars. I've never tried to run multiple simultaneous instances, but
> > it should work. It basically consists of 3 classes: a parser, a
> > lexer, and a consumer (where the lexer gets it string data
> > from). Since you can create as many instances of these classes as
> > you want, there should be no problem running multiple simultaneous
> > parsers.
> >
> > It also includes a visual interactive debugger, so you can debug your
> > parser rules visually, which is a real time-saver. Note that the
> > grammar is generated to a resource file (that you can include as a
> > resource in your .exe or load as an individual file), so the Delphi
> > code it provides is for a generic lexing/parsing engine, it does not
> > generate specific code for the grammar, the grammar is data-driven by
> > the resource file.
> >
> >
> > At 12:13 PM 8/12/2007, Cosmin Prund wrote:
> > >Hello everyone. I'm about to start a new program that requires an
> > parser
> > >(possibly complex parser). So I'm asking this question again: What
>are
> > >the options for an Delphi programmer dealing with parsers? Other then
> > TP
> > >yacc/lex or the Delphi variants?
> > >
> > >
> > >Different wording:
> > >
> > >(1) Is there a Delphi clone of the UNIX tools lex and yacc that
> > >generates "modern" output? By "modern" I mean something that can
> > handle
> > >two parsers running simultaneously and allows reading from something
> > >other than TEXT files. All lex/yacc clones I've seen depend on a
> > >"lexlib" library that's full of global variables and expects
> > >input/output to be done on TEXT files. I almost never need to parse
> > text
> > >files, I'm always parsing text from in-memory "strings" or
>TStringList
> > >or TStream descendents. Also I expect my lexers/parsers to work in
> > >multi-threaded environments so global variables are automatically
> > >excluded!
> > >
> > >(2) Are there any other tools similar to lex/yacc, commercial or
> > open
> > >source that can generate Delphi code? I've been following a few other
> > >parser projects but they don't generate Delphi code.
> > >
> > >I know I've asked those questions before, and I'll probably ask them
> > >again until I'll find a good solution. For now I'm writing all my
> > lexers
> > >/ parsers by hand and it works but it's a bit messy - especially when
> > >it's time to change bits of code that have been written years before!
> > >
> > >--
> > >
> > >Thanks,
> > >
> > >Cosmin Prund
> > >_______________________________________________
> > >Delphi mailing list -> [email protected]
> > >http://www.elists.org/mailman/listinfo/delphi
> >
> > Regards,
> > Sid Gudes
> > PIA Systems Corporation
> > [EMAIL PROTECTED]
> >
> >
> > _______________________________________________
> > Delphi mailing list -> [email protected]
> > http://www.elists.org/mailman/listinfo/delphi
>_______________________________________________
>Delphi mailing list -> [email protected]
>http://www.elists.org/mailman/listinfo/delphi
Regards,
Sid Gudes
PIA Systems Corporation
[EMAIL PROTECTED]
------------------------------
Message: 4
Date: Wed, 15 Aug 2007 13:14:12 +0300
From: "Cosmin Prund" <[EMAIL PROTECTED]>
Subject: RE: About compiler-compilers, parsers
To: "Borland's Delphi Discussion List" <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="us-ascii"
Off topic but funny.
I've been trying to call the sand-stone company with no success, they
always gave me a voicemail, not a live person. I thought the company has
"gone under" - till I looked here:
http://www.timeanddate.com/worldclock/city.html?n=103
It was mid night in Hawaii when I was calling!
I guess I'll have to call them tonight from home, so it would be early
morning business hours in Hawaii! Funny thing this globalization.
--
Cosmin Prund
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
> Behalf Of Sid Gudes
> Sent: 14 august 2007 20:44
> To: Borland's Delphi Discussion List
> Subject: RE: About compiler-compilers, parsers
>
> At 02:26 AM 8/14/2007, Cosmin Prund wrote:
> >Visual Parse++ looks like a really, really nice application.
> >Unfortunately I haven't been able to trial it before. I requested a
> >trial key about one year ago, but never got my answer back. I sent a
> new
> >email today. I'll wait a couple of days and send a fax if I don't get
> an
> >answer.
>
> I believe they're a small shop, and I've had to call them (rather
> than e-mail) in the past to get a response. OTOH once you're past
> the learning curve, there's no need to call tech support, it's a very
> solid product. (I don't think I've gotten in touch with them for
> several years, and the last time was because of a bad product key,
> not a technical issue.)
>
> >Anyway, are you using it with Delphi?
>
> Yes, starting with D1 and going forward. It uses 3 classes, and you
> basically override the Reduce method in the Yacc class to get at the
> parsed tokens and do whatever your target operation is. Calling it
> is very simple (following omits error handling and cleanup):
>
> consumer := ssLexStringConsumer.create (pchar(MyString));
> lexer := mLexClass.create (consumer, expressLex);
> parser := mYaccClass.createLex (lexer, expressYacc);
> parser.parse;
>
> In the above, "MyString" is the string to be parsed, "expressLex"
> contains the resource file with Lex rules (loaded into RAM), and
> "expressYacc" contains the resource file with Yacc rules (loaded into
> RAM).
>
> >Have you ever used lex+yacc?
>
> Yes, many years ago we used MKS Lex/Yacc in a DLL called by Delphi
> (since MKS generates C) before switching to Visual Parse++.
>
> >Does it offer anything extra compared to those, except a visual
> >editor and a debugger?
>
> There are several extensions that they added to make certain types of
> parsing easier. If you're interested, e-mail me and I can send you a
> couple of sample grammars showing these.
>
> >Thanks for reminding me of Visual Parse++
> >
> >--
> >Cosmin Prund
> >
> >
> >
> > > -----Original Message-----
> > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> On
> > > Behalf Of Sid Gudes
> > > Sent: 13 august 2007 19:20
> > > To: Borland's Delphi Discussion List
> > > Subject: Re: About compiler-compilers, parsers
> > >
> > > Hi Cosmin,
> > >
> > > Take a look at Visual Parse++ at www.sand-stone.com. It provides
> lex
> > > and yacc functionality, and its run-time is native Delphi (or
> several
> > > other languages, you choose the target), so no DLL or ActiveX
> > > needed. It's not freeware or shareware, but not too pricey.
We've
> > > been using it for almost 10 years and it works just great.
> > >
> > > It does accept input from several types of sources, including
> > > pchars. I've never tried to run multiple simultaneous instances,
> but
> > > it should work. It basically consists of 3 classes: a parser, a
> > > lexer, and a consumer (where the lexer gets it string data
> > > from). Since you can create as many instances of these classes as
> > > you want, there should be no problem running multiple simultaneous
> > > parsers.
> > >
> > > It also includes a visual interactive debugger, so you can debug
> your
> > > parser rules visually, which is a real time-saver. Note that the
> > > grammar is generated to a resource file (that you can include as a
> > > resource in your .exe or load as an individual file), so the
Delphi
> > > code it provides is for a generic lexing/parsing engine, it does
> not
> > > generate specific code for the grammar, the grammar is data-driven
> by
> > > the resource file.
> > >
> > >
> > > At 12:13 PM 8/12/2007, Cosmin Prund wrote:
> > > >Hello everyone. I'm about to start a new program that requires an
> > > parser
> > > >(possibly complex parser). So I'm asking this question again:
What
> >are
> > > >the options for an Delphi programmer dealing with parsers? Other
> then
> > > TP
> > > >yacc/lex or the Delphi variants?
> > > >
> > > >
> > > >Different wording:
> > > >
> > > >(1) Is there a Delphi clone of the UNIX tools lex and yacc
that
> > > >generates "modern" output? By "modern" I mean something that can
> > > handle
> > > >two parsers running simultaneously and allows reading from
> something
> > > >other than TEXT files. All lex/yacc clones I've seen depend on a
> > > >"lexlib" library that's full of global variables and expects
> > > >input/output to be done on TEXT files. I almost never need to
> parse
> > > text
> > > >files, I'm always parsing text from in-memory "strings" or
> >TStringList
> > > >or TStream descendents. Also I expect my lexers/parsers to work
in
> > > >multi-threaded environments so global variables are automatically
> > > >excluded!
> > > >
> > > >(2) Are there any other tools similar to lex/yacc, commercial
> or
> > > open
> > > >source that can generate Delphi code? I've been following a few
> other
> > > >parser projects but they don't generate Delphi code.
> > > >
> > > >I know I've asked those questions before, and I'll probably ask
> them
> > > >again until I'll find a good solution. For now I'm writing all my
> > > lexers
> > > >/ parsers by hand and it works but it's a bit messy - especially
> when
> > > >it's time to change bits of code that have been written years
> before!
> > > >
> > > >--
> > > >
> > > >Thanks,
> > > >
> > > >Cosmin Prund
> > > >_______________________________________________
> > > >Delphi mailing list -> [email protected]
> > > >http://www.elists.org/mailman/listinfo/delphi
> > >
> > > Regards,
> > > Sid Gudes
> > > PIA Systems Corporation
> > > [EMAIL PROTECTED]
> > >
> > >
> > > _______________________________________________
> > > Delphi mailing list -> [email protected]
> > > http://www.elists.org/mailman/listinfo/delphi
> >_______________________________________________
> >Delphi mailing list -> [email protected]
> >http://www.elists.org/mailman/listinfo/delphi
>
> Regards,
> Sid Gudes
> PIA Systems Corporation
> [EMAIL PROTECTED]
>
>
> _______________________________________________
> Delphi mailing list -> [email protected]
> http://www.elists.org/mailman/listinfo/delphi
------------------------------
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi
End of Delphi Digest, Vol 55, Issue 15
**************************************
____________________________________________________________________________________
Be a better Globetrotter. Get better travel answers from someone who knows.
Yahoo! Answers - Check it out.
http://answers.yahoo.com/dir/?link=list&sid=396545469
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi