How can I use the same lexer with multiple parsers?

Location: jguru.com/faq/view.jsp?EID=93710 Created: Jul 2, 2000 Modified: 2000-07-02 13:13:29.777 Author: Terence Parr (jguru.com/guru/viewbio.jsp?EID=1" rel="nofollow">jguru.com/guru/viewbio.jsp?EID=1) Question originally posed by Terence Parr PREMIUM (jguru.com/guru/viewbio.jsp?EID=1" rel="nofollow">jguru.com/guru/viewbio.jsp?EID=1 Lexers are just objects, so you can attach any parser you want to instances of the same object (just don't have the parsers operate simultaneously--lexers only work on one input stream at a time). The only thing you have to keep in mind is that the vocabularies have to be compatible. In other words, if your parser is looking for INT and ID, but your lexer only generates tokens STRING and STRUCT then you will have a problem.

The parser can only apply grammatical structure to a stream of vocabulary symbols it's expecting. More.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions