greati / gryph Goto Github PK
View Code? Open in Web Editor NEWA programming language for easy graph manipulation.
A programming language for easy graph manipulation.
Structs must go into the program memory.
Still not defined in the BNF. Define before implement!
Parsers for
a : T = {b=2};
In order to allow:
a[2] = 2;
a = f(a)[2];
[1,2,3];
Gives [] parser
The following code creates an infinite loop:
sub range(count : int&; end : int; step : int) : [int]{
l : [int] = [];
while(count < end){
l = l ++ count;
print "eita";
count = count + 1;
print "eita2";
}
return l;
}
count : int = 0;
range(count,100,1);
add x to list
should behave the same way as list = list ++ x
This may change to add x in list
, pending discussion
Remarks:
sub g(a : int=2; b : int) { print a + b; } g(2);
sub f(a : int; b : int; c : int) { print a + b; } f(2,c=1,b=2);
Well defined in the BNF.
e.g.
a : [int] = [];
a = a ++ [1];
print(a);
fails with
*** Exception: Type mismatch ++ operator CallStack (from HasCallStack): error, called at src/Execution/Semantic.hs:736:70 in main:Execution.Semantic
while replacing the second line with
a = a ++ 1;
gives
*** Exception: src/Execution/Semantic.hs:(734,46)-(736,103): Non-exhaustive patterns in case
after
list : [int] = [50, -10, 33];
del 1 from list;
list should be [50, 33]
Well defined in the BNF.
num : float = 0.0;
while (num < 5) {
num = num + 1;
print num;
}
print "done";
Iterates 0 times, printing "done" immediately, while in
num : float = 5.0;
while (num > 0) {
num = num - 1;
print num;
}
print "done";
the while never breaks, printing increasingly larger negative numbers.
It is almost, perhaps, as if it considers all floats to be greater than all integers.
Changing the conditions to be
while (num < 5.0)
and
while (num > 0.0)
gives the correct, expected behavior.
Just put all parsers for expressions together
and substitute the occurrences of "ArithExpr" to a new Expr.
c : char = 'a';
Gives :
(line 3, column 12):
unexpected (GTokCharLit "'a'",AlexPn 74 3 12)
expecting GTokPlus, GTokMinus, GTokNot, GTokLParen, GTokLCurly, ident, number, string, GTokTrue, GTokFalse, GTokLSquare, GTokPipe or GTokLess
*** Exception: user error (parse error)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.