Hi!
I'm quite new to Perl, however I'm writing a parser for a rather complex debug-file. The format is a quite long specification so I thought it would be best to use a parser module with a grammatics.
I've decided to try out the Parser::RecDescent, but I can't figure out how to parse an entire file. Every tutorial/documentation example I've found are about a single line of input, but I need to pick out data from a large file with the format spanning over multiple lines. In the simpler files the format looks like:
n1
{
n2 {
{n: 3}
n3
{
5
}
}
n4
{
4
}
...
}
Now what part of the RecDescent parser do you use to read a file? Or maybe I've just missed something fundamental about Perl.
Thank you for your time!
I'm quite new to Perl, however I'm writing a parser for a rather complex debug-file. The format is a quite long specification so I thought it would be best to use a parser module with a grammatics.
I've decided to try out the Parser::RecDescent, but I can't figure out how to parse an entire file. Every tutorial/documentation example I've found are about a single line of input, but I need to pick out data from a large file with the format spanning over multiple lines. In the simpler files the format looks like:
n1
{
n2 {
{n: 3}
n3
{
5
}
}
n4
{
4
}
...
}
Now what part of the RecDescent parser do you use to read a file? Or maybe I've just missed something fundamental about Perl.

Thank you for your time!