Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

multi threaded bison: yyerror
Hi,

I'd like to upgrade my flex/bison generated parser to a multi threaded
(pthreads) parser. I know that I have to create a reentrant flex
wrapper and use %pure_parser in bison.

I need to stop parsing (and do some other things) whenever a syntax
error occurs. However yyerror(...) does not have any parameter which
would help to find out in which thread the syntax error occured. I
could use pthread_self() and associate the necessary data with the
thread id, but this solution seems somewhat awkward. Is there a better
way to do it?

Thanks in advance,
Tamas Sarlos,
Budapest, Hungary

Report this thread to moderator Post Follow-up to this message
Old Post
Tamas Sarlos
07-29-04 02:08 AM


Re: multi threaded bison: yyerror
> error occurs. However yyerror(...) does not have any parameter which
> would help to find out in which thread the syntax error occured.

Hi Tamas,

#define yyerror(s) yyerror_r(s, thread_specific_info)

-John M

Report this thread to moderator Post Follow-up to this message
Old Post
John Millaway
08-05-04 08:59 PM


Re: multi threaded bison: yyerror
On Wed, 28 Jul 2004, Tamas Sarlos wrote:


>
> I'd like to upgrade my flex/bison generated parser to a multi threaded
> (pthreads) parser.

...

> Is there a better
> way to do it?


I suggest using thread-specific data (pthread_key_create(),
pthread_setspecific() and pthread_getspecific()).

In my parser, the object passed to `yyparse()' via a `void*' contains
a pointer to the object containing the thread-specific data, so I don't actu
ally
need to call `pthread_getspecific()' very often.

If you want to look at my code, it's available under
http://savannah.gnu.org/cgi-bin/vie...df/3dldf/Group/

Laurence Finston
GNU 3DLDF maintainer
http://www.gnu.org/software/3dldf

Report this thread to moderator Post Follow-up to this message
Old Post
Laurence Finston
08-05-04 08:59 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Compilers archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:31 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.