Re: [Spirit-general] Re: [boost] Re: spirit and compile speed

2003-02-08 Thread Juan Carlos Arevalo-Baeza
On Fri, 10 Jan 2003 11:22:23 +, Vincent Finn wrote:

>>>I have added 2 parsers to my code base and the compile time (VC6) has
>>>gone from 10 mins to 30mins :-(
>>At the very least, yes, you can separate the parsers from the project.
>>How about writing some wrappers that *hides* the grammars in
>>*.cpp files? You can for example have an opaque API in a header
>>such as:
>>
>>bool parse(char const* source);
>
>That seems obvious now that you say it
>I was thinking in terms of spliting spirit off which causes problems but
>, as you say, all I need is to build a lib with my parser in so that
>spirit is hidden.

   This is kind of late (a month), but if you want a working example of this, I just 
updated and checked in my C++ lexer example into the Boost CVS. The lexer itself is 
implemented using Spirit grammars, and it's separated from its users by an opaque 
interface kind of like the one Joel describes.

   Now I'm in the process of cleaning it up and adding a few features, like making it 
multi-layered (lexer -> preprocessor -> parser, with all the layers separated from 
each other), so I'll check it in as soon as I'm done.

   Salutaciones,
JCAB
email: [EMAIL PROTECTED]
ICQ: 10913692 @WORK: 101728263
WWW: http://www.JCABs-Rumblings.com

___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost



Re: [boost] In the Spirit of Challenge

2002-11-08 Thread Juan Carlos Arevalo-Baeza
On Thu, 7 Nov 2002 18:09:03 -0800, Noah Stein wrote:

>I believe this is already under way.  Juan Carlos Arevalo-Baeza (JCAB for
>short) is currently in the middle of implementing a C++ parser.  I believe
>he even has error support already.  If he's not active on Boost, I would
>suggest looking for him over on the Spirit list.

   :) Thanks, Noah. I don't usually follow Boost. Too much traffic for me to deal 
with. But Joel alerted me of this thread (thanx).

On Thu, 07 Nov 2002 21:47:31 -0500, David Abrahams wrote:

>>2. This is the biggie - how about writing a full-fledged C++ parser (with
>>symbol tables!) in Spirit? Now that would be cool...
>
>That's a work-in-progress, AFAIK.

   Kinda. There's a first try, based on Hartmut's C grammar, which was doomed to fail. 
And then there's a fairly complete lexer (which just ignores directives) and a test 
that uses it for parsing names with scopes, including a first pass at a scope database 
with proper update and lookup semantic actions, so it can be used by the parser.

>I think once you get a C++ parser
>you'll probably discover it's not all that useful without something
>which can represent the type system.

   That is absolutely correct. You need to have access to the current set of 
definitions (types, variables, functions, classes...) in order to parse C++ correctly.

>And then you pretty much
>implement the whole template machinery... well, I think you can guess
>what kind of project that turns into.

   I still think it's doable. I'll keep working on it, off and on. At this rate, it 
should be ready in about... er... 5 to 10 years O:-)

   Salutaciones,
JCAB
email: [EMAIL PROTECTED]
ICQ: 10913692 @WORK: 101728263
WWW: http://www.JCABs-Rumblings.com

___
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost