XDCscript Language Reference

From RTSC-Pedia

Jump to: navigation, search
revision tip
—— LANDSCAPE orientation
[printable version]  [offline version]offline version generated on 11-Dec-2017 01:12 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 class—including 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 (or directory) 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 object 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 A hash table of all loaded packages

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 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 object 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-Object.packageBase Absolute path to a package's base directory
XDCscript - Package-Object.packageRepository Absolute path to a package's repository
XDCscript - Package-Type.$patch Patch a package method
XDCscript - Package-Body Implementation of base package methods

Interfaces

XDCscript - Interface-Object Object containing per-interface-features of a module
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

XDCscript - xdc.module Return specified module or interface object
XDCscript - xdc.useModule Specify that a module is used in a configuration
XDCscript - Module-Object Object containing per-module-features of a module
XDCscript - Module-Object.construct under construction
XDCscript - Module-Object.create Create a new Instance object managed by this unit
XDCscript - Module-Object.Instance Casts an Instance object to the type of this module
XDCscript - Module-Object.Module Casts a Module object to the type of this module
XDCscript - Module-Object.Params Module's instance creation parameters
XDCscript - Module-Object.PARAMS Module's default instance creation parameters
XDCscript - Module-Object.$addrof under construction
XDCscript - Module-Object.$instances An array of instance objects managed by this module
XDCscript - Module-Object.$logError Log an error from this module
XDCscript - Module-Object.$logFatal Throw fatal exception from this module
XDCscript - Module-Object.$logWarning Log a warning from this module
XDCscript - Module-Object.$name Canonical name of the module
XDCscript - Module-Object.$objects An array of embedded instance objects managed by this module
XDCscript - Module-Object.$package Package object of package containing the module
XDCscript - Module-Object.$private Private state object of the module
XDCscript - Module-Object.$spec Module specification object
XDCscript - Module-Object.$super The interface from which this module inherits
XDCscript - Module-Object.$used under construction
XDCscript - Module-Object.Config-Name under construction
XDCscript - Module-Object.Constant-Name under construction
XDCscript - Module-Object.EnumVal-Name under construction
XDCscript - Module-Object.Extern-Name under construction
XDCscript - Module-Object.Function-Name Module method
XDCscript - Module-Object.Proxy-Name under construction
XDCscript - Module-Object.Struct-Name under construction
XDCscript - Module-Object.Typedef-Name under construction
XDCscript - Module-Body The implementation of a module


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 target 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 Private state object of the instance
XDCscript - Instance-Object.$super Instance of the inherited-interface
XDCscript - Instance-Object.Config-Name under construction
XDCscript - Instance-Object.Function-Name Instance method
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 A typed structure object
XDCscript - Struct-Object.$addrof under construction
XDCscript - Struct-Object.$alignof The target alignment of a structure
XDCscript - Struct-Object.$offsetof The target offset of a field within a structure
XDCscript - Struct-Object.$private Private state object of the struct
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.$keys 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 Create a deep-copy of this object, leaving references intact
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 This object
XDCscript - Typed-Object.$type The type of this object
XDCscript - Typed-Object.$unseal Unseal a typed object or one of its fields

See also

The XDCscript Language XDCscript overview

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 11-Dec-2017 01:12 UTC
Copyright © 2008 The Eclipse Foundation. All Rights Reserved
Personal tools
package reference