Java Reference
In-Depth Information
parentheses and delimit them with commas. Types are followed by a colon for
both parameters and return type—for example, calculatePriceFor
Quantity(item:Item, qty:Integer):BigDecimal .
For our Attribute example, it was reasonable to implement the parser
provider by hand, given that we had to deal with only two values. For more com-
plex parsing, such as that required for our Operation parser provider, we really
should define a grammar and use a parser generator to do the heavy lifting. In
fact, looking again to the UML2 Tools project for examples, we find that JavaCC
was used to produce parsers for UML operation fields, among others. This topic
does not provide the details of the implementation, but they are provided within
the sample projects, including documentation throughout.
4.7 Summary
In this chapter, we explored in some detail the process of working with GMF to
define a series of domain-specific diagrams. As the possible functionality of a dia-
gramming surface may be quite extensive, we covered only some of the most
popular use cases in this chapter, leaving detail about the tooling and runtime
components to Chapter 11 as reference for adding your own functionality.
At this time, we move on to discuss a bit about the development of textual
concrete syntaxes for our domain-specific languages.
 
Search WWH ::




Custom Search