5. GRAMMAR
• Assign ‚name=ID‘ attribute for non-referable elements
• Tweaking grammar to optimize non syntax related stuff
• generated meta model structure
• content assist (e.g. whitespace in combined keywords)
• scoping
DESIGN SMELLS
6. GRAMMAR
• Too few / too much keywords
• Trying to solve too much with terminal rules
• Unordered groups for multivalued assignments
• Using Xcore for small metamodels
• Enable backtracking to „solve“ a grammar ambiguity issues
DESIGN SMELLS
7. GRAMMAR
• Too few / too much keywords
• Trying to solve too much with terminal rules
• Unordered groups for multivalued assignments
• Using Xcore for small metamodels
• Enable backtracking to „solve“ a grammar ambiguity issues
DESIGN SMELLS
8. GRAMMAR
• Too few / too much keywords
• Trying to solve too much with terminal rules
• Unordered groups for multivalued assignments
• Using Xcore for small metamodels
• Enable backtracking to „solve“ grammar ambiguity issues
DESIGN SMELLS
10. SCOPING
• Use declarative scope provider
• Navigate cross-references while computing scope
• Compute stuff in scope provider which could be put into IEObjectDescription’s
user data
• „Optimize“ scope to tweak content assist
• Check for proxies, resolve proxies
• Instantiate unnecessary objects
• Access node model and assume that it is complete
DESIGN SMELLS
11. VALIDATION
• Don’t use semantic validation at all
• Use @Check without CheckType
=> Default is CheckType.FAST
• Provide check methods for child-elements which traverse sibling
elements (e.g. uniqueness check)
• Many fine grained check methods
• Loading the world again
DESIGN SMELLS
31. • Evaluate if Xtext is the right tool to solve a problem [ it
often is :-) ]
• Get experts on board when starting ambitious projects
• Learn underlying technologies (EMF, ANTLR, …)
• Continuously develop DSL projects
• Write extensive tests
• Invest into user experience
AVOIDING TROUBLE