[comp.lang.c] yacc question

mpledger@cti1.UUCP (Mark Pledger) (09/21/90)

I am trying to build a parser for a subset of the SQL data base language.
I wish to make the parser interactive -- that is to allow the user to 
enter an SQL statement (only one at a time), and have the parser validate
the syntax and then call my routines.  

My question is this:  Can I somehow provide a simple prompt at the beginning
of each input line and still use lex/yacc's "yyin" file pointer?  I first
thought of using a seperate input routine and then passing the string to
yyin, but the SQL statement submitted by the user could span multiple lines.
I need to parse the complete SQL statement.  By passing one line at a time
when calling yyparse(), I will always return with yyerror() because the
input is invalid (an incomplete SQL statement since the rest of the statement
is on the input line to follow).  The end of an SQL statement is followed by
a semicolon.  Any help would be appreciated.

Thanks in advance.



-- 
Sincerely,


Mark Pledger

--------------------------------------------------------------------------
CTI                              |              (703) 685-5434 [voice]
2121 Crystal Drive               |              (703) 685-7022 [fax]
Suite 103                        |              
Arlington, DC  22202             |              mpledger@cti.com
--------------------------------------------------------------------------