Toupl
Encyclopedia
Toupl is a multi target language simplified generic template engine
. It works on the principle of compiler
\ preprocessor
, producing target language source code
. Syntax based on Foobar 2000 Tagz Script, but modified and extended for template engine
purposes.
Currently supporting generation to:
This are no other operator except variable\expression output, condition variable\expression output and target language code include. Other operators such as for while etc. must be written in terms of target language operators.
Target language target language variable or expression can be outputted by enclosing in % % tags
Target language code can be included by enclosing in ?% %? tags
Native condition output must by following construction
Conditional text putted between [% %] tags and will be outputted if all condition variables inside not null.
Conditional variables same as ordinary variables but enclosing by &% %& instead % %.
As in any language - there is a own comments
In situation, when you need output text, that contains elements\tags of toupl,you can enclose this in special ignore tags !% %!
table generation.
After generation we get
Next we must define _fpT test function
And calling this code
we get
Template engine
A template engine is software that is designed to process web templates and content information to produce output web documents. It runs in the context of a template system.-Types:...
. It works on the principle of compiler
Compiler
A compiler is a computer program that transforms source code written in a programming language into another computer language...
\ preprocessor
Preprocessor
In computer science, a preprocessor is a program that processes its input data to produce output that is used as input to another program. The output is said to be a preprocessed form of the input data, which is often used by some subsequent programs like compilers...
, producing target language source code
Source code
In computer science, source code is text written using the format and syntax of the programming language that it is being written in. Such a language is specially designed to facilitate the work of computer programmers, who specify the actions to be performed by a computer mostly by writing source...
. Syntax based on Foobar 2000 Tagz Script, but modified and extended for template engine
Template engine
A template engine is software that is designed to process web templates and content information to produce output web documents. It runs in the context of a template system.-Types:...
purposes.
Currently supporting generation to:
- C++C++C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell...
- C#
- JavaJava (programming language)Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...
- JavaScriptJavaScriptJavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....
- ECMAScriptECMAScriptECMAScript is the scripting language standardized by Ecma International in the ECMA-262 specification and ISO/IEC 16262. The language is widely used for client-side scripting on the web, in the form of several well-known dialects such as JavaScript, JScript, and ActionScript.- History :JavaScript...
- LuaLuaLua may refer to:* Lua , a Roman goddess* Lua , a traditional Hawaiian martial art* Lua , a lightweight, extensible programming language* Lua , a single by the folk rock band Bright Eyes...
- PHPPHPPHP is a general-purpose server-side scripting language originally designed for web development to produce dynamic web pages. For this purpose, PHP code is embedded into the HTML source document and interpreted by a web server with a PHP processor module, which generates the web page document...
- PythonPython (programming language)Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...
- Visual BasicVisual BasicVisual Basic is the third-generation event-driven programming language and integrated development environment from Microsoft for its COM programming model...
.
Syntax
Text may be simply outputted as is.This are no other operator except variable\expression output, condition variable\expression output and target language code include. Other operators such as for while etc. must be written in terms of target language operators.
Target language target language variable or expression can be outputted by enclosing in % % tags
Target language code can be included by enclosing in ?% %? tags
Native condition output must by following construction
Conditional text putted between [% %] tags and will be outputted if all condition variables inside not null.
Conditional variables same as ordinary variables but enclosing by &% %& instead % %.
As in any language - there is a own comments
In situation, when you need output text, that contains elements\tags of toupl,you can enclose this in special ignore tags !% %!
Example of generation
For example. Simple HTMLHTML
HyperText Markup Language is the predominant markup language for web pages. HTML elements are the basic building-blocks of webpages....
table generation.
After generation we get
Next we must define _fpT test function
And calling this code
we get