XMLc -- The XML compiler


Not too impressive web design I know, but it's 1 am and I got to round this up. Basically what you need to know is that XMLc is a compiler that can parse an XML file to generate a computer program that can be assembled / processed / compiled in it's own environment aferwards.

You can download the program here. Please note this software requires Windows to run.

I appologize for the relatively large number of dependencies, these you can get on the internet fine and this is only the devolopment version of the compiler anyway.

As far as I cound understand the standards, XMLc is W3C XML and XLink compilant. If it's not, remind me and I'll fix it. XMLc is also programming-language independend, which means you can use it to create computer programs in any text-code based programming language.

What you need to know in order to be able to start coding, is how XMLc reads XML files. In accordance to the XML and XLink standards, each XML file must look something like this (and this is an example of an ASM program):
<?xml version="1.0"?>
<code
xml:base="http://dustworld.dyndns.org/xml/"
xmlns:xlink="http://www.w3.org/1999/xlink">
<Default xmlns:href="Default.xml"></Default>
<RegisterA xmlns:href="AX.xml">
<RegisterB xmlns:href="BX.xml">
mov ax,00FFh
mov bx,0FF0h
cmp ax,bx
mov cx,ax
</RegisterB>
</RegisterA>
mov ax,cx
</code>
Since the links to the components as defined in the "xml:base" header are located on the internet, you can copy this code to a file, drag it into the compiler and click "Compile", the components will be downloaded automatically and the program will compile fine (the components are tiny and the compile should complete in a few moments, but you will get a progress indicator so you can see what the compiler is doing).

That is, the content is copied to the destination file directly, but the tags are translated according to the content of the XML files they are href-ed at. "xml:base" is the path of the files (you can create groups by adding attional such tags in the style of xml:base="../otherdir/", etc, all in accordance to the XLink standard of course), while the individual "xmlns:href"s aim at the files you are reffering to. The naming of the tags is user-defined, which means you can choose how you want to name your tags, the only rule is that you must match every open tag with the close tag of the same name. The rule in XML is that there can only be one top-level tag, which in this case is the "<code>" tag, but you can add as many meaningless tags inbetween as you want, in order to make your code more readable.

"xml:base" may either point to a location on the harddrive or the web.

The component files look something like this:
<?xml version="1.0"?>
<Compiler>
<Begin>
push ax
</Begin>
<End>
pop ax
</End>
</Compiler>
As with any XML there must be only one top-level tag pair, in this case "<Compiler>", but you can name those as you wish. What you put in the "<Begin>" tag, gets inserted into where you begin the refferenced tag in your program and what you put in the "<End>" tag gets inserted at tag close. Adding the two is not compulsary, but adding neither is pointless. "<br></br>" indicate a linebreak, where your code requires it. You can add any other tags you wish, as you wish, to help describe your code.

I will create some XML objects and add them to this website as I personally see fit. Considering they will be on the internet, you are free to use them as you will. This program on the other hand, I wish to make usable, so if you have any comments regarding it, please contact me.