TLMP programmer guide

We are introducing here TLMP programming. You must know the C++ language to use TLMP.


Using tags

The TLMP system is mapped over standard C++. The TLMP constructs are presented with HTML like tags. This was done for various reasons:

  • Tools to manipulate the tree structure of a program must work even if the underlying C++ is broken (A { is missing). The tledit editor is one of those. It can show the high level tree structure of a program directly and manipulate the code at this level.
  • It is easy to parse, so the implementation of tlcc (the TLMP to C++ translator) is a simple project.
  • It is somewhat readable. You can use any editor to write TLMP code.

So TLMP tags are generally working like this


<tag parameter>

TLMP tags


Tag list

Here are the tags used by TLMP:


One little example

here is a little code snippet to get started.

#include <stdio.h>

int main (int argc, char *argv[])
	int count;
	glocal.count = 0;
	<call loadfile>("/tmp/file",true);
		<f oneline>
		<f empty>
			printf ("The file is empty\n");
	return 0;

One little example

This little program counts the number of lines in a text file and print a message if the file is empty. NEW

Tag definition


The call tag executes a component. It expects a single parameter: the name of the component (the function to call). In general a "call" tag is followed by one or more "f" tags and then a closing "call" tag.

The component is a C++ function. It receives parameters. They are supplied using normal C++ syntax, right after the closing > of the call tag.

<call loadfile>("filename",true);
<f oneline>
	printf ("oneline: %s\n",line);

Using the call tag

Table of content