Alexander Ryzhov
unread,Nov 1, 2012, 12:59:26 PM11/1/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sab...@googlegroups.com
I'd like to share my impressions of SableCC after having used it for a couple of weeks. Overall, SableCC is a great product. I am familiar with the theory of syntax analysis and compilation and the concept of Abstract Syntax Tree seemed excessive at first, so my first instinct was to find ways to hook semantic processing to each production. Now I realize what a great invention AST is. AST allows you to make fewer changes to your semantic processing code while evolving the grammar, and that translates to tremendous productivity boost. The lexer is implemented quite elegantly, and in cases where I struggled I was able to debug the generated code and understand what the problem was. The states feature in the lexer is awesome, and it allowed me to go beyond the boundaries of traditional languages (e.g. quoted string literals). I was using SableCC 3.2 simply because it's the latest version supposed by the Maven plugin. I integrated SableCC with Maven and thus I don't have to store generated classes in the source control system. I haven't used ANTLR but I read its documentation and studied examples before making the decision to try SableCC. I like SableCC a lot better because with ANTLR you have to embed Java code into the grammar which makes the grammar look messy and the code hard to debug. One area for improvement I'd like to mention is error handling and recovery: the parser generated by SableCC throws an exception if it encounters a syntax error which means the design limits the ability to recover and proceed to the rest of the file. The exceptions that the parser throws aren't very informative and in many cases are misleading to a user who isn't familiar with LR parsing algorithms. I also don't see an easy way to localize those error messages. In conclusion, I'd like to thank the authors and contributors of SableCC for this awesome tool and encourage them to continue its development.