mirror of
https://github.com/gnustep/libs-steptalk.git
synced 2025-02-20 18:22:02 +00:00
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/steptalk/trunk@13926 72102866-910b-0410-8b05-ffd578937521
60 lines
1.3 KiB
Text
60 lines
1.3 KiB
Text
StepTalk HowTo
|
|
--------------
|
|
|
|
NOTE: This file has to be written.
|
|
|
|
You may consult StepTalk header files.
|
|
|
|
|
|
How to create scripting environment?
|
|
------------------------------------
|
|
|
|
STEnvironment *env;
|
|
|
|
env = [STEnvironment defaultScriptingEnvironment];
|
|
or
|
|
env = [STEnvironment environmentWithDescriptionName:envName];
|
|
|
|
|
|
How to register named objects in the scripting environment?
|
|
-----------------------------------------------------------
|
|
|
|
[env setObject:object forName:@"ObjectName"];
|
|
|
|
like in:
|
|
|
|
[env setObject:transcript forName:@"Transcript"];
|
|
|
|
See: STEnvironment
|
|
|
|
How to create a scripting engine?
|
|
---------------------------------
|
|
|
|
STEngine *engine;
|
|
|
|
engine = [STEngine engineForLanguageWithName:langName];
|
|
|
|
See: STLanguage, STEngine
|
|
|
|
How to execute a code?
|
|
--------------------
|
|
|
|
STEngine *engine;
|
|
id result;
|
|
|
|
NS_DURING
|
|
result = [engine executeCode:string inEnvironment:env];
|
|
NS_HANDLER
|
|
/* handle the exception */
|
|
NS_ENDHANDLER
|
|
|
|
See: STEngine, NSException
|
|
|
|
How to create a language bundle?
|
|
--------------------------------
|
|
Languages/Smalltalk/SmalltalkEngine.m
|
|
Languages/Smalltalk/SmalltalkEngine.h
|
|
|
|
Languages/Smalltalk/STBytecodeInterpreter.m
|
|
- sendSelectorAtIndex:withArgCount:
|
|
|