The docs for parboiled2 mention the following to get results:
https://github.com/sirthias/parboiled2#access-to-parser-results
val parser = new MyParser(input)
val result = parser.rootRule.run()
However I get a compilation error when attemping what seems to that approach:
Here is the outline of the parser:
case class CsvParser(input: ParserInput, delimiter: String = ",") extends Parser {
..
def file = zeroOrMore(line) ~ EOI
}
The code to attempt to run it
val in = new StringBasedParserInput(readFile(fname))
val p = new CsvParser(in)
println(p.toString)
p.file.run
But the "run" is not accepted:
Error:(81, 12) too few argument lists for macro invocation p.file.run
^