This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
tt.net /
README
Welcome to my bizarre attempt to use Template Toolkit templates with .NET. My ultimate goal is to turn this into a
ViewEngine for ASP.NET MVC
Rather than writing my own parser/lexer, I'm attempting to use ANTLR as the Parser/Lexer grammer which outputs an AST.
The AST is then translated into C# using StringBuilder as part of ANTLR itself. The resulting source is compiled and
run.
I chose to use Lexer/Parser->AST->Template assuming that once the grammar is written, we can use the parser to ouput
VB.NET or any other language using the appropriate templates.
I'm starting simple (GET/SET) and working may out from there. Something should be easy. Some things fill be harder
(FILTER), and some things won't translate at all (PERL blocks).
P.S. I have no clue what I'm doing. Most of this stuff was way over my head when I started, but somehow I have some
simple syntac working all the way through the process. :-)
WHAT'S WORKING?
- implicit variable get [% variable %]
- explicit variable get [% GET variable %]
- variable fallback from Process(data) to Settings(variables)
- implicit variable set [% variable = x %], where x is string, number, decimal
- explicit variable set [% SET variable = x %], where x is string, number, decimal
- set defaults [% DEFAULT variable = x %], where x is string, number, decimal
- multiple defaults in one block
[% DEFAULT
foo = 1
bar = 'baz'
baz = 2.34
%]
- multiple sets in one block
[% SET
foo = 1
bar = 'baz'
baz = 2.34
%]
- basic if statement [% IF variable %] [% variable %] [% END %]
- basic foreach statment [% FOREACH i IN variable %] [% i %] [% END %]







