[fpc-pascal] TP lex change input buffer
leledumbo
leledumbo_cool at yahoo.co.id
Wed Apr 13 19:31:17 CEST 2016
> I'm using TP lex in my application and I would like to change the input
buffer from using files to (memory) strings. What is the supposed way to do
this?
>From the comments:
"The variables yyinput and yyoutput are the text files which are used
by the lexical analyzer. By default, they are assigned to standard
input and output, but you may change these assignments to fit your
target application (use the Turbo Pascal standard routines assign,
reset, and rewrite for this purpose)."
Thankfully, we also have:
http://www.freepascal.org/docs-html/3.0.0/fcl/streamio/index.html
Which can turn any TStream descendant into a TextFile. Just change Assign as
in the comment above into AssignStream, everything else is totally the same.
--
View this message in context: http://free-pascal-general.1045716.n5.nabble.com/TP-lex-change-input-buffer-tp5724893p5724895.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
More information about the fpc-pascal
mailing list