[gme-users] Strategy for source code generation
Nicki Lehmann Møller
nicki at itu.dk
Fri Aug 11 11:08:59 CDT 2006
Hi Matt
I was simply hoping that there was some simple api that I could use to
generate my output without having to implement it my self.
I imagine something like
Iterator i = selected.iterator();
while ( i.hasNext()) {
JBuilderObject element = (JBuilderObject) i.next();
JavaClass jc = SimpleAPI.CreateSource(new file(element.getName()), Java);
jc.addAttrib(element.getAttribute(Jadajada, whatever));
jc.setAttrib(element.getAttribute(Jadajada), value);
jc.addMethod(new MethodSignature(name, returnType, params))
jc.defineMethod(name, new MethodDefinition(contentOfTheMethod));
jc.flush(); //generate a file containing java source code
}
As I haven't given this example too much thourght there are probably some
bad design issues related to it so please don't give it too much attention.
The main point is that I, with something like this, would be able to create
java or c# source code without having to worry too much about the
correctness of my source code output.
regards,
Nicki
On 8/11/06, Matthew J. Emerson <mjemerson at isis.vanderbilt.edu> wrote:
>
> Can you provide some more information on exactly what you're looking for,
> and how you would expect it to work? If it doesn't exist, maybe it's worth
> building.
>
> --Matt
>
>
> -----Original Message-----
> From: gme-users-bounces at list.isis.vanderbilt.edu on behalf of Adi
> Mallikarjuna Reddy V
> Sent: Thu 8/10/2006 11:18 PM
> To: gme-users
> Cc:
> Subject: Re: [gme-users] Strategy for source code generation
>
> Hey Nicki,
> Even I am also looking for that kind of thing. Even I have to write it
> from
> scratch to generate code from the model. Is there any one who is working
> on
> the similar lines?.
>
> Regards
> Adi
>
> On 8/11/06, Nicki Lehmann Møller <nicki at itu.dk> wrote:
> >
> > Hi all!
> >
> > After having worked a bit with the GME I'm wondering if some of you guys
>
> > or girls can help with the transformation of my model into source code
> > (preferably C# but Java will do). I'm currently building my interpreter
> > using the JAVA API (BON) and the only strategy that I know of is to
> build
> > the whole source code output library myself :( I was however hoping that
> > some of you knew of some tool, api or strategy that could ease the
> source
> > code generation a bit.
> >
> > Kind regards,
> > Nicki
> >
> >
> > _______________________________________________
> > gme-users mailing list
> > gme-users at list.isis.vanderbilt.edu
> > http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users
> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.isis.vanderbilt.edu/pipermail/gme-users/attachments/20060811/381428b7/attachment.htm
More information about the gme-users
mailing list