davidwatkins / dice Goto Github PK
View Code? Open in Web Editor NEWJava, but worse
License: MIT License
Java, but worse
License: MIT License
File "Compiler_Test_Suite/test-classExtends.dice", line 12, character 7, Syntax Error, token ID(a)
public float xCoord;
public float yCoord;
}
class circle extends shape {
public float radius;
}
class test {
public void main(char[][] args) {
circle a = new circle();
a.xCoord = 1.5;
print(a.xCoord);
}
}```
I also tried declaring and instantiating on different lines, still didn't work.
Probably not but a cool thought exercise
Correctly differentiate the access of functions into structs and functions for LLVM conversion to work correctly; pass class type as first param to all functions
Needs to be done by 11/23
Perhaps our overloading of SAST and codegen data structure is too broad? We might have to do an additional transformation
Currently, code such as:
b = 0.0000000000000000000000000000000000000000000001;
is passed by the Scanner as FLOAT_LITERAL(1e-46) which is past our LRM's float limit of 1e-37. Floats as small as 1e-311 and as large as 1e+308 passed through successfully without overflow.
evaluate what this
binds to
The string.map only adds the path provided by the programmer. Needs to be smarter about the actual path it is storing in its map
Errors should be indicative of where they occurred in the source file. Add support to either the AST, Analyzer, or both in order to support this kind of operation
Every single node should also contain its location and line number
Look at this https://github.com/OCamlPro/ollvm
Instead of being a vdecl
Need to add escaped function to Parser to escape all string literals. Could alternatively add it to scanner
class Foo {}
class Bar {}
class test {
public void main(char[][] args) {
class Baz b;
}
}
Make sure that all defined classes have unique names as well as their functions with specific number of parameters.
Look at the java definition for Math and write the math class functions in our language
http://docs.oracle.com/javase/7/docs/api/java/lang/Math.html
int a = 27;
char b = 93;
result of binop with mixed operand types has type corresponding to the leftmost operand in the expression
char c = b + a;
int a = a + b;
overflow for char addition
char c = b + a + 150;
c; (* 15 *)
Write a function that gets the type of any expression. This will likely involve writing an environment map in the Analyzer module that contains all of the types of classes as well as function return types.
Just another food for thought
Parse the ast and retrieve the names of all fields, functions, and classes so they can be used when ensuring the ast is correct. This way the names of the types can be ensured to be defined somewhere.
Foo a = new Foo();
int[][] a = new a[2][3];
When a user calls a function like:
String a;
a.toString();
The reference to toString needs to be updated in the SAST to:
toString(a);
Not sure how much work this requires, but is worthy of evaluating
http://caml.inria.fr/pub/docs/manual-ocaml/ocamldoc.html
index out of bounds, division by zero, operations on null
this is an incorrect check for duplicate constructors:
Line 83 in 16491e2
This code raises a DuplicateConstructor exception:
class Foo {
2 constructor(int a, bool b, char c, float f) {}
3 constructor(int a, bool b, char c) {}
4 }
Cause: this line doesn't concatenate string representations of all the formals in a given constructor:
Line 67 in 16491e2
It also fails to raise the exception in this case, even though it should:
class Foo {
2 constructor(int a, bool b, char c, float f) {}
3 constructor(bool b, char c, float f, int a) {}
4 }
To resolve this particular case, we should define an order in which to hash the formals (i.e. all bool formals in alphabetical order by name, then all char formals in alphabetical order by name, then ...)
Do we want to define two constructors as being equal if all formals match on both type AND name, or just on type? In other words, should these two constructors be considered equal?
constructor(int a, bool x)
constructor(int a, bool y)
For the following line:
g = '\t';
the tab character should be tokenized as CHAR_LITERAL(\t); however, it's currently getting printed by the dice exec (with -tendl flag) as CHAR_LITERAL().
Duplicate function in parser and scanner
class Foo {}
class Baz {}
class test {
public void main(char[][] args) {
class Baz b;
}
}
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.