gov.llnl.babel.visitor
Class AddDefaultsVisitor
java.lang.Object
gov.llnl.babel.visitor.Visitor
gov.llnl.babel.visitor.AddDefaultsVisitor
public class AddDefaultsVisitor
- extends Visitor
Iterates over a AST a second time to decorate a primed SymbolTable
with all the details about classes, interfaces, and structs
Type resolution is largely performed in this stage.
- See Also:
SymbolTablePrimer
Methods inherited from class gov.llnl.babel.visitor.Visitor |
visitArgument, visitArgumentList, visitArrayType, visitAssertion, visitAttribute, visitAttributeList, visitBinaryExpr, visitBooleanLiteral, visitCharacterLiteral, visitDComplexLiteral, visitDocComment, visitDoubleLiteral, visitEnsures, visitEnumeration, visitEnumItem, visitExtents, visitFComplexLiteral, visitFixedType, visitFloatLiteral, visitFromClause, visitFuncExpr, visitImportClause, visitIntLiteral, visitInvariants, visitMethodList, visitName, visitNode, visitPackage, visitRArrayType, visitRequireClause, visitRequires, visitScopedID, visitScopedIDList, visitSIDLFile, visitSplicerBlock, visitSplicerImpl, visitSplicerImplList, visitSplicerList, visitStringLiteral, visitStructItem, visitStructType, visitThrowsList, visitUnaryExpr |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
d_msgs
protected MsgList d_msgs
AddDefaultsVisitor
public AddDefaultsVisitor(MsgList msgs)
visitClassType
public java.lang.Object visitClassType(ClassType node,
java.lang.Object data)
- Add defaults at the Class Level.
1. If the class is SIDL_BASECLASS, implement SIDL_BASEINTERFACE
2. If the class doesn't inherit anything, extend SIDL_BASECLASS
TBD:
- Should defaults be assigned for class-level splicer blocks?
What about C's "int ignore;" and F90's "integer :: placeholder"?
- If so, then how should the different kind and number of blocks
for each language be handled? (For example, C has two splicer
blocks --- _data and _includes --- in it's header while, ignoring
method-specific blocks, Java has four --- _imports, _data, _load
(for static), and _misc.)
- What is the most desirable way of handling default comments
in splicer blocks given the different comment syntax for each
language?
- Overrides:
visitClassType
in class Visitor
visitInterfaceType
public java.lang.Object visitInterfaceType(InterfaceType node,
java.lang.Object data)
- Add defaults as the interface level
1. If it's not SIDL_BASEINTERFACE, and it has no extends, extend
SIDL_BASEINTERFACE
- Overrides:
visitInterfaceType
in class Visitor
visitMethod
public java.lang.Object visitMethod(Method node,
java.lang.Object data)
- Method level defaults
1. Add implicit Runtime Exception to every throws list
2. Add default splicer block contents --- at least for the
method body.
TBD:
- What about the default splicer block contents for each F90
method's use?
- Overrides:
visitMethod
in class Visitor