Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [gmt-dev] JavaCC for textual DSLs and integration with code g enerator

Hi Markus

My personal preference is for meta-models to be drawn graphically and then
all their derivates generated by transformations. However GMT should support
all approaches, so if you can break up your code into transformations and
representations, it should be possible to exploit this all within GMT.

I also have a strong preference to CUP rather than JavaCC, since I regard LL
parsers
as a step back into the dark ages in comparison to the benefits of LALR that
bison and
yacc made standard. Having written two JavaCC parsers and rewritten in CUP,
I can 
accept that JavaCC is much friendlier, but it just doesn't cut it for
non-trivial grammars
and error recovery.

	Regards
			
		Ed Willink

------------------------------------------------------------------------
E.D.Willink,                             Email: mailto:EdWillink@xxxxxxx
Thales Research and Technology (UK) Ltd, Tel:  +44 118 923 8278 (direct)
Worton Drive,                            or  +44 118 986 8601 (ext 8278)
Worton Grange Business Park,             Fax:  +44 118 923 8399
Reading,   RG2 0SB
ENGLAND          http://www.computing.surrey.ac.uk/personal/pg/E.Willink
------------------------------------------------------------------------
(formerly Racal Research and Thomson-CSF)


> -----Original Message-----
> From: Markus Voelter [mailto:schogglad@xxxxxx]
> Sent: 30 November 2003 12:22
> To: gmt-dev@xxxxxxxxxxx
> Cc: arno.Haase@xxxxxxxxxxxxxxxxxxxx; Thomas Stahl
> Subject: [gmt-dev] JavaCC for textual DSLs and integration with code
> generator
> 
> 
> Hi again,
> 
> some more technical content ... :-)
> 
> I (as well as Arno (see CC), who introduced me to the idea)
> have been experimenting with using JavaCC to generate
> parsers for textual DSLs. Now this is nothing special yet,
> parser generators that create ASTs from text have been around
> for a while....
> 
> However, we have integrated the parsed AST with the
> b+m code generator. Both use Java objects to represent
> the AST of the parsed model (UML or textual DSL). It is
> is therefore easily possible to use the same template language
> to generate code from a textual DSL as can be used to
> generate code from UML. The "transition" from UML
> to the AST is seamless.
> 
> Useful examples of this combination include
> a) definition of the "implementation" of operations in
>     a DSL and generating executable code for a platform
> b) declaratively defining the characteristics of a UML
>     model element using some DSL (as opposed to using
>     weird tagged values).
> 
> Practically, we have added the DSL text to the documentation
> of the UML model element. We parse this text during the
> runtime of the code generator using the parser generated by
> JavaCC. We can then either use the parsed AST to control
> code generation itself, or use the template language to generate
> "implementation code" from the DSL.
> 
> Let me know what you think!!
> 
> Markus
> 
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
> - - - - - -
> Markus Völter
> mailto:voelter@xxxxxxx
> 
> voelter - ingenieurbüro für softwaretechnologie
> Ziegelaecker 11, 89520 Heidenheim, Germany
> Tel. +49 (0) 73 21 / 97 33 44
> 
> http://www.voelter.de
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
> - - - - - -
> 
> 
> _______________________________________________
> gmt-dev mailing list
> gmt-dev@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/gmt-dev
> 


Back to the top