Bocca syntax
Background material at:
Extending bocca, Known Babel Types Become Subcommands, and CCA Commandline Tools.
help, init, component, port, package, examples, show, application, import, export, config, SIDLNAME, class and interface We're assuming that by some mechanism not shown, partial sidl names which can be resolved uniquely within the project are allowed in place of fully qualified sidl names.Note by Boyana: the current BGraph provides symbol resolution for partial sidl names. Clide Syntax {optional args in parens}: init PROJECTNAME {DEFAULTLANGUAGE} application APPNAME {LANGUAGE} {ccafe_script_name} component CLASSNAME {LANGUAGE} provides PORTCLASS {PORTINSTANCE {modifiers}} {, additional provided ports} uses PORTCLASS {PORTINSTANCE {modifiers}} {, additional uses ports} port PORTCLASS {extends SIDLNAME} package PACKAGENAME {DEFAULTLANGUAGE} show {components, ports, classes, interfaces, whatever we want to query the project metadata for} config {dump relevant config information from bocca and/or the current project} class SIDLCLASS {LANGUAGE} {additional-sidl-class-modifiers} interface SIDLINTERFACE {additional-sidl-iface-modifiers} copy SIDLNAME NEWSIDLNAME rename SIDLNAME NEWSIDLNAME copytree SUBDIRNAME delete SIDLNAME import CANNED_BOCCA_PACKAGE_OR_SIDL_FILE_OR_SOURCE_TO_BE_DETERMINED_LATER export CANNED_BOCCA_PACKAGE based on the types-as-subcommands, a component can be defined incrementally, avoid hideously long command lines or gobs of switches. CLASSNAME provides PORTCLASS {PORTINSTANCE {modifiers}} {, additional provided ports} CLASSNAME uses PORTCLASS {PORTINSTANCE {modifiers}} {, additional uses ports} CLASSNAME delete PORTINSTANCE APPNAME any_legal_ccaffeine_scripting_statement In particular, the original python createcomponent draft uses switches instead of the little syntax proposed above; the pedantic use of -- is tiresome and it limits the readable use of various modifiers needed for ports that do not follow the default pattern.
I would much rather have named command line options rather than positional arguments. A reliable options parser is required. Alternatives to some of the above (approximate syntax, this needs to be refined to be able to associate instances and modifiers with the correct type). init PROJECTNAME {--language/-l DEFAULTLANGUAGE} application APPNAME {--language/-l LANGUAGE} {ccafe_script_name} component CLASSNAME {--language/-l LANGUAGE} --provides/-p PORTCLASS {--instance/-i PORTINSTANCE {--modifiers/-m modifierslist}} {, additional provided ports} --uses PORTCLASS {PORTINSTANCE {--modifiers/m modifierslist}} {, additional uses ports} port PORTINTERFACE {--extends/-e SIDLNAME} package PACKAGENAME {--language/-l DEFAULTLANGUAGE} class SIDLCLASS {--language/-lLANGUAGE} {--modifiers/-m additional-sidl-class-modifiers} interface SIDLINTERFACE {--modifiers/-m additional-sidl-iface-modifiers} change component --addPort/--removePort PORT_TYPE:PORT_INSTANCE change class --addInterface/--removeInterface INTERFACE_TYPE where PORT_INSTANCE is optional (the instance name is derived from type if not explicitly specified).
Boyana comments: I think the change arguments should be as similar to create as possible (ideally the same whenever it makes sense). So for component/class changes, I suggest: change component --uses/--provides/--remove-port PORT_TYPE:PORT_INSTANCE change class --implements/--remove-interface INTERFACE_TYPE change class/component --extends/--remove-superclass CLASS_TYPE Created by: baallan last modification: Wednesday 15 of August, 2007 [16:50:22 UTC] by norris |
Login Online users
6
online users
|