[prev in list] [next in list] [prev in thread] [next in thread] 

List:       antlr-interest
Subject:    [antlr-interest] "google like" quoted string parser/lexer
From:       tony () bill ! assist ! uci ! edu (tony () bill ! assist ! uci ! edu)
Date:       2006-02-23 20:36:26
Message-ID: Pine.LNX.4.44.0602232036040.8459-100000 () bill ! assist ! uci ! edu
[Download RAW message or body]

Hi,

Can anyone point me in the right direction of how I'd write a lexer/parser 
that handles quoted strings.  Ultimately what I'm doing would be used as a 
translator into SQL, but I'm interested in anything that deals with 
quoted strings.  

It would have rules such as this:

1. this that -- the words 'this' and 'that' would have to appear somewhere 
in the text.

2. "a phrase" -- word/words quoted would signify that the words would have 
to appear exactly in the text as typed in a keyword search.

3. "some search terms" qualifier -- same as above, and the word 
'qualifier' would also have to appear anywhere in the text.  In other words,
there's an implicit "and" between the quoted string and the word 'qualifier'.  
There could be a 0 or more qualifier words, as well as 0 or more quoted 
strings.

4. There could also be typos that have a starting double quote, with no 
ending double quote (ie "not a phrase).  These would be treated as #1 
above, basically just stripping out the unbalanced quote.

Does anyone have or know of an example that I can use as a starting point?
I'm quiet a neophyte at using a lexer/parser so anything is useful.

Thanks a lot,
Tony




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic