17
CS269: HW/SW Engineering of Embedded Systems, Winter02
Declarations: APIs
• Additional methods allow us to get specific information from the declarations, without traversing the AST.
–In PackageDecl:
•
–
–
–In ObjectDecl
•Get all subpackages of this package getSubPackages()
•Get subpackage with a given name getSubPackage(name)
•Get all types defined in this package getUserTypes()
•Get an type with a given name getUserType(name)
•Get the superclass getSuperClass()
•Get the interfaces implemented getInterfaces()
•Get all fields/one field getFields()/getField(name)
•Get all ports/one port getPorts()/getPort(name)
•Get all parameters/ only one getParameters()/getParameter(name)
•Get all labels/ only one getLabels()/ getLabel(name)
•Get all methods/all with a name getMethods()/getMethods(name)
•Get all constructors getConstructors()