I would like to know if somebody has ever fully specified the Alloy language in Alloy.
If such a metamodel exists, is it publicly available?
Do you mean you'd like a reference like http://docs.appcelerator.com/titanium/latest/#!/api but then based on the Alloy XML tags instead of the Ti. Javascript namespace? That's something I'd very much like to see happening as well, but I cannot give an estimate of when we'd have that atm.
Related
Is it possible to create Prolog-specific bindings of XML schema files? If so, can anybody point me in the right direction?
I have a schema which I use in Java to create a JAXB binding to serialize and de-serialize XML files. These files are created by an SWI-Prolog application which is still evolving and is developed by a geographically distant team. I want to make sure that when XML format changes, they are tied to a schema file change and not just view a schema as a nice documentation tool which often lags their actual XML content.
Any suggestions are appreciated.
Sounds like the general consensus is to use Prolog's JPL package to wrap a JAXB binding in Java. This is the closest one seems to get to an actual binding implementation.
There is an SGML package which is used by many, but this is not a binding. As far as I understand, the best one can hope for is to be able to validate one's XML against the schema, but a quick look at the SGML documentation did not give me an impression that this functionality is actually fully implemented.
So, if one needs a schema binding-style XML management framework, the recommendation is to access JAXB binding of this schema via JPL. Some folks expressed stability concerns of JPL. They reported frequent crashes of JVM when using JPL, but I have not independently verified these claims and thus cannot confirm them. If anybody has more input on this topic, I would love to get it.
Thanks
I've seen the question, "what does POCO mean?" asked all over the net, and seen plenty of explanations, but it's still not clear to me. I know it stands for "Plain Old CLR Object", but this isn't really helping me to understand.
Can someone please give me a few examples of something that is NOT a POCO and explain why it is NOT a POCO?
Thanks.
edit: I'm beginning to come to the conclusion that a POCO object is any object that can be easily converted to an identical object in any other CLR-supported language because it does not rely on any platform-specific or language specific library that is not universally available.
POCO just means: nothing but a pure class. No inheritance from any base class (other than eventually your own), no decoration with any attributes, no interface implementation of any kind (other than eventually your own), nothing else that would tie the code in any way to a certain technology.
Mostly the term is used in situations where a framework provides you with some services (like persistence in case of an ORM) wihout you having to change anything on your business objects. Other frameworks might demand from you that your objects be derived from some base class, or implement some interface. In case of a POCO, it just your plain object, no changes needed.
Using the Alloy API, it is possible to get from an alloy file a CompModule that contains all the things you need in order to play around with that given alloy module.
This is easily achieved using : CompUtil.parseEverything_fromFile(...)
My question now is the following. Is there a way to go from a CompModule to alloy language ?
Or to go from a list of sigs, and facts to alloy model. ( I guess I could do it brute force, but I'd rather like to know if there's an utility existing.)
Thanks for your support !
Cheers
I don't think there is already some kind of a visitor (or something) that takes a CompModule and produces a textual Alloy file. Implementing such a printer should be pretty straightforward, but also time consuming.
I want to know that what are the strategies to create a source to source translator i.e creating translation from one high level language to another. The two ways that come into my mind are
1- Changing syntax tree of one language to other language syntax tree
2- Changing it to intermediate language and then converting that to other high level language
My question is that is it possible to do the conversion using both strategies and which is more feasible to do, can anyone give some refernces to any theory or implementation done by some converter like any of above methods. And is there any standard xml based intermediate language, i know that xmlvm uses xml as intermediate language but it does not provide any proper specification of the intermediate language.
Any compiler is, roughly, a source-to-source translator. Target language can be an assembly language (or directly a binary machine code language), or C, or whatever high level language you fancy. So, the general compilers theory is applicable.
And just as a word of advice - one intermediate language is normally not nearly enough. Use more. Use dozens of intermediate languages, each different from a previous one in just one tiny aspect. This way any language-to-language translation is nothing but trivial.
Another word of advice (anticipating downvotes here) - stay away from XML, especially as a representation for ASTs.
I would look at LLVM, which can do source to source. Although the output isn't pretty, it might provide some good ideas.
The converters are usually based on constructing the semantic tree of one program and then re-shaping it to the target PL. As an example, take a look at C# to Java convertor.
The second approach is also possible, but the organization of your code may change completely after conversion. So, it is better to keep the intermediate common structure (IL, ST, etc), as high level as possible.
Try Clang! It is powerful for source-to-source translation. As of now it fully supports C, C++, Objective C and Objective C++.
You may also want to look at ROSE compiler infrastructure.
I'm using an external java library for which I only have the javadocs and do not have the source code. I'd like to generate a UML diagram from the existing javadocs so that I can visualize the class hierarchy using something like Graphviz. Is that possible? Note that what I'm looking for is a graphical version of overview-tree.html.
Please let me know if you have any ideas and/or suggestions.
Thanks,
Shirley
I don't believe that there is such a tool. Most of the reverse engineer tools depend on the actual code. The javadoc information isn't guaranteed to match the code as a 1:1 for the structure, thus making it unreliable.
I'm not familiar with any off-the-shelf solution for this purpose. Most commonly folks have the source code that generated the JavaDoc.
That being said, the overview-tree.html traditionally has a fairly straightforward HTML format.
It should not be difficult to write a script that would read the file as text or as a DOM, reconstruct the hierarchy of UL and LI tags, and use that to build an input file for graphviz. I've done similar stuff in the past with other forms of data.
It's just a matter of time and proficiency with the scripting language or appropriate tools.
The one problem of this approach is that you would only get the hierarchy of classes. You would have to make it somewhat smarter if you wanted to get the "implements XYZ" and create multiple hierarchies. Even if you could get that data, you would have to manipulate GraphViz's levels to get it to provide an appropriate layout once you have this multiple inheritance structure.
Of course, adding the details of the members would turn this into a whole new problem since you will have to access other HTML files.