-
Notifications
You must be signed in to change notification settings - Fork 1
Syntax
Nick Buonincontri edited this page Feb 17, 2018
·
8 revisions
Arithmetic ops
+ - * / % ^
Relational ops
== != < > <= >=
([a-z])([a-zA-Z]|[0-9]'_''\'')
id ':' Farg (-> Farg)^*(endline)
Int
Double
Bool
T
T <targ(, targ)*>
literally initialized:
myT : T<n, m>
mtT = [1...n]
SV -> Int | id | sv OP sv
matProduct : T<a,b> -> T<b,c> -> T<a,c>
matProduct : mat1 mat2 = mat1[i,j] * mat2[j, k]
matProduct : T<a,b> -> T<b,c> -> T<a,c>;
matProduct : mat1 mat2 = mat1[i,j] * mat2[j, k];
{
some expression;
}
Left of the colon lives in the scope above Right of the colon lives scope of the function Declaration and Definition must be next to each other
all the types, and...
if
then
else
main
// C style comments, one line
/*
More comments
on multiple lines
*/