[phc-general] Structured Tags pre-processor
Edsko de Vries
edsko at phpcompiler.org
Thu Aug 10 19:37:24 CEST 2006
Hey Satyam,
> >>I re-wrote and expanded the initial document actually explaining the
> >>code I made and referring to PHC. I have downloads of my code,
> >>including the patch files for PHC.
> >
> >Where?
>
> The files are there but in individual links, I didn't make a sinple
> download package, which is probably what I should have, you are right.
Sorry, what I meant was, at which URL?
http://www.satyam.com.ar/StructuredTags2.htm seems to be the original
description still.
> >But perhaps it is easier if you simply provide an already-patched
> >version of phc, user's might prefer that to having to patch phc
> >themselves (note also that since you require a patched version
> >anyway, perhaps it is easier to hardcode the plugins into the phc
> >binary; the only change you have to make to do that is to use
> >process_ast in process_ast/process_ast.cpp instead of a process_ast
> >in a plugin).
> >
>
> So I would need to put my code under that process_ast and the regular
> make, not the script to compile plugins, will make a version of phc
> with my plugin in it? Cool!
Yep. This is explained briefly in Getting Started. You will need to
modify Makefile.am to add all your C++ files (hopefully that file should
be self-explanatory). You then need to run:
aclocal
autoconf
automake
to remake the makefile from Makefile.am, and then call make. This is a
bit more complicated than making a plugin (which is why we added the
plugin interface in the first place) but since you need a patched
version of phc anyway, you might as well distribute a completely
standalone PhpSt :-)
> I'll try that, regarding offering it
> for download, the license agreement covers that for sure but I hate to
> read those things, basically, you guys don't mind if I do?
The license that comes with phc is very short. In fact, I'll reproduce
it here in full :-)
phc -- the open source PHP compiler
Copyright (c) 2005-2006, Edsko de Vries, John Gilbert and Paul Biggar.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
- Neither the name "phc" nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> I have (or at least had) this funny idea that DTDs were on their way
> out and XSDs were the way of the future. That future seems to be too
> distant so I'll fall back on DTDs. Actually, I didn't plan to really
> follow all the XSD, there is much more information there that I could
> possibly check for anyway. The nice thing about XSDs is that I had
> the loading of it solved. I am still looking for a DTD parser, found
> plenty in Java, one in c# (I guess that's the closest) one in perl,
> another in Lisp, a couple in languages I never heard about (besides
> Haskell, I mean ;-) )
Yeah, you are right, DTDs are on their way out, it just seemed to me
that they'd be much easier to support.
> Doing one in C++ from scratch .... well, it might be interesting.
Note that phc already links in Xerces (when it is available). I'd be
very surprised if Xerces does not include a DTD reader.
> By the way, talking about Lisp, can you
> imagine:
>
> (html (head(title 'This is a web page in HTMLisp ))(body (h1 'Hi
> there! )))
>
> We complained about parenthesis back then, now we have plenty of
> angled brackets and we are all so happy!
Yeah, I know, Lisp advocates have been saying that for years (that XML
is just Lisp re-invented, except worse). The only argument I've every
heard that I thought was halfway convincing that XML syntax is better is
that the closing brackets in Lisp are meaningless, whereas in XML they
indicate _what_ they are closing (i.e., "</b>" is clearer than ")").
> We?ll be punching cards (made of carbon fibre or some such) any day now, and
> we'll call it a great invention!
Hehe, lol :-) You may well be right..
> We could have been spared of JavaScript, HTML and
> all that, Lisp all the way and that's it.
Of course, as a programming language, I do believe we have progressed since
Lisp..
Edsko
More information about the phc-general
mailing list