bruk3 / c-net Goto Github PK
View Code? Open in Web Editor NEWC-net programming language
C-net programming language
E..g., Index out of bounds
int main() {
int[] x = new int[10];
x[11] = 1; // fail
return 0;
}
stdin/stdout are reserved keywords.
Its blocking for some reason.
Check nread, read_until ... also
No semantic checking for break/continue statements which have to be in a loop context.
For each test, there should be two files: the source code (.cnet) file,
and the expected output.
Create a new file called ast.ml
and implement the pretty printing functions along with the type declarations in there.
There is a function Char.code that converts a character to its corresponding ascii code
For example e[2] = 3 cannot be parsed
E.g.,
int main() {
"a" * "b" - "c" / "f";
return 0;
}
(1) Do we want to convert char literals to integers?
E.g., This works
int main() {
int x = 'a' + 4;
}
E.g., But this fails
int main() {
char a = 'a';
int x = a + 4;
}
Currently globals can be declared but can't be accessed in the global or other scopes.
E.g., The below gives the error: Semantic error: undeclared identifier global
int global = 0;
int main()
{
global = 5;
return 0;
}
So we should use memcpy for copying instead
Our LRM says that char literals can be in the following formats:
'\123'
'\0' | '\r' | '\n' | '\'
'a' | 'b' | 'c' | ....
but that is not how they are interpreted in the scanner
Look at this slack convo:
https://teampltworkspace.slack.com/archives/C01JNV1GEBD/p1619370503038300
Currently program is a list of declarations. But Vdecl_assign is not included as a declaration. What if we want variable declaration and assignment in one line outside of functions (basically static variable assignment). Do we provide those?
type decl =
Vdecl of vdecl
| Sdecl of strct
| Fdecl of func
type program =
Program of decl list
There is a seg fault bug whenever a string is to be returned from a function
readln should be able to take both sockets and files seamlessly
E.g.,
int main () {
string a = "a";
a += "a";
return 0;
}
Output should reflect concatenation of a ("a") and "a" but currently is: (string : a+=(string : "a"));
String type is not yet automatically collected. Also, as a note to whoever works on this issue, strings should be freed up after return/break statements as well, since they might go out of scope there.
like str.length() and stuff should be recognized and only allowed to be called on the built ins
addition, equality, upper, .... all of them
Fix Makefile
The main function should only be allowed to have the following prototypes:
int main()
int main(int)
int main(int, string[])
If there is a variable of type int[][], delete should work for a member of that array as well. For example,
int[][] x = new int[][5];
x[0] = new int[3];
delete x[0];
should be valid.
For e.g. right now for(int i = 0; i < 5; i += 1) is not valid.
codegen cannot evaluate or match an expr so it needs to be in sexpr form
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.