Skip to content

danieltan1517/CS152_Language_Example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Teh Tarik Programming Language

Author(s): John Newton, Michael Faraday, Tunku Abdul Rahman

Language Extension

The Programming Language extension name is *.tt (e.g. add.tt, function.tt, etc.)

Language Features

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

Table of Symbols

Symbol Token Name
func Func
return Return
int Int
print Print
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

Variable Identifier Names

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

Comments can be single line comments starting with #. For example:

int x; #This is a variable declaration.

About

CS152 Language Example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages