[AWS] Quick question about Templates_Parser

Devon H. O'Dell dodell at sitetronics.com
Tue Aug 17 08:24:31 CEST 2004


Pascal Obry <pascal at obry.org> scribbled:
> 
> Devon,
> 
>  > I was briefly looking at adding functionality for Templates_Parser to
>  > dynamically include files (that is, add support for something like:
>  > 
>  > @@INCLUDE@@ @_SOME_PAGE_TO_INCLUDE_@
> 
> This is not supported at the moment and will be quite difficult to do. The
> point is that the include file is compiled in-memory. Here you do not know its
> name, so it will be tricky to setup the include file into the tree especially
> with the cache feature.

Rats. I was looking at line 2274 of templates_parser.adb -- basically
the only functionality that would be needed would be to be able to
determine the value of a variable (i.e. being able to resolve the value
of Get_Next_Argument) before resolving that to an actual location.
Unfortunately, I wasn't able to find a table lookup feature and I didn't
exactly know where to look -- I've only been working with Ada and AWS
for a few days now.

How do things like the addition and subtraction operators resolve
symbols? Otherwise, it might be an option to create a Dynamic_Include
filter which would perform the same without caching -- a performance
hit, but it is a trade-off in any case. I thought of working on this
too; again, my problem was figuring out how the symbols were resolved
and what needed to be returned to actually substitute the text.

>  > This would be a great feature, in my opinion, and would greatly reduce
>  > the number of templates I will need to make (and static code I will need
>  > to write) for my application.
> 
> Well, in many cases I think that something like:
> 
> @@IF@@ @_SOME_PAGE_TO_INCLUDE_@ = "xyz"
>    @@INCLUDE@@ "xyz"
> @@ELSIF@@ ...
> 
> would do the trick. You won't be able to include a page that is not physically
> on the disk anyway, so having to list all of them should not be a big problem.

Or perhaps just @@INCLUDE@@ includes.thtml and list them all in there,
which would at least keep the main file a bit more clean. I suppose I
could do it this way and do not especially need this feature, but it
sure would be nice to have :).

> Pascal.
> 
> -- 
> 
> --|------------------------------------------------------
> --| Pascal Obry                           Team-Ada Member
> --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
> --|------------------------------------------------------
> --|              http://www.obry.org
> --| "The best way to travel is by means of imagination"
> --|
> --| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595
> 
> 

Thanks for the reply in any case; I do appreciate it. I'm sure I'll be
able to plague the list with more questions in the near future :)

Great software!

-- 
Kind regards,

Devon H. O'Dell   |          dodell at sitetronics.com
Key: 4D3D8CA7     | IRC: bofh at WhatNET thebofh at efnet
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : /pipermail/aws/attachments/20040817/5749a3f5/attachment.bin


More information about the AWS mailing list