Home

News

International

Screen Shots

Documentation

Download

Build

License

Credits

Contact

SourceForge Project

Tintware Documentation : Tint Programming Language : Tint Tutorial : Tint Evaluation

Tint Evaluation

Imagine two buffers, the active buffer and the passive buffer. Each buffer contains characters and each character has a flag indicating whether it is code or data. To start evaluating some text, the text is placed into the active buffer and the passive buffer is initially empty.

While the active buffer is not empty, the front character is removed from the active buffer. If the character is data, it is placed onto the end of the passive buffer. If the character is code, but it is not one of the sequences ##(, #(, (, ), or a comma it is placed onto the end of the passive buffer.

If a ( is found, characters are copied from the front of the active buffer to the end of the passive buffer until a matching ) which is code is found. The parentheses which are code nest; parentheses which are data are just like any other data character. Sharp and comma are copied over to the passive buffer like any other character. The enclosing ( ) are discarded.

If #( or ##( is found, a mark is made in the passive buffer to keep track of the beginning of a call. If a comma is found, a mark is made in the passive buffer to keep track of the argument delimiter.

Finally, if a ) is found, it must be the closing parenthesis of a call. The passive buffer is scanned backwards looking for the first mark indicating the beginning of call. During the backwards scan, arguments are collected. Finally, the call is made. #( and ##( are almost the same, except the result of evaluating #( ) is placed into the active buffer and ##( ) into the passive buffer.