tcl-mod_dtcl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wojciech Kocjan <wojci...@kocjan.org>
Subject dparser 0.1
Date Wed, 04 Jul 2001 21:39:00 GMT
Hi.

I've just finished writing the dparser code.

It should be compatible with dtcl's, except:

<?= $variable ?>   is the same as   <? hputs  $variable ?>
<?dtcl code ?>     is the same as   <? code ?>

The first thing is that it does NOT create Tcl code, it's only purpose is
to create a list of elements in the page.

Ie it does the following:
This is a <? code ?>, which might be <?=$useful ?> to <?dtcl dtcl::code ?>

It cuts it in a list of:

type  prefix   data                 suffix

str   ''       'This is a '         ''
tcl   ''       ' code '             ''
str   ''       ', which might be '  ''
tcl   'hputs ' ' $useful '          ''
str   ''       ' to '               ''
tcl   ''       ' dtcl::code '       ''
eof   ''       ''                   ''

So basically this needs to be parsed to plain Tcl. That's what David wrote
in a perfect way - the code in test.c is a big mess and only exists for
testing purposes :).

I used such a description because I want to use the same code in
AOLserver's dtcl port.

If David finds it useful and fast enough (don't have a clue how fast/slow
this is - but I tried to make it quite as fast as possible :), I wish it
was included in the core. But after some small rewrites - but this one is
a '5 minute hack' I wrote this evening, I want to know if this might be
useful before finishing it up...

The URL is http://dtcl.zoro2.org/dparser-0.1.tar.gz

There's also a quick-hack testing code :>

The code was tested and should have no memory leaks and no bugs - after
all, this is just a small piece of code. I didn't have time to test binary
data, though. I didn't use any str*() function, but only mem*() ones, so
this code should work on binary files as well. 

--
Wojtek Kocjan
wojciech@kocjan.org


Mime
View raw message