Thursday, 15 May 2014

parsing - How do you use positional in Scala parser with files? -



parsing - How do you use positional in Scala parser with files? -

i'd position info using positional parser , positional trait. i'd read file im parsing string (or can convert string) , parse while retaining position information. here's i've found on 'positional':

https://wiki.scala-lang.org/display/sw/parsing

...which off-handedly mentions streamreader , chararrayreader. there other options? reading file can used chararrayreader may need. if so, how work? if not, should doing?

(fyi, streamreader out because want read , maintain file long before parse it, not because want waste memory.)

direct favorite browser scaladoc html , navigate bundle scala.util.parsing.input you'll find available positioned readers:

chararrayreader charsequencereader pagedseqreader streamreader

addendum

creating 1 of these readers, chararrayreader, e.g., simple:

val auto = new chararrayreader("sample input")

now have reader feed parser.

parsing scala

No comments:

Post a Comment