CCA Wiki
CCA Software Resources
Menu [hide]

Known Babel Types Become Subcommands

Losing all those pesky switches
print PDF
We're going to be generating a database (in some form) of known CCA/babel Components/Ports/classes/interfaces that bocca manages. Essentially, we know the SIDL type hierarchy at least so far as it interacts with CCA. Given that, then we can imagine the user writing bocca commands like so:
bocca init myproject ; # defaults to package myproject
bocca port X ; # defaults to imply myproject.X extends gov.cca.port
bocca component Foo ; # implies myproject.Foo extends gov.cca.Component, gov.cca.ComponentRelease
bocca Foo provides my_x X ; # implies addProvidesPort(X_cast_from_self, "my_x", "myproject.X", tm); and class Foo implements-all X


Note that nowhere did the user go into a mess of switches. This all hinges on including in the parser below bocca (scripts/cct) the ability to resolve a CCA SIDL class or interface name. Switches or extra keywords are only needed when the user specifies something ambiguous in the known namespaces or wants to do something unusual like provide a port by delegation, e.g.
bocca Foo provides my_x_second X delegated to my_secretary petsc.Secretary
; # implies an instance named my_secretary of sidl class petsc.Secretary that also implements myproject.X should be generated into the Foo private instance data and registered addProvidesPort(my_secretary, "my_x_second", "myproject.X", tm).

Created by: baallan last modification: Wednesday 14 of March, 2007 [00:03:49 UTC] by baallan


Online users
6 online users