Project homepage for COMS4115 PLT language project
[LRM] (https://docs.google.com/document/d/16CZNpMWXPUKvg0mIOveiY5zeGYuStMyOfOMYTPph5_4/edit?ts=56269bcd)
Project homepage for COMS4115 PLT language project
Project homepage for COMS4115 PLT language project
[LRM] (https://docs.google.com/document/d/16CZNpMWXPUKvg0mIOveiY5zeGYuStMyOfOMYTPph5_4/edit?ts=56269bcd)
Do we need a way to print non-strings?
Nesting Stitch loops inside other scopes doesn't generate the stitch functions properly
I can now establish a struct that will hold every variable a stitch loop could have access to, and have constructed it at the start of the program. The challenge now is going to be to change how the variables are accessed in the stitch loops to add the proper -> dereferencing before them.
Maybe a separate string_of_expr that adds that to expressions in stitch loops? It's horrifically messy but it would work.
Inside stitch(all?) loops, variable decls are messed up if you don't include { } to signify a new block. Also, stitch can't seem to have variables with the same name as variables declared outside its scope. Looking into ways to fix this.
Need to make sure c generator prints parenthesis when they are included in expressions.
Assignment isn't keeping the RHS in the transition from our semantic analyzer to our C_ast.
Need to try to pass along the expression that's on the right.
Also need to add Vdecl to semantic analyzer so that you can declare and then define a variable.
int main(){
return 1;
}
works, but
int main(){
return;
}
does not.
This will become an issue when we need to type check the return types of functions.
Need to add file open, read, write to headers
Array passing for stitch loops works only for arraydecls, not for inits. Need to go back and rewrite those later on.
As is, there is no 'print' function. check_call correctly catches this, but throws the wrong error.
and check_call (f: string) (el: expr list) (env: stch_env) =
let l_expr_typ = List.map (fun e -> check_expr e env) el in
let func_ret = find_func env.funcs f in
let args_l = find_func_sig f l_expr_typ func_ret in
C_Call(func_ret.fdecl_name, args_l), func_ret.fdecl_type
The second line of this (let func_ret
...) calls find_func
, which should throw an error since print
isn't a known function. However, the error that does get throws is from the next line, from find_func_sig
. It seems like find_fun
is finding a function (possibly with no signature), and returning it, only to have find_func_sig
fail.
Not sure if this is just a strage OCaml issue, or if there is a bigger underlying mistake. Assuming this goes away when we add the default functions (Soon™), we still definatly need to set up a negative test that calls a func that was never declared.
Stitch needs to properly scope variables from the environment
When assigning to a char, Stitch can only handle lowercase but always prints it uppercase (so the test always fails).
char z = 'Z';
Stitch thinks the capital Z is another ID, not a character for some reason.
don't work...
22: shift/reduce conflict (shift 5, reduce 16) on INT
22: shift/reduce conflict (shift 6, reduce 16) on CHAR
22: shift/reduce conflict (shift 7, reduce 16) on FLOAT
It looks like both of these may (may) stem from the LPAREN token, as that is covered by both shift 54 (from state 41) and reduce 16 (from state 22). Might be a good place to start.
General list of tests we need (feel free to edit and add):
negative
error
with invalid data typesarray
decl and access
array
with mismatched type declStitch
loopsper Edwards, we should only diff w/ expected output, since ast -> cast -> pretty print may generate differently formatted but functionally identical code.
Print is weird. I have a skeleton set up inside the semantic analyzer for it, but we need to nail down its arguments. We have 3 options:
-Let it only take in Strings
-Let it take in any type, and have a new "polymorphic" type to compensate
-Let it keep using printf args, and try to figure out how to type check variadic functions in our own type checker (seems really hard, so lets not do this one)
Even if there is no return statement inside a function definition, you can still declare the return type of the function to be int/float. Is this something we want to allow to happen? Or do we want functions that don't have return statements inside to have return type as void by default?
In C, arrays either need:
-explicit size defined at creation
-explicit initialization defined at creation
Right now our code allows int a[]; to get through. I might want stitch to require array sizes defined at creation to make things easier with the code we already have written. Just a reminder for myself.
possible, but not necessary
A bunch of tests were failing because the cast
seems to have been reversing block statements in function calls. I took out a List.rev
in the semantic analyzer, which seems to have fixed the issue.
Can we add a test or two that confirms that this is an actual fix, and didn't break something I'm not thinking of?
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.