What is the best way to perform context sensitive parsing of chunks of a document?
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Chris_Summerset
Posted On:   Friday, July 16, 2004 06:02 AM

I want to parse the string contents of fields of a table INDIVIDUALLY, e.g. fields like "IP address", "Phone Number", "UserID". My table has 30+ fields, most of them differ in syntax.


The grammar could look like this:


field: ip | phone | userid ;



I considered multiple grammers (one per field, probably very inefficient in terms of space), semantic predicates (although not sure, how to do this exactly).


Any suggestions are much appreciated.


- chris

Re: What is the best way to perform context sensitive parsing of chunks of a document?

Posted By:   Chris_Summerset  
Posted On:   Wednesday, July 21, 2004 03:00 AM

basically the issue is: what if you do not want to start parsing with the "Start" symbol, or similarily, how do you choose between multiple start symbols if ANTLR supports such a construct at all ...


-moltis

Re: What is the best way to perform context sensitive parsing of chunks of a document?

Posted By:   Chris_Summerset  
Posted On:   Saturday, July 17, 2004 12:53 AM

Another method could be to precede the text to be parsed with a prefix or tag indicating the type like so:


TYPE_IPADDR:192.168.0.144
192.168.0.144


However, I still wonder whether there is another method, e.g. changing the "Start" production rule via API?


-chris
About | Sitemap | Contact