https://github.com/unidata/ttm
Provide a reference implementation for the TTM programming language.
https://github.com/unidata/ttm
Last synced: 8 months ago
JSON representation
Provide a reference implementation for the TTM programming language.
- Host: GitHub
- URL: https://github.com/unidata/ttm
- Owner: Unidata
- Created: 2012-11-15T19:53:13.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2014-10-05T00:37:02.000Z (over 11 years ago)
- Last Synced: 2025-04-08T13:53:11.341Z (9 months ago)
- Language: C
- Homepage:
- Size: 9.92 MB
- Stars: 10
- Watchers: 6
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Project Description
The goal of the **ttm** project is to provide
a reference implementation for the TTM programming language.
TTM is a form of macro processor similar to TRAC, GAP, and GPM.
# Syntax and Semantics
It is assumed that TTM is given a text file containing some combination
of ordinary text and TTM function calls (i.e. invocations).
The text is scanned character by character. Any ordinary text is passed
to the output unchanged (except when escaped).
If a TTM function is encountered, it is collected and executed.
The general form of a TTM function call looks like this.
#<functionname;arg1;arg2;...;argn>
where the functionname and the arguments are arbitrary character strings
not characters of significance: '#', '<', '>', and ';'.
The function is invoked with the specified arguments and the resulting
text is inserted into the original text in place of the function call.
If the function call was prefixed by a single '#' character, then scanning
will resume just ''before'' the inserted text from the function call. If the
function call was prefixed by two '#' characters, then scanning
resumes just ''after'' the inserted text.
During the collection of a function call, additional function calls
may be encountered, for example, this.
#<functionname;arg1;#<f2;arg;...>;...;argn>
The nested function call will be invoked when encountered and the result
inserted into the text of the outer function call and scanning of
the outer function call resumes at the place indicated by the number
of '#' characters preceding the nested call.
If a function takes, for example, 2 arguments, any extras
are ignored. For user defined functions, if too few arguments
are provided, additional one are added with the value of the empty
string ("").
As with other
applicative programming languages,
a TTM function may be recursive and may be defined as the result
of the invocation of a sequence of other function calls.
Functions are either ''built-in'' or user defined. A large number of built-in
functions exist and are defined in the
[TTM reference manual](https://github.com/Unidata/ttm/blob/master/ttm_batch_processing_pr_08.pdf).
# External Links
* [A reference implementation of TTM.](https://github.com/Unidata/ttm)
* [Caine, S.H. and Gordon, E.K., TTM: An Experimental Interpretive Language. California Institute of Technology, Willis H. Booth Computing Center, Programming Report No. 7, 1968.](https://github.com/Unidata/ttm/blob/master/ttm_interpretive_language_pr_07.pdf)
* [Caine, S.H. and Gordon, E.K., TTM: A Macro Language for Batch Processing. California Institute of Technology, Willis H. Booth Computing Center, Programming Report No. 8 May, 1969.](https://github.com/Unidata/ttm/blob/master/ttm_batch_processing_pr_08.pdf)