* net/loveruby/cflat/ast/MemberNode.java: #name -> #member.

* net/loveruby/cflat/ast/PtrMemberNode.java: #name -> #member.
* net/loveruby/cflat/compiler/TypeChecker.java: follow changes.


git-svn-id: file:///Users/aamine/c/gitwork/public/cbc/trunk@3805 1b9489fe-b721-0410-924e-b54b9192deb8
This commit is contained in:
Minero Aoki 2008-01-05 04:24:00 +00:00
parent 4120f4c40a
commit cf1b3c39a8
4 changed files with 26 additions and 18 deletions

View File

@ -1,3 +1,11 @@
Sat Jan 5 13:23:57 2008 Minero Aoki <aamine@loveruby.net>
* net/loveruby/cflat/ast/MemberNode.java: #name -> #member.
* net/loveruby/cflat/ast/PtrMemberNode.java: #name -> #member.
* net/loveruby/cflat/compiler/TypeChecker.java: follow changes.
Sat Jan 5 13:20:32 2008 Minero Aoki <aamine@loveruby.net>
* net/loveruby/cflat/ast/Declaration.java: removed.

View File

@ -5,15 +5,15 @@ import net.loveruby.cflat.exception.*;
public class MemberNode extends ExprNode {
protected ExprNode expr;
protected String name;
protected String member;
public MemberNode(ExprNode expr, String name) {
public MemberNode(ExprNode expr, String member) {
this.expr = expr;
this.name = name;
this.member = member;
}
public Type type() {
return baseType().memberType(name);
return baseType().memberType(member);
}
public ComplexType baseType() {
@ -29,12 +29,12 @@ public class MemberNode extends ExprNode {
return expr;
}
public String name() {
return name;
public String member() {
return member;
}
public long offset() {
return baseType().memberOffset(name);
return baseType().memberOffset(member);
}
public boolean isAssignable() {
@ -59,7 +59,7 @@ public class MemberNode extends ExprNode {
protected void _dump(Dumper d) {
d.printMember("expr", expr);
d.printMember("name", name);
d.printMember("member", member);
}
public void accept(ASTVisitor visitor) {

View File

@ -5,15 +5,15 @@ import net.loveruby.cflat.exception.*;
public class PtrMemberNode extends ExprNode {
public ExprNode expr;
public String name;
public String member;
public PtrMemberNode(ExprNode expr, String name) {
public PtrMemberNode(ExprNode expr, String member) {
this.expr = expr;
this.name = name;
this.member = member;
}
public Type type() {
return dereferedType().memberType(name);
return dereferedType().memberType(member);
}
public ComplexType dereferedType() {
@ -30,8 +30,8 @@ public class PtrMemberNode extends ExprNode {
return expr;
}
public String name() {
return name;
public String member() {
return member;
}
public boolean isAssignable() {
@ -47,7 +47,7 @@ public class PtrMemberNode extends ExprNode {
}
public long offset() {
return dereferedType().memberOffset(name);
return dereferedType().memberOffset(member);
}
public Location location() {
@ -56,7 +56,7 @@ public class PtrMemberNode extends ExprNode {
protected void _dump(Dumper d) {
d.printMember("expr", expr);
d.printMember("name", name);
d.printMember("member", member);
}
public void accept(ASTVisitor visitor) {

View File

@ -518,7 +518,7 @@ class TypeChecker extends Visitor {
public void visit(MemberNode node) {
check(node.expr());
checkMemberRef(node, node.expr().type(), node.name());
checkMemberRef(node, node.expr().type(), node.member());
}
public void visit(PtrMemberNode node) {
@ -527,7 +527,7 @@ class TypeChecker extends Visitor {
undereferableError(node, node.expr().type());
return;
}
checkMemberRef(node, node.dereferedType(), node.name());
checkMemberRef(node, node.dereferedType(), node.member());
}
protected void checkMemberRef(Node node, Type t, String memb) {