Author(s): John Newton, Michael Faraday, Tunku Abdul Rahman
The Programming Language extension name is *.tt
(e.g. add.tt
, function.tt
, etc.)
Language Feature | Code Example |
---|---|
Variable Declaration | int x; |
Add | x + y |
Sub | x - y |
Multiply | x * y |
Divide | x / y |
Modulus | x % y |
Less Than | x < y |
Less Than Equal | x <= y |
Equality | x == y |
Not Equality | x != y |
Greater Than | x > y |
Greater Than Equal | x >= y |
Write | print(x) |
Read | read(x) |
Arrays | int [8] array |
Comments | # This is a comment |
Symbol | Token Name |
---|---|
func | Func |
return | Return |
int | Int |
read | Read |
while | While |
if | If |
else | Else |
break | Break |
continue | Continue |
( | LeftParen |
) | RightParen |
{ | LeftCurly |
} | RightCurly |
[ | LeftBracket |
] | RightBracket |
, | Comma |
; | Semicolon |
+ | Plus |
- | Subtract |
* | Multiply |
/ | Divide |
% | Modulus |
= | Assign |
< | Less |
<= | LessEqual |
> | Greater |
>= | GreaterEqual |
== | Equality |
!= | NotEqual |
variable_name | Ident |
10311517 | Num |
Variables begin with an upper or lower case letters A-Z followed by a sequence of underscores or numbers. Examples include:
int variable_name;
int var1;
int october_31_1517;
Comments can be single line comments starting with #
. For example:
int x; #This is a variable declaration.