concept end in category dsl

This is an excerpt from Manning's book DSLs in Action.
Eclipse Xtext (http://www.eclipse.org/Xtext) is a great example of a system that offers a complete solution for end-to-end development of external DSLs. Instead of storing your DSL in plain text form, it stores a higher-order representation of your DSL grammar in the form of metamodels. These metamodels can then be integrated seamlessly with a number of other frameworks like code generators, rich editors, and so on. Tools like Xtext are called DSL workbenches because they offer a complete environment for developing, managing, and maintaining their external DSLs. We’ll discuss designing DSLs based on Xtext with a detailed case study in chapter 7.
Listing 4.13. Trade with domain validation
## enable_trade_validation.rb require 'trade_class_methods' module EnableTradeValidation def self.included(base) base.extend TradeClassMethods end end ## trade.rb require 'trade_class_methods' require 'enable_trade_validation' class Trade include EnableTradeValidation attr_accessor :ref_no, :account, :instrument trd_validate :principal do |val| val > 100 end ## .. end
At the end of this chapter, you’ll have an overall idea of how to approach designing a DSL in languages that offer similar capabilities. Because we’ll implement complete DSLs, you’ll learn how to think in terms of the DSL that you design and you’ll program your implementation language to fit the syntax that you want to provide to the user.