I want to parse a string which I give to the parser in the main function of yacc . I know that this could be done by using yy_scan_string
but I don't know how to use it. I searched the web and the man pages but it is still not clear to me. Please help me.
相关问题
- Multiple sockets for clients to connect to
- What is the best way to do a search in a large fil
- glDrawElements only draws half a quad
- Index of single bit in long integer (in C) [duplic
- Equivalent of std::pair in C
This works for me. I have this code in the subroutines section (i.e. the third section) of my Bison file:
I've found and example here to myself. May it can be usefull for you:
http://osdir.com/ml/lex.flex.windows/2003-04/msg00008.html
I always recommend this page to people who want to learn lex/yacc (or flex/bison)
This worked for me ... use yy_scan_string()
In case anyone needs the sample for a re-entrant lexer: