Parse::RecDescent::FAQ

Parse::RecDescent::FAQ is the official, authorized FAQ for Parse::RecDescent.
Download

Parse::RecDescent::FAQ Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Terrence Brannon
  • Publisher web site:
  • http://search.cpan.org/~tbone/

Parse::RecDescent::FAQ Tags


Parse::RecDescent::FAQ Description

Parse::RecDescent::FAQ is the official, authorized FAQ for Parse::RecDescent. Parse::RecDescent::FAQ is the official, authorized FAQ for Parse::RecDescent.OVERVIEW-TYPE QUESTIONSIs Parse::RecDescent LL(1)? LL(N)? LR(1)? LR(N)?Answer by Yves Orton:I have a data structure which isa hash of entries where an entry is a list/array of setsI have also a grammar that can parse the syntax of the text files that contain the data I want to fill this structure with. Until here everything is ok.Problem: I cannot figure out how to actually FILL the parsed data into the structure. I can only decide if a string is grammatically correct or not.Also see the "Left-recursion" section under "PARSER BEHAVIOR"DEBUGGINGFlags you can setParaphrased from Yves Orton:To understand more about why your parser is not behaving as it should take advantage of the follow variables: $::RD_ERRORS # unless undefined, report fatal errors $::RD_WARN # unless undefined, also report non-fatal problems $::RD_HINT # if defined, also suggestion remedies $::RD_TRACE # if defined, also trace parsers' behaviourMaking warning line numbers correspond to your grammarHow do I match the line numbers with the actual contents of my script?At present, you can't (but that's on the ToDo list). Setting $::RD_TRACE can be useful though:Once you've run with $RD_TRACE, do this: perl -w RD_TRACEThen go and examine the actual line numbers given for the error in the file RD_TRACE.That will show you the actual generated code that's the problem.That code will, in turn, give you a hint where the problem is in the grammar (e.g. find out which subroutine it's in, which will tell you the name of the offending rule). Requirements: · Perl


Parse::RecDescent::FAQ Related Software