From: Daniel Varga-H. <var...@ov...> - 2010-04-18 08:58:10
|
Hi! It is possible to do lexical analysis on strings. I have written a very silly and not too practical example, but you can get the concepts out of it: http://codepad.org/qcxZNnu9 Regards, Daniel On Sat, Apr 17, 2010 at 11:37 PM, Brian Russell <bru...@ua...> wrote: > Hi, > > I'm trying to create a search engine that can read queries off the > command line. For example ./search dog would search for the term dog. My > question is if there is a way for flex to read the query terms directly into > the program. I need to process each query term in order to properly query > my records. Right now, I'm writing each query term to a temporary file and > then setting yyin as the file name. I tried using the default stdin instead > but realized it was not finding the command-line arguments. Is there any > way to make yylex read in a char array or any way to direct the argv[] array > to stdin? Any ideas on how to make this program without creating temporary > files would be appreciated. > > Thanks, > Brian Russell > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Flex-help mailing list > Fle...@li... > https://lists.sourceforge.net/lists/listinfo/flex-help > |