java - JavaCC: parsing a string and not reading from stdin or from a file -
i wrote parser javacc, can test in eclipse reading stream standard input (keyboard). want call class parser class. data parse available in string. didn't find way pass string argument. it's possible parse stdin or file. writing string file , parsing file in opinion not solution.
any idea how solve issue ? can't believe 1 want's analyze string , not complete file.
kind regards hans
--
you can construct parser instance inputstream. page shows how create inputstream, how 1 create inputstream string?
then can construct parser defined in javacc api.
theparser.theparser(java.io.inputstream stream) do notice though:
this constructor available when both options user_token_manager , user_char_stream false. if option static true, constructor (along other constructors) can called once create single parser object.
https://javacc.java.net/doc/apiroutines.html
you set these options in option_bindings. https://javacc.java.net/doc/javaccgrm.html
Comments
Post a Comment