leoroos/sandboxdroog — Issue #40: Refactoring Grammar Builder
Author: leoroos
Created: 2011-10-18 15:36:02+00:00
State: open
Labels: Core, task

GrammarBuilder provides too much functionality that is not closely related.
It is responsible to
* determine the involved rules (host + dsls)
* extract methods of involved Classes
* extract the annotations (EDSL, DSLMethod, PopartType)
* handling of
* Literals: extracting of grammar rules
* Methods ->
* handling of nonliterals
* handling of grammar rules for non literals intermixed with retrieval of further annotations
* replacing unicode characters
* Place for default values concerning grammar.

The many responsibilities make it difficult to test, maintain, extend or just understand the class.
At the same time it is an intrinsic part of the translation and compilation process.

Further possible Hurdles are
* Introspection is completely done via Java Reflections, that means all annotations and types involved can cause exceptions if they are not found on the classpath.
* Order for e.g. Methods is not guaranteed hence no priorization between different translations is possible. (Might be addressed using a further parameter)