-
Notifications
You must be signed in to change notification settings - Fork 50
Description
Hi Folks, There are problems reverse engineering interfaces--I get methods with no names. I debugged the code and found out that the code for reverse engineering is expecting a certain data structure created via the parser, but it's not created correctly. So, I've modified the code, and it now "works"--or at least somewhat better. (1) IDENTIFIER_WITH_TEMPLATE is used in many places but the synthesized attribute is not handled consistently throughout the grammar, a good programming practice. The code has been changed to reflect this. (2) In CsharpCodeAnalyzer.prototype.translateMethod = function(...) { ... if (!isConstructor) { _operation.name = methodNode.name[0].name; }, that code expects for non-constructor methods the synthesized attribute to be of a particular form. In classes, this record is constructured through production variable-declarator (why variable-declarator?). I changed the code to create the expected synthesized attribute, and all works well now. (3) There's quite a bit of shift/reduce and reduce/reduce errors in the grammar, and I don't know how this Jison parser generator works in resolving the issues, nor how to add disambiguating information to correct these problems. I would highly recommend moving to a better parser generator, line Antlr, which has been under active development for decades, includes up-to-date grammars for Java, C#, etc., and generates a JavaScript target. (4) There really should be some unit tests. The complete code is attached, and based off of v0.9.1. (5) This is a great project, but it needs work. Keep it up, please!
staruml.csharp.zip