Some questions: javadoc, additional baselang-generator, packages

1. Is it possible to create javadoc-like comments in baselang?
e.g. author etc in ClassConcepts

2. Is it possible to add a further generator to baselang to generate e.g. a javadoc-like documentation or C#-Code?

3. Is ist possible to influence the package-structure of the generated java-output? The "virtual package" in the source-model is not used.
11 comments
Comment actions Permalink
Ok.
The 2nd one is resolved. It is possible. Just add another "language engaged on generation"

But another question appeared:

4. Is there a html-language? Could it be based on xml (xhtml)?
0
Comment actions Permalink
Ok Question number 1 ist solved :D
There's an addition to baselang called baselang.javadoc...
0
Comment actions Permalink
3. No. Currently in MPS each model represents it's own package, so you can simply create new model instead of "virtual package".

4. AFAIK, not in public MPS distribution.
0
Comment actions Permalink
In my opinion no. 4 is not good. Because i really like would like to generate java-classes from models and influence the package structure in the Generator.

The package name comes from:
base text gen component "BaseLanguageTextGen" - operation fileHeader
append ${"package " + getPackageName(cls) + ";"} \n \n {/*Generated by MPS */} \n ;
prettyPrint();
Btw. great idea to hardcode "generated by mps"!!!

And then in the same text gen component:
protected string getPackageName(node<Classifier> cls) { 
  return cls/.getModel().getSModelReference().getLongName(); 
}

prettyPrint();

So as i see it, there's no way to override this method...
0
Comment actions Permalink
Yep. You can file feature request for it.
0
Comment actions Permalink
Hi,
I also need this feature (dynamically set package of generated file).

Motivation:
I am migrating existing code to generated code. The old code is being used by code written by hand. As the package structure is quite fixed I can't just generate everithing to one directory.

By the way: MPS-5962
0
Comment actions Permalink
Hi,

could you file the request?

The only workaround would be to just subconcept the ClassConcept and define your own textgen or generator for it. (Actually I'm not sure, if you need to override it.)
But still the folder structure would be wrong...

What is the @export annotation?
0
Comment actions Permalink
I've a comparable problem. How can I create new model at generation time?
0
Comment actions Permalink
Why don't you put MPS-generated classes into a model with FQ name representing a package you'd like to see in generated code?
0
Comment actions Permalink
How can you do this using a generator?
Can you change the output-models fqname? Can you create several models?
0
Comment actions Permalink
Hi!
AFAIK, not. Currently you can only generate something in a scope of single model, but my idea was to originally put everything into a model with proper name..
0

Please sign in to leave a comment.