编译器语法分析,语义分析,属性计算部分快完成了

下面的代码成功分析:
class Shape {
//测试成员,无意义
private int[][] arr = new arr[10][10];
public const int max = 250, min = 0;
public Shape s;
public void draw() {}
public string toString() {
return "Shape";
}
public void main(String[] args) {
Shape[] lines = new Shape[10];
int i;
for (i = 0; i < lines.length; i++) {
lines[i] = new Line(Random.int(), Random.int());
lines[i].draw();
}
}
}
class Line extends Shape {
private int x, y;
public Line(int x, int y) {
this.x = x;
this.y = y;
}
public void draw() {
Sys.println(this.toString());
}
public string toString() {
return "Line:" + String(x) + " " + String(y);
}
}
语法类似JAVA,不支持的东西有 接口,静态成员(有时间的话再加上),需要改进的地方, 错误提示系统
PS:今天班主任发飚了,我们班出勤率全院最低,明天开始严打,一天不上课通报学院,看来不能逃课写程序了 (-_-)