Improve messaging by using clang Diagnostics engine instead.
Remove unused code
Add testcase when a variable is used instead of IntegerLiteral for indicating the parameter of derivation. It should fail.