[logo] Tcl-Cpp Reference



[intro] [example] [reference] [details]

This page provides a terse but complete reference of the syntax for Tcl-Cpp. This breaks into two parts: The CDL description file, and the usage from within Tcl.


1. CDL desciption file syntax


pass {
<code to be inserted at top of C++ output files>
}

class C++ClassName [-isA "ParentClass ..."] [-castable] {
     constructor {<constructor arg list>}
     method methodName [-static|-dynamic] {<method arg list>} {<return type>}
     method methodName -dummy    {<script>}
     slot   slotName             {<slot type>}
     slot   slotName   -dummy    {<slot type>} [{<set script>} [{<get script<}]]
     classMethod classMethodName {<method arg list>} {<return type>}
     classSlot   classSlotName   {<slot type>}
}
where:

<arg list> = <defType> [ ; <arg list> ]
<defType> = <type> [ -default <default val> | -from <dummy slot name> ]
<type> = void | int | float | str [ -new ]
              | obptr [ -new  | -cast] <ClassName>
              | obref [ -new ] <ClassName>

2. Object syntax within Tcl


<ClassName> [ <instanceName> | #auto ] <constructor arg list> <configuration "-slotName val" pairs>  
<instanceName> <methodName>  <method args> 
<instanceName> config <-slotName val pairs> 
<instanceName> cget -<slotName>
<ClassName> ::  <classMethodName>  <method args> 
<ClassName> ::  config <-classSlotName val pairs> 
<ClassName> ::  cget -<classSlotName>
otcl clear
otcl list
otcl classOf <instanceName>
otclDelete <instanceName>

Go on to the details page.


DAn Ellis <dpwe@icsi.berkeley.edu>
International Computer Science Institute, Berkeley CA 94133
$Header: /n/crab/da/dpwe/src/otcl/html/RCS/tclcppref.html,v 1.4 1997/03/19 01:37:18 dpwe Exp $