![]() |
Starting with v4.0 the TDL interpreter/parser have been frozen: no new functionality will be added, they'll only be adjusted to match changes in the LLBLGen Pro designer assemblies so the TDL interpreter works properly. This means that there's no functionality added for Table Valued Functions. From v4.0, it's recommeneded to write all templates using the .lpt system. To get started with the .lpt system, it's recommended to check out the various .lpt templates shipped with LLBLGen Pro. You can include .lpt templates inside TDL templates. The TDL interpreter/parser won't be removed from the system in the future, they just won't receive new updates to support new functionality in the designer. |
Term | Description |
Token | A token is a named element which is recognized in the input stream. For example, in C# you have statements, like 'for'. 'for' is a 3 character string, but when recognized in the input stream, the 'for' string is transferred to a token, which is normally a number. Tokens are found by the Lexical Analyzer. TDL's Lexical Analyzer tokenizes (transfers strings to tokens) everything, also strings which are not represented by an element in the TDL language. Strings which do not represent a TDL element are tokenized as 'LiteralText'. This way the input stream consisting of solely ascii characters is transferred to a list of tokens which can be handled much easier. Tokens are objects, they contain their matching literal text, so an input stream can be re-created from the token stream. |
Terminal | A terminal is an element in a grammar rule which is only defined at the right side of the '->' operator in grammar rules. Terminals and
Non-terminals are terms related to the (E)BNF notation which is the general notation for defining grammars. To give you an example of an
EBNF grammar rule, consider this: IfStatementStart -> If Expression Then The elements defined in italics are terminals, they represent tokens, thus here the literal strings 'If' and 'Then'. 'Expression' is not in italic, because it is a Non-terminal, it will be defined further in the grammar, and will then be specified at the left side of the '->' operator. You also see the 'IfStatementStart' element which is the Non-terminal of this grammar rule. This rule means that when you see If Expression Then in the input stream, you can reduce that with a the Non-terminal IfStatementStart. In the end, you can reduce all input to a single Non-terminal and parsing is then complete. |
Non-terminal | See Terminal. An element in an EBNF grammar rule which can be specified at the left and at the right side of the '->' operator. Non-terminals always represent one or more terminals, they never directly represent tokens or strings of text. Non-terminals are essential, because when a stream of tokens is transformed to a stream of non-terminals by a parser, the interpreter can work much faster: it can decide what to do based on a single non-terminal and can be sure the non-terminal is correct, in other words: the token stream which forms the base of the non-terminal is correct. |
Lexical Analyzer | Piece of functionality which scans the input stream of ascii strings for tokens. The TDL lexical analyzer uses a mechanism of regular expressions and tries to match these with the input stream. All matches are tokens, all non-matched text is literal text. It constructs a token stream of all tokens found and returns that stream as the lexical result. |
Parser | Piece of functionality which scans the token stream supplied to it for sets of tokens. The TDL parser will look for sets of tokens are the tokens which form a non-terminal, for example Foreach Entity CrLf will be transformed into the EntityLoopStart non-terminal. All tokens will be transferred to non-terminals, errors will be transferred as LiteralText non-terminals, so the parser will always succeed. |
Interpreter | Piece of functionality which will handle each non-terminal it has to handle. Each non-terminal is handled by a special handler routine, one per non-terminal. These routines are called by a general non-terminal handler which examines the current non-terminal and then calls the right handler routine. The interpreter doesn't know about a template set, it simply sees non-terminals, and based on these non-terminals, it emits strings to the output stream, be it text inside a token or data read from the project. |