Questions tagged [parse-recdescent]

Parse::RecDescent is a large, object-oriented, well-documented Perl 5 module. It incrementally generates top-down recursive-descent text parsers from simple yacc-like grammar specifications. This module is best for learning about parsing, for designing complex (context-sensitive or dynamic) grammars, or any situation where input is short or performance is no issue. For alternatives, try the "official" successor Regexp::Grammars; or Parse::Yapp or Parse::EYapp.

21 questions
1
vote
1 answer

Printing and concatenation with Parse::RecDescent

I am testing the grammar from P::RD tutorial in order to develop my own grammar. I haven't figured out how to print a string declaration and append '$' to the front of it. For example "STRING sDir" should print out "$sDir". It is simple enough to…
Dorian06
  • 49
  • 6
1
vote
1 answer

parsing abnf grammar using perl

Thanks for the inputs for question posted at link Parse::ABNF perl usage . I am still facing difficulty in resolving my problem. Request to check my problem below and provide pointers towards solution. For now I have created the sip grammar in ABNF…
1
vote
2 answers

how to skip all single- and multi-line comments in a Parse::RecDescent parser

In Parse::RecDescent, how do I effectively ignore C++/Java style comments? This includes single-line ('//' until the end of the line) and multi-line (/everything between here/).
Nate Glenn
  • 6,455
  • 8
  • 52
  • 95
1
vote
3 answers

Parse::RecDescent performance issue

I'm using Parse::RecDescent to parse lines in a Cisco IOS ACL. The ACL is used on the edge router of a large network, so it contains almost 8k lines which are set by the government. I'm looping through each of those lines and putting the values…
user342706
0
votes
1 answer

Parse::RecDescent parse sub name

I use module Parse::RecDescent and try to build grammar to catch perl sub name why in my code https://gist.github.com/1595532 not work gramma get_sub: NOWORD TEST NOWORD on '>test1$' ? (variabble $perl_code1 ) use Modern::Perl; use…
0
votes
1 answer

Does a Recursive Predictive Descent Parser NEEDS to construct a complete syntax tree and store in memory?

I've been thinking and a question has arisen. Does this type of compiler really need the complete syntax tree in memory?
1
2