Related articles |
---|
XML-oriented precompiler (current version is for PHP) Satyam@satyam.com.ar (Satyam) (2006-08-10) |
Re: XML-oriented precompiler (current version is for PHP) Satyam@satyam.com.ar (Satyam) (2006-08-14) |
Re: XML-oriented precompiler (current version is for PHP) gah@ugcs.caltech.edu (glen herrmannsfeldt) (2006-08-15) |
From: | "Satyam" <Satyam@satyam.com.ar> |
Newsgroups: | comp.compilers |
Date: | 10 Aug 2006 15:45:39 -0400 |
Organization: | Compilers Central |
Keywords: | XML, question |
Posted-Date: | 10 Aug 2006 15:45:39 EDT |
Though I made a professional career out of software, I have no
academic background in computer science, I am an electrical engineer,
electrical currents above 50Hz get me dizzy (electric current in the
US goes too fast for my taste). So now, half retired, I am trying to
catch up with all that should have been the basics of what in the end
has been my career.
So I got this idea about how to better integrate the generation of
XML/HTML/.... with the programming language producing it, and came up
with the idea of adding a couple of extra instructions to output XML
elements and their attributes, which I process via a pre-compiler to
convert them into plain native instructions.
It is all described here: http://satyam.com.ar/StructuredTags, so I won't
make this message long.
Since no programming language can go without an example on how to output
Hello World!, this is my way:
<p {
& align "center";
? "Hello World!";
}
Which gets converted to:
echo '<p align="center">Hello World!</p>';The <, & and ? symbols stand for
the tag, attribute and echo instructions.
The main idea is to have both the block structure of the programming
language and that of XML combined so that the XML output is not simply
a long arbitrary series of strings, without any regard to its logical
structure, allowing for compile time checking.
As I said, my lack of any contact in the academic world has left me
quite in the dark about other similar works, which I am sure there are
since I doubt mine can be an original idea. Any comments and/or
references are appreciated.
Satyam
[Precompilers for languages embedded in other languages have been
around for a long time. I did one in 1981 and it was a well-known
technique then. -John]
Return to the
comp.compilers page.
Search the
comp.compilers archives again.