|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectlab7.ReflectiveVisitor
lab7.NodeVisitor
coursesolutions.CourseTypeSetVisitor
public class CourseTypeSetVisitor
Sets the class of all AST nodes
| Field Summary |
|---|
| Fields inherited from class lab7.ReflectiveVisitor |
|---|
debug |
| Constructor Summary | |
|---|---|
CourseTypeSetVisitor()
|
|
| Method Summary | |
|---|---|
void |
defaultVisit(java.lang.Object o)
Pass the visitor down |
void |
perform(AbstractNode root)
Here is where semantic analysis happens. |
void |
setType(java.lang.Object o,
Type t)
|
void |
visit(AssignTypeRequiring atr)
Insist both children have the same type, set this note to that type |
void |
visit(BinaryComputeIsh ei)
Insist both children have the same type, set this note to that type |
void |
visit(BoolTypeProducing btp)
|
void |
visit(CastNode n)
Cast node -- insist on type of left child |
void |
visit(ClassDeclaring c)
|
void |
visit(FieldReferencing sr)
|
void |
visit(FloatTypeProducing ftp)
|
void |
visit(IntTypeProducing itp)
|
void |
visit(InvokeIsh inv)
|
void |
visit(LocalReferencing r)
Set this node's type to the type of the reference by symbol-table lookup |
void |
visit(NewIsh ni)
|
void |
visit(ReturnIsh rt)
|
void |
visit(StringTypeProducing stp)
|
void |
visit(ThisIsh t)
|
void |
visit(TypeAsserting rtp)
|
void |
visit(UnaryComputeIsh ui)
|
void |
visitBothSame(AbstractNode n)
Make sure both children have the samet ype, then set this node to that type |
| Methods inherited from class lab7.NodeVisitor |
|---|
err, err, out, out, setPrintStream |
| Methods inherited from class lab7.ReflectiveVisitor |
|---|
dispatch, performVisit |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CourseTypeSetVisitor()
| Method Detail |
|---|
public void perform(AbstractNode root)
perform in class ReflectiveVisitorpublic void defaultVisit(java.lang.Object o)
defaultVisit in class NodeVisitorpublic void visit(NewIsh ni)
public void visit(ClassDeclaring c)
public void visit(ThisIsh t)
public void visit(LocalReferencing r)
public void visit(InvokeIsh inv)
public void visit(ReturnIsh rt)
public void visit(FieldReferencing sr)
public void visit(BoolTypeProducing btp)
public void visit(IntTypeProducing itp)
public void visit(FloatTypeProducing ftp)
public void visit(StringTypeProducing stp)
public void visit(TypeAsserting rtp)
public void visit(UnaryComputeIsh ui)
public void visit(BinaryComputeIsh ei)
public void visit(CastNode n)
public void visit(AssignTypeRequiring atr)
public void visitBothSame(AbstractNode n)
public void setType(java.lang.Object o,
Type t)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||