Google Answers Logo
View Question
 
Q: Interface between Perl and Lex and Yacc ( No Answer,   1 Comment )
Question  
Subject: Interface between Perl and Lex and Yacc
Category: Computers > Programming
Asked by: padmapani-ga
List Price: $2.00
Posted: 30 Sep 2004 12:52 PDT
Expires: 12 Oct 2004 11:23 PDT
Question ID: 408492
Hi,

I am currently working on a project to implement a language called "pspec"
Please visit http://pspec.sourceforge.net for further details.
The purpose is to extract information from a log and check for assertions.
The specifications are made in a specific language. The parser is
built using lex and yacc and so far no problems in checking and
parsing the syntax of specifications.

Now to really make this executable I have to digest these specs from a
parse tree and verify them against a arbitrary log.Perl comes to mind
for the speed of text processing.Now whats the best way to interface
this C code which is generated from lex and yacc with that of Perl? Is
Parrot assembly the answer?

Thank You
Paddy
Answer  
There is no answer at this time.

Comments  
Subject: Re: Interface between Perl and Lex and Yacc
From: hdp-ga on 30 Sep 2004 20:48 PDT
 
Parrot assembly is almost certainly not the answer.

There are 3 methods of interfacing between C and Perl that I know of. 
The first is XS, which I understand to be painful and evil, though I
have no experience with it.   XS appears to require you to basically
learn a mini-language to glue C to Perl.  The second is SWIG, which I
know to be painful and evil, because I have experience with it (though
with C and Python, not C and Perl).  The third is Inline::C, which I
know to not be painful and evil, but only on a trivial level; I have
never used it for any in-depth integration work.  However, the author
of Inline::C is a fantastically cool guy, for whatever that's worth.

In any of these cases you will probably have to delve into Perl
internals somewhat in order to be able to pass data back and forth,
but most likely this will be limited to using some of the Perl macros.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy