String buffer with flex and bison
Hello, I'm trying to write a parser for a simple custom language, and I decided to try the well-known combo flex/bison.
I found a lot of examples on how to use them, but I'm a bit confused on how to read data from memory instead than from a file.
From what I've seen, yy_scan_buffer is what I'm looking for. Now my question is: yy_scan_buffer is declared in the lexer file, but the main program will call yyparse, no? So how do I tell yyparse what buffer it should use? And even then, the parser has no prototypes for lexer's functions, so how do I call yy_scan_buffer from there?
I hope someone can help me!
|