Hi!
-------- Original-Nachricht --------
> Datum: Tue, 03 Jun 2008 22:42:43 +0100
> Von: Luis Sergio Oliveira <[EMAIL PROTECTED]>
> An: [email protected]
> Betreff: Re: [argouml-dev] C++ module preprocessor
--<snip>--
> sure I would like to see it and help in anything like revision and
> "light testing" :-)
I'll send you the module in a p-mail.
> Concerning jcpp integration into ArgoUML I think it should be possible
> for modules to declare additional jars that must be loaded or, if it
> isn't we should create an issue for the ArgoUML module loader to support
> it.
That's what I tried. Declared the jcpp jar in the module's manifest, but since
there isn't even a ext/lib directory, or so, and all the other jars are in the
lib
dir, it's very likely, that this feature is simply not implemented in Argo.
> Another option is to do what Eclipse does: repackage the jcpp into a jar
> that has a slightly modified MANIFEST.MF and has a class that implements
> ModuleInterface with empty implementations for enable and disable. Or
> better, place it as a new module of argouml-cpp.jar, say
> org.argouml.language.cpp.preprocessor.Preprocessor, that includes the
> jcpp - I don't know right now how this is achievable, but, the Eclipse
> guys do it for Ant and other libraries wrapped as plugins.
The advantage so far is, that I never touched the jcpp jar. So if a bugfix
release
of jcpp comes out, we could simply copy it in the Argo lib dir and everything is
fine. The solution above needs someone taking care of the repackaging etc, so
I'd prefer to use the unmodified jcpp jar.
> > Or should I create an attachment to issue 2947, or so?
> >
> >
> I think a branch of argouml-cpp is the ideal way to proceed for now in
> things related to the preprocessor new development since we're
> approaching 0.26. But, anything that is necessary in the existing reveng
> code could go directly to trunk - the reveng is still pre-alpha and
> mainly the result of a spike, so any improvements coming from your work
> or needs related to it are welcome.
In my view, the current RE simply doesn't work for most existing projects.
Almost anyone declares the classes in the header files, and since the include
statements are ignored, but the parser requires to know every type in the cpp
file, RE of any real-world app will fail. So (in my eyes), the current code is
not
really worth to be preserved for the 0.26 release. Look at the modifications to
call the preprocessor:
==============
private void parseFile(Project p, File f, ImportSettings settings)
throws ImportException {
Reader fileReader;
try {
preprocessor = new Preprocessor( f); // Create a new
preprocessor for the input file.
fileReader = new CppReader( preprocessor);
} catch (IOException e) {
throw new ImportException("Error opening file " + f, e);
}
try {
Modeler modeler = new ModelerImpl();
CPPLexer lexer = new CPPLexer( fileReader);
CPPParser parser = new CPPParser(lexer);
try {
parser.translation_unit(modeler);
} catch (Exception e) {
throw new ImportException("Error parsing " + f, e);
}
newElements.addAll(modeler.getNewElements());
} finally {
try {
fileReader.close();
} catch (IOException e) {
LOG.error("Error on closing file " + f, e);
}
}
}
==============
There's another instance var added, a few lines in the module and argo manifest,
and that's it. We're talking about a 10 line patch, or so. Replace
FileInputStream
with reader, create preprocessor and reader, and there we go.
> So, I think you have commit rights to argouml-cpp as you're a core
> developer. Therefore, please make a SVN branch for the preprocessor and
> any changes you want in reveng. I will look into it as you proceed and
> try to integrate as much as possible into trunk.
>
> Is this strategy OK for you?
Let me just send you the module at this point, ok? Check it, and I think it
should
go into the trunk. We should add GUI stuff for the include directories and c++
RE should be a lot better. That's why I'd like to see it in 0.26.
Ciao,
Andreas
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]