Bartels :: Bartels AutoEngineer :: BAE Documentation :: User Language Programmer's Guide :: Programming System :: Interpreter |
Bartels User Language - Programmer's Guide3.3 Interpreter |
![]() |
The Bartels User Language Interpreter is integrated to the Schematic Editor, the Layout Editor, the Autorouter, the CAM Processor, the CAM View module and the Chip Editor of the Bartels AutoEngineer. I.e., the Bartels User Language Interpreter can be used for calling Bartels User Language programs from each of these BAE modules.
The User Language Interpreter is activated by calling a User Language program from one of the valid interpreter environments. Any User Language program call is processed by applying the subsequently described sequence of operations.
When calling a
User Language program, the
User Language Interpreter first of all must load the required
User Language machine program with the specified program name from the
ulcprog.vdb
file of the BAE programs directory. The
User Language Interpreter applies a compatibility check; a consistency check is not necessary since this time-consuming work has been carried out by the
User Language Compiler already. A
User Language program is compatible to and executable in the current interpreter environment, if the program's
User Language Compiler version is equal to the
User Language Interpreter version, and if the program only references index variable types and system functions which are implemented in the current interpreter environment.
Each User Language program can contain dynamic link requests, i.e. requests on binding User Language library machine code to program machine code at runtime. Dynamic linking is automatically applied during program load. Each dynamic link library (DLL) must be available, and the definitions (variables, functions, function parameters) provided with each DLL machine code must match its definitions at compile time (otherwise the Interpreter might try to access non-existent or wrong library objects, which would result in undefined behavior or even system crash with design data loss). The built-in linker of the User Language Interpreter checks on dynamic link library compatibility and refuses to run the program when encountering any inconveniences (error message ). In case of incompatible DLLs, the User Language program must be recompiled.
After loading (and dynamically linking) the User Language machine program, the User Language Interpreter starts executing the program. Program execution can be understood to be the simulation of the User Language machine architecture by processing the instructions of the machine program. Program execution starts with the first machine program instruction and is completed when the program counter refers to a non-existent machine program instruction.
After executing the machine program a program termination must be applied to release the main memory allocated during program execution (Program Cleanup), and to remove the machine program from main memory (Program Unload).
When calling a User Language program, the name of the program to be executed must be specified. This program name specification can be accomplished either explicitly or implicitly according to one of the subsequently described methods.
The User Language program calls. The function activates a dialog with a program name prompt and a button for interactive User Language program selection:
function from the menu is used for explicitFile | ![]() |
Run User Script | ![]() |
Program Name ? | programname ![]() |
One method of implicit User Language program call is provided by pressing special keys of the keyboard whilst working in the BAE function menu, i.e., this type of implicit User Language program call is possible at any time unless another interactive keyboard input currently is awaited by the system. The specification of the program name is accomplished implicitly by pressing a special key. Table 3-2 contains the list of key bindings provided with the User Language interpreter environments. Programs named bae_* have higher priority than those with module-specific names. When pressing one of the keys listed in table 3-2, the User Language program with the corresponding name is automatically started (if it is available).
Table 3-2: Key-driven Program Call
Key Designator | Interpreter Environment / Program Name | ||||||
---|---|---|---|---|---|---|---|
BAE | SCM | GED | AR | CAM | CV | CED | |
Function Key F1 | bae_f1 | scm_f1 | ged_f1 | ar_f1 | cam_f1 | cv_f1 | ced_f1 |
Function Key F2 | bae_f2 | scm_f2 | ged_f2 | ar_f2 | cam_f2 | cv_f2 | ced_f2 |
Function Key F: | bae_f: | scm_f: | ged_f: | ar_f: | cam_f: | cv_f: | ced_f: |
Function Key F12 | bae_f12 | scm_f12 | ged_f12 | ar_f12 | cam_f12 | cv_f12 | ced_f12 |
Digit Key 0 | bae_0 | scm_0 | ged_0 | ar_0 | cam_0 | cv_0 | ced_0 |
Digit Key 1 | bae_1 | scm_1 | ged_1 | ar_1 | cam_1 | cv_1 | ced_1 |
Digit Key : | bae_: | scm_: | ged_: | ar_: | cam_: | cv_: | ced_: |
Digit Key 9 | bae_9 | scm_9 | ged_9 | ar_9 | cam_9 | cv_9 | ced_9 |
Standard Key a | bae_a | scm_a | ged_a | ar_a | cam_a | cv_a | ced_a |
Standard Key b | bae_b | scm_b | ged_b | ar_b | cam_b | cv_b | ced_b |
Standard Key c | bae_c | scm_c | ged_c | ar_c | cam_c | cv_c | ced_c |
Standard Key : | bae_: | scm_: | ged_: | ar_: | cam_: | cv_: | ced_: |
The User Language Interpreter environments are featuring event-driven User Language program calls, where User Language programs with predefined names are automatically started at certain events and/or operations such as after BAE module start, after loading and/or before saving a design element, when changing the zoom factor or when selecting a toolbar item. Table 3-3 lists the assignment of predefined User Language program names to corresponding interpreter environment events and/or operations. Programs named bae_* have higher priority than those with module-specific names. The BAE module start User Language program call method is most useful for automatic system parameter setup as well as for key programming and menu assignments (see also below). The element save and load program call methods can be used to save and restore element-specific parameters such as the zoom area, color setup, etc.
Table 3-3: Event-driven Program Call
Event | Interpreter Environment / Program Name | ||||||
---|---|---|---|---|---|---|---|
BAE | SCM | GED | AR | CAM | CV | CED | |
On BAE Module Start | bae_st.ulc | scm_st | ged_st | ar_st | cam_st | cv_st | ced_st |
Before BAE Module Exit | bae_exit.ulc | scm_exit | ged_exit | ar_exit | cam_exit | cv_exit | ced_exit |
After Element Load/Close | bae_load.ulc | scm_load | ged_load | ar_load | cam_load | cv_load | ced_load |
After Element Creation | bae_new.ulc | scm_new | ged_new | ar_new | cam_new | cv_new | ced_new |
Before Element Save | bae_save.ulc | scm_save | ged_save | ar_save | cam_save | cv_save | ced_save |
After Element Save | bae_savd.ulc | scm_savd | ged_savd | ar_savd | cam_savd | cv_savd | ced_savd |
On Dialog Activation | bae_dial.ulc | scm_dial | ged_dial | ar_dial | cam_dial | cv_dial | ced_dial |
On Toolbar Selection | bae_tool.ulc | scm_tool | ged_tool | ar_tool | cam_tool | cv_tool | ced_tool |
On Zoom Factor Change | bae_zoom.ulc | scm_zoom | ged_zoom | ar_zoom | cam_zoom | cv_zoom | ced_zoom |
On Mouse Interaction (left mouse button click) |
bae_ms | scm_ms.ulc | ged_ms.ulc | ar_ms.ulc | cam_ms.ulc | cv_ms.ulc | ced_ms.ulc |
On Frame selection with mouse | bae_rect.ulc | scm_rect | ged_rect | ar_rect | cam_rect | cv_rect | ced_rect |
After Symbol/Part Placement | bae_plc | scm_plc.ulc | ged_plc.ulc | ar_plc | ced_plc | ||
After Group Load Operations | bae_grpl | scm_grpl.ulc | ged_grpl | ced_grpl | |||
On Incoming Message (BAE HighEnd) |
bae_msg | scm_msg.ulc | ged_msg.ulc | ar_msg | cam_msg | cv_msg | ced_msg |
Bartels User Language provides system functions for performing key programming and defining menu assignments. It is possible to define key bindings such as key m for activating the mirron User Language program or key U for activating the BAE menu function. New or existing menus and/or menu entries can be (re-)configured to support special User Language program and/or BAE menu function calls. These features provide a powerful tool for configuring the menus of the AutoEngineer modules with integrated User Language Interpreter. It is a good idea to utilize the User Language startup programs for performing automatic key binding and menu setup. For an example on how to provide key bindings and menu assignments see the uifsetup User Language program distributed with the BAE software; this program is indirectly called from the startup programs listed in table 3-3. Even dynamic changes to the AutoEngineer user interface can be supported with special User Language programs for performing online key and menu programming. See the keyprog User Language program for implementations of online key programming facilities.
The keyprog key programming utility available through key 5 can be used in BAE pulldown menu interfaces for assigning BAE menu functions to keys by chosing and , double-clicking a key, clicking the button in the program menu and selecting the desired BAE menu function.
A macro command interpreter is built into the
ulsystem User Language system function, the
bae.ini
key and menu function assignment facilities and the
keyprog online key programming utility to allow for the specification of interaction/command sequences (macros) instead of
User Language program names. Intercation codes must be separated with the
:
character. The
p
prefix is used to identify
User Language program names (this prefix should be omitted if the
User Language program name is the first item in the macro). The
#
prefix emulates a
bae_callmenu User Language function call for activating a BAE menu function. Text input is specified through single-quoted strings.
t
awaits user text input.
s
activates a menu selection, which, if followed by
l
,
m
or
r
and a (zero-based) menu index triggers a menu function similar to a
bae_storemenuiact function call.
m
awaits a mouse click, which, if followed by
l
,
m
or
r
, triggers a mouse click with input coordinates retrieved from the mouse position at the beginning of the interaction sequence if the mouse key in the macro isn't followed by coordinate specifications.
With macro specifications, it is possible to assign submenu functions such as
scmpart:s5:m:t:mr
) to keys. It is also possible to define macros for frequently required interaction sequences such as the
Schematic Editor macro
#500:m:mr:sl3:'4':'0':mr:sl0
for creating a 4mm horizontal graphic line from the current mouse position to the right (SCM symbol graphic pin connection).
Customized parameter settings, key definitions and menu assignments can be stored to the
bae.ini
file in the BAE programs directory. The definitions from this file are loaded once upon BAE startup and can subsequently be accessed with the
varget User Language system function.
The
BAE User Language programs are designed to evaluate relevant definitions from
bae.ini
. Changes to
bae.ini
are activated by simply restarting the affected BAE program module, thus eliminating the need to recompile any of the affected
User Language programs. I.e., with
bae.ini
, user-specific parameter settings can easily be transferred between different BAE versions and/or installations.
The
bae.ini
file provides specific sections for different BAE program modules. Each BAE program module only loads relevant sections from
bae.ini
. The definitions from the
std
section are relevant for all modules.
bae.ini
allows for generic parameter value assignments. The
key
and
fkey
commands are used for standard and function key assignments. The
addmenu
,
addmenuitem
,
addsmenuitem
and
addioitem
kewords allow for menu extensions. Please note that menu items can only be appended to main menus and import/export menus. Menu item insertion is prohibited to preserve online help topic assignment.
A
bae.ini
file with inline documentation for command syntax explanation is supplied with the BAE software. The original version of this file activates the parameter settings from the supplied
BAE User Language programs. I.e., these (default) settings are also activated if the
bae.ini
is not available in the BAE programs directory.
User Language Interpreter errors might occur whilst executing a User Language program call. These errors are reported to the interpreter environment, and a corresponding error message is displayed in the status line of the interpreter environment. The following listings contain all error message definitions of the User Language Interpreter.
The following internal User Language Interpreter errors either refer to memory management problems or indicate User Language Interpreter implementation gaps; these errors are fatal, i.e., they force an abortion of the current interpreter environment:
ERROR : Out of memory! ERROR : Unspecified User Language interpreter error! ERROR : INTERNAL ERROR -- PLEASE REPORT!
The following User Language Interpreter errors refer to program load failures or compatibility problems:
ERROR : Program 'n' already loaded (recursive call)! ERROR : Program 'n' not found! ERROR : Incompatible User Language program version! ERROR : Incompatible index/function reference(s)!
The following
User Language Interpreter errors refer to problems whilst executing a
User Language program, i.e., they might occur at program runtime; these error messages include a program counter
(PCl
) indicating the corresponding machine program line which caused the errors (this information can be used for finding the location of the corresponding source code line if a listing file has been produced by the
User Language Compiler):
(PCl) ERROR : Stack underflow (program structure damaged)! (PCl) ERROR : Stack overflow! (PCl) ERROR : Division by zero is attempted! (PCl) ERROR : Function call error! (PCl) ERROR : System function not available here! (PCl) ERROR : System function not implemented! (PCl) ERROR : User function not found! (PCl) ERROR : Referenced function is of wrong type! (PCl) ERROR : Invalid parameter for referenced function! (PCl) ERROR : Memory protection fault on array access! (PCl) ERROR : Array index out of range! (PCl) ERROR : File access error! (PCl) ERROR : File read error! (PCl) ERROR : File write error!
The following User Language Interpreter errors refer to problems accessing the Bartels AutoEngineer design database (DDB); such errors might indicate an erroneous Bartels AutoEngineer software installation, if they occur whilst loading a User Language program; a database access error occurring whilst program runtime usually is caused by an implementation error in the executed User Language program:
ERROR : Cannot create database file 'n'! ERROR : Read/write error whilst accessing file 'n'! ERROR : Too many open files! ERROR : File 'n' is not a database/DDB file! ERROR : File structure is damaged in file 'n'! ERROR : File structure is erroneous in file 'n'! ERROR : Function not available for old format! ERROR : Database limit exceeded! ERROR : File 'n' is not compatible with program version! ERROR : Element 'n' not found! ERROR : Element 'n' exists already! ERROR : File 'n' not found! ERROR : Record end reached! ERROR : Unspecified database error!
Bartels :: Bartels AutoEngineer :: BAE Documentation :: User Language Programmer's Guide :: Programming System :: Interpreter |
Interpreter
© 1985-2025 Oliver Bartels F+E