|
From: | Sylvain Schmitz |
Subject: | Re: yyparse(): input from string |
Date: | Fri, 20 Jan 2006 17:27:57 +0100 |
User-agent: | Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7) Gecko/20040616 |
Krisakorn Rerkrai wrote:
That means I can skip "yyin" and "yyparse" and simply call "yy_scan_string()". Is that right?
Almost; you won't have to set yyin because yy_scan_string does it for you. You still have to use yyparse (which in turn calls yylex, which will use the string buffer set up by yy_scan_string instead of a file buffer).
So your code should look like: my_string_buffer = yy_scan_string (my_string); my_parse_result = yyparse (); yy_delete_buffer (my_string_buffer); -- Hope that helps, Sylvain
[Prev in Thread] | Current Thread | [Next in Thread] |