21 questions
0
votes
1
answer
103
views
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
vote
1
answer
74
views
Parse::RecDescent and operators with quotes
I have something like the following:
((x=2 or y=3 ) and (r=3 and c=3) or (x=5 and g=6))
I defined:
Token : /\w \= \d/
operator or|and
expression : token operator(s)
quoted_expression : "("expression"...
1
vote
1
answer
118
views
Parse::RecDescent and Grammar
I defined the following grammar using Parse::RecDescent
my $grammar = q{
top : operand equal value { print $item{value} }
operand: /\w+/
equal : /\=/
value : { my $value = extract_quotelike($...
4
votes
1
answer
314
views
Disable critic for an entire file - Parse::RecDescent precompiled parser & PerlCritic/Tidyall
I'm trying to remove an error from my sanity-checking [when I push code to my git repo, there's a hook that checks the code with perltidy & critic... using tidyall as the handler.]
The specific ...
1
vote
0
answers
98
views
parsing syntax with Perl
I am using Parse::RecDescent(the below code) to parse something like this
this x=2 and y=2 and z=3
why the below code only print x!=2 and not all the above line (i.e x!=2 and y!=2 and z!=3) even the ...
3
votes
2
answers
253
views
Parse::RecDescent : Parsing nested arithmetic expression?
Currently I use this to parse Arithmetic expressions :
expr : '(' expr ')'
| number op expr
| variable op expr
| number
| variable
| <error>
It works for ...
2
votes
1
answer
185
views
Whitespace-important parsing with Parse::RecDescent (eg. HAML, Python)
I'm trying to parse HAML (haml.info) with Parse::RecDescent. If you don't know haml, the problem in question is the same as parsing Python - blocks of syntax are grouped by the indentation level.
...
2
votes
1
answer
220
views
Collecting data with Parse::RecDescent
I have a list of strings (30,000+) which are a collection of statements. Logically, Parse::RecDescent is the tool to use to parse the string to gather the data, but I just can't get my head round the ...
1
vote
1
answer
456
views
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....
3
votes
1
answer
262
views
Parse::RecDescent grammar not working as expected
All I managed to get working is STRING, PARAMS, VARIABLE and FUNCNAME
There seems to be a problem with FUNCTION, but I just can't see it.
use strict;
use Parse::RecDescent;
$::RD_ERRORS = 1; # Make ...
3
votes
1
answer
1k
views
Parsing string with nested parentheses using Parse::RecDescent
I'm trying to use Parse::RecDescent make a parser which can parse parenthetical expressions and the unary operator ?.
What I have so far is failing when I create the parser because the rule ...
1
vote
2
answers
1k
views
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/).
1
vote
3
answers
481
views
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 ...
0
votes
1
answer
139
views
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$' ...
3
votes
1
answer
402
views
Should I use Parse::RecDescent or Regexp::Grammars to extract tables from documents?
I have lots of large plain text documents I wish to parse with perl. Each document has mostly English paragraphs in it, with a couple of plain text marked up tables in each document.
I have created ...
2
votes
2
answers
229
views
parsing different files of the same grammar and calculating file to file similarities
I've got a bunch of ACPI Source Language files and I want to calculate file to file similarities between them. I thought of using something like Perl's Parse::RecDescent
but I am stuck at:
1) ...
1
vote
1
answer
177
views
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" ...
3
votes
1
answer
157
views
Is Perl's Parse::RecDescent thread safe?
I have a web application that uses a parser created with Parse::RecDescent. A parser object is needed in several parts of the application and since the parser takes quite a bit of memory I have up to ...
2
votes
1
answer
286
views
Interpolating variables in a Parse::RecDescent regex
I'm working on a Parse::RecDescent grammar to read a given human-readable set of rules and then spit out a file that is much easier for a computer to read.
One of the tokens is a list of "keywords"; ...
1
vote
2
answers
502
views
Parse::RecDescent - getting information from it
I'm working with the Parse::RecDescent parser in Perl, and I seem to have the most terrible time getting information from it. The information readily available online does not seem to have non-trivial ...
1
vote
1
answer
455
views
Why does my Parse::RecDescent give me all these warnings and errors?
Having a lot of pain with the following Perl file parsing code [last reply on PM @http://www.perlmonks.org/index.pl?node_id=754947] below:
#!/usr/bin/perl -w
use strict;
use warnings;
#use ...