From RTSC-Pedia
[printable version] [offline version] | offline version generated on 02-Oct-2009 22:10 UTC |
XDCscript Language Reference
Elements of the RTSC meta-language
Contents |
This reference provides reference material for the methods and objects available to all XDCscript code. For overview information about XDCscript programming see the XDC Script User's Guide.
Although the script language used throughout XDCtools is JavaScript, these tools also provide a set of XDCtools-specific functions that allow scripts to load and manipulate "typed objects" defined by the XDCscript Language Summary. These objects include all modules, interfaces, and packages. In addition, XDCscript JavaScript embedding provides access to any Java classincluding the entire Java Runtime Environment (JRE) . This enables these scripts to portably run on any host and perform any function that a Java program can perform, including running and interacting with external command line utilities.
Root object
XDCscript - xdc | The distinguished root object |
XDCscript - xdc.csd | Get current script directory |
XDCscript - xdc.curPath | Return the current package path |
XDCscript - xdc.exec | Execute external command |
XDCscript - xdc.findFile | Find file along the package path |
XDCscript - xdc.getErrors | Return array of errors |
XDCscript - xdc.getWarnings | Return array of warnings |
XDCscript - xdc.getPackageBase | Return a package's base directory |
XDCscript - xdc.getPackageRepository | Return a package's repository |
XDCscript - xdc.global | The original JavaScript Global object |
XDCscript - xdc.loadCapsule | Load specified capsule |
XDCscript - xdc.loadPackage | Load specified package |
XDCscript - xdc.loadTemplate | Create a template from a template file |
XDCscript - xdc.loadXML | Load an XML file |
XDCscript - xdc.jre | Top-level Java Runtime Environment object |
XDCscript - xdc.module | Return specified module or interface object |
XDCscript - xdc.om | Top-Level object of current domain model |
XDCscript - xdc.print | Print a message |
XDCscript - xdc.setCurPkgBase | Set the current package base |
XDCscript - xdc.traceEnable | Enable debug trace output |
XDCscript - xdc.useModule | Specify that a module is used in a configuration |
Object model
XDCscript - xdc.om | Top-Level object of current domain model |
XDCscript - xdc.om.$curpkg | A model-specific current package |
XDCscript - xdc.om.$homepkg | A model-specific home package |
XDCscript - xdc.om.$modules | Array of all modules in the current model |
XDCscript - xdc.om.$name | Model name |
XDCscript - xdc.om.$packages | Array of all packages within the current model |
XDCscript - xdc.om.$root | A model-specific root object |
XDCscript - xdc.om.Package-Name | under construction |
Capsules
Capsules are the fundamental unit of implementation for the meta-domain. Each capsule exposes a set of public variables and functions to its client.
XDCscript - xdc.loadCapsule | Load specified capsule |
XDCscript - Capsule-Object | under construction |
XDCscript - Capsule-Object.$trace | Print a trace message |
XDCscript - Capsule-Object.$traceQuery | Query whether capsule debug trace is enabled |
XDCscript - Capsule-Body | Contents of a capsule |
Templates
Templates are objects used to generate a formatted output text stream following a prescribed pattern specified by a template file. Clients invoke templates with specific arguments and designate a sink for all generated output.
XDCscript - xdc.loadTemplate | Create a template from a template file |
XDCscript - Template-Object | under construction |
XDCscript - Template-Object.genFile | Generate textual output file from a template |
XDCscript - Template-Object.genStream | Generate textual output stream from a template |
XDCscript - Template-Body | Contents of the template file |
Packages
XDCscript - xdc.loadPackage | Load specified package |
XDCscript - Package-Object | Object containing package-wide features of a package |
XDCscript - Package-Object.$interfaces | Array of interfaces contained in this package |
XDCscript - Package-Object.$modules | Array of modules contained in this package |
XDCscript - Package-Object.$name | Name of the package |
XDCscript - Package-Object.$spec | Package specification object |
XDCscript - Package-Object.$vers | The version of this package |
XDCscript - Package-Type.$patch | Patch a package method |
XDCscript - Package-Body | Implementation of base package methods |
Interfaces
XDCscript - Interface-Object.Instance | under construction |
XDCscript - Interface-Object.Module | under construction |
XDCscript - Interface-Object.$name | under construction |
XDCscript - Interface-Object.$package | under construction |
XDCscript - Interface-Object.$super | under construction |
XDCscript - Interface-Object.Constant-Name | under construction |
XDCscript - Interface-Object.EnumVal-Name | under construction |
XDCscript - Interface-Object.Extern-Name | under construction |
XDCscript - Interface-Object.Struct-Name | under construction |
XDCscript - Interface-Object.Typedef-Name | under construction |
XDCscript - Interface-Body | under construction |
Modules
The table below provides reference information for the meta-language functions that implement the module methods common to all modules. These functions enable every module to interact with its environment at key points of the module's lifecycle.
- when the module is first loaded;
- when the module is used;
- when instance objects are created; and
- as part of model validation just prior to any generation process.
XDCscript - Module-Body.module$meta$init | Initialize meta-domain module state |
XDCscript - Module-Body.module$static$init | Initialize module's State object |
XDCscript - Module-Body.module$use | Use other modules required by this module |
XDCscript - Module-Body.module$validate | Validate current domain object model |
Instances
XDCscript - Instance-Object | Object containing per-instance-features of a module |
XDCscript - Instance-Object.$index | Serial number of the instance |
XDCscript - Instance-Object.$module | The Module object that manages this instance |
XDCscript - Instance-Object.$name | Canonical name for the instance |
XDCscript - Instance-Object.$package | The Package object containing the module managing this instance |
XDCscript - Instance-Object.$private | under construction |
XDCscript - Instance-Object.$super | Instance of the inherited-interface |
XDCscript - Instance-Object.Config-Name | under construction |
XDCscript - Instance-Object.Function-Name | under construction |
XDCscript - Instance-Body | The implementation of a module's instance methods |
XDCscript - Instance-Body.instance$meta$init | Initialize a meta-only module's instance |
XDCscript - Instance-Body.instance$static$init | Statically initialize a target module's instance object |
Proxies
XDCscript - Proxy-Object | Module object for a proxy |
XDCscript - Proxy-Object.delegate$ | Module that implements the proxy's interface |
Structs
XDCscript - Struct-Object | under construction |
XDCscript - Struct-Object.$addrof | under construction |
XDCscript - Struct-Object.$alignof | The target alignment of a structure |
XDCscript - Struct-Object.$private | under construction |
XDCscript - Struct-Object.$sizeof | The target size of a structure |
XDCscript - Struct-Object.Field-Name | under construction |
Vectors
XDCscript - Vector-Object | A typed JavaScript array |
XDCscript - Vector-Object.length | Get or set the number of values in a vector |
XDCscript - Vector-Object.$add | Append element to the end of a vector |
XDCscript - Vector-Object.$addrof | Get address of vector element |
XDCscript - Vector-Object.Element-Index | under construction |
Maps
XDCscript - Map-Object | An ordered hash table type |
XDCscript - Map-Object.length | under construction |
XDCscript - Map-Object.Element-Index | under construction |
XDCscript - Map-Object.Element-Name | under construction |
Typed Objects
XDCscript - Typed-Object | Objects specified by the RTSC Interface Definition Language |
XDCscript - Typed-Object.$copy | under construction |
XDCscript - Typed-Object.$orig | The most specific typed-declaration for this object |
XDCscript - Typed-Object.$seal | Seal a typed object or one of its fields |
XDCscript - Typed-Object.$sealed | Test a typed object or one of its fields for being read-only |
XDCscript - Typed-Object.$self | under construction |
XDCscript - Typed-Object.$type | under construction |
XDCscript - Typed-Object.$unseal | Unseal a typed object or one of its fields |
See also
NOTE: The following documents are obsolete but contain information that has yet to be moved to the current document
XDCscript Language Summary | XDCscript language quick reference |
[printable version] [offline version] | offline version generated on 02-Oct-2009 22:10 UTC |