On Tue, 25 Apr 2006, Mirko Stocker defenestrated me: > On Tuesday 25 April 2006 19:44, Thomas E Enebo wrote: > > We don't and neither does C Ruby. ?Our parser is based on theirs and > > we both eat comments in the lexing process. > > Ok, would it be much work? Could you give me some ideas on how to do it? > Unfortunately, I don't have much experience on these things :)
I think this is not real tough to do, but it does have a number of steps: 1. Lexer (RubyYaccLexer) needs a new Token to store CommentToken values. 2. Grammar needs a new production to deal with this token. I think this may be as simple as adding a rule to 'primary' to accept a comment token. I guess I would need to look at it. 3. New Node for ast needs to be made CommentNode 4. NodeVisitor needs new visitCommentNode added. 5. All impls of NodeVisitor need to be updated to support new method: with noops (AbstractNodeVisitor may do it for most of them) The biggest challenge is determining where in grammar we should accept the token. It seems it is possible anywhere we can get a newlineNode. Off the top of my head, I think primary may be the right place. We are busy trying to get Rails working by JavaOne, but if I get frustrated and want to take a break I may add this. If you want to take a shot at it then go for it. The previous steps outlines all tasks neccesary. I can provide guidance if need be (and teach you how to build grammar using Jay). -Tom -- + http://www.tc.umn.edu/~enebo +---- mailto:[EMAIL PROTECTED] ----+ | Thomas E Enebo, Protagonist | "Luck favors the prepared | | | mind." -Louis Pasteur | ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Jruby-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jruby-devel
