-
Notifications
You must be signed in to change notification settings - Fork 21
Description
Rubex was written in a bit of hurry, so parts of the code base are quite messy. Identify these smelly parts and refactor them with better design. Refer to Martin Fowler's Refactoring Ruby book for reference. Here's a rough list based on basic parameters like a method/class doing too many things or being too long. Feel free to add your own.
-
Statement::Alias#analyse_statement.
This method is using an if-else approach for detecting function pointers. Ideally we should use a new class for denoting function pointers for arguments (like this commit: ff00ff8) -
Expression::MethodCall#analyse_statement
Method is too long and does too many things in 30 lines of code :O
- Expression::Name#analyse_statement
Too long and does too many things.
-
analyse_statementinExpressionclassesThe
analyse_statementmethod should only analyse statements and make sense of their types
and generate symbol table entries etc. Currently methods of this name exist in Expression
classes as well. This should go so that there is a clear demarcation between statements and
expressions. Don't just rechristen toanalyse_expression. Let there be some value to it. -
Separate classes into their own files as per ruby-style-guide.
-
Expression::CommandCall#generate_evaluation_code
Method is too long and does too many things. Too many conditionals. -
ElementRef#analyse_statement
-
ElementRef#generate_evaluation_code
-
Expression::StringLitclass
Class trying to be both a Ruby string and C string. Segregate. -
Refactor temp allocation mechanism. Current mechanism requires too much work on part of programmer.
-
Refactor code generation. Current mechanism relies on the
c_codeconstruct which does not convey meaning properly and does too many things in one method in many cases. -
Unify
Statement::ArgumentListandExpression::ArgList. There should be only one class for dealing with argument lists.