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.
0
11 comments
Avatar
Permanently deleted user
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
Avatar
Permanently deleted user
Ok Question number 1 ist solved :D
There's an addition to baselang called baselang.javadoc...
0
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
Avatar
Permanently deleted user
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 ;

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(); 
}



So as i see it, there's no way to override this method...
0
Yep. You can file feature request for it.
0
Avatar
Permanently deleted user
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
Avatar
Permanently deleted user
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
Avatar
Permanently deleted user
I've a comparable problem. How can I create new model at generation time?
0
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
Avatar
Permanently deleted user
How can you do this using a generator?
Can you change the output-models fqname? Can you create several models?
0
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.