Hi Nigel,
thank you, but that is not what i was asking. Maybe i was unclear.
In your example, let's say i do have lines. I understand your :doc, and
how to parse many lines _at once_
But i want to parse one line at a time. Parse, do my processing, parse
more, more processing until end of file.
I know how to loop through files. But obviously i can't split my input
into files, as that involves parsing it.
Torsten
Nigel Thorne <mailto:[email protected]>
9. toukokuuta 2014 2.51
If you are asking "how do I parse a file that contains some structure
that is repeating?" Then ... You just need a rule that says that.. For
example :
rule(:line){ ... something ... }
rule(:doc){ line.repeat }
If you want to know how to parse several files... You just need a loop
through the filenames, opening each file, and ask the parser to parse
it... Then parse the next one.
Does this make sense?
Torsten Ruger <mailto:[email protected]>
8. toukokuuta 2014 22.44
Moi,
as i am relatively new, i feel i am missing the obvious. Sorry for the
inconvenience if that is so.
I want to parse a file in bits as it were. So when i call parse (or
whatever) i want it to return the expression, which i then transform and
process.
Then i want to parse more of the same file and repeat.
Seems quite a simple thing, but i can't find any info on it.
I would give my grammar as example, but feel that the issue is the same
for the simples things, ie numbers.So
1
2
3
could be my file and the rule would be match digit.
Thanks for any help,
AND THANKS FOR PARSLET
Torsten
Torsten Ruger <mailto:[email protected]>
8. toukokuuta 2014 22.44
Moi,
as i am relatively new, i feel i am missing the obvious. Sorry for the
inconvenience if that is so.
I want to parse a file in bits as it were. So when i call parse (or
whatever) i want it to return the expression, which i then transform and
process.
Then i want to parse more of the same file and repeat.
Seems quite a simple thing, but i can't find any info on it.
I would give my grammar as example, but feel that the issue is the same
for the simples things, ie numbers.So
1
2
3
could be my file and the rule would be match digit.
Thanks for any help,
AND THANKS FOR PARSLET
Torsten