FAQ
[Forgot recdescent on mail list, thought it might be good to archive.]

On Friday, Jun 11, 2004 Aamer Akhter said:
On Jun 11, 2004, at 11:49 AM, Ron D. Smith wrote:

On Friday, Jun 11, 2004 Aamer Akhter said:
Hello,

Is there a way to detect that prd ran into an error?
The answer to your question is so obvious that I suspect you are either
really asking a different question or that "I don't get it".
I may not have explained properly. Here is an example of the error I
was getting:

ERROR (line 123): Untranslatable item encountered: ".*?)\n/"
(Hint: Set $::RD_HINT (or -RD_HINT if you're using
"perl -s")
for hints on fixing these problems.)

But Parse::RecDescent definitely returns something:

use Data::Dumper; print Dumper (Parse::RecDescent->new($grammar));
exit

gives me:

$VAR1 = bless( {
'_AUTOTREE' => undef,
'localvars' => '',
'startcode' => '',
'_check' => {
'thisoffset' => '',
'itempos' => '',
'prevoffset' => '',
'prevline' => '',
'prevcolumn' => '',
'thiscolumn' => ''


should this case have returned a undef instead?
Um, I'm not sure, actually. I would have thought so but I have never had to
code a script where I anticipated failure AS A NORMAL OPERATION. (In other
words, I have had lots of problems in debug, but once it worked, it just
worked...)

Perhaps it has something to do with the fact that you are using autotree.

Can you supply a simple test case? Its hard to see what might be happening
based on the extracted snippets from above.

Perhaps one of the Gurus can weigh in?
--
Aamer Akhter / aa@cisco.com
NSITE cisco Systems
- --
Intel, Corp.
5000 W. Chandler Blvd.
Chandler, AZ 85226

- --
Intel, Corp.
5000 W. Chandler Blvd.
Chandler, AZ 85226


------- End of Forwarded Message


--
Intel, Corp.
5000 W. Chandler Blvd.
Chandler, AZ 85226



--
Intel, Corp.
5000 W. Chandler Blvd.
Chandler, AZ 85226

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprecdescent @
categoriesperl
postedJun 11, '04 at 6:12p
activeJun 11, '04 at 6:12p
posts1
users1
websitemetacpan.org...

1 user in discussion

Ron D. Smith: 1 post

People

Translate

site design / logo © 2018 Grokbase