Baumeister Mediasoft Engineering BME - Baumeister Mediasoft Engineering  Introduction - English Version Einleitung - Deutsche Version
Baumeister Mediasoft Engineering
Bartels AutoEngineerCarLogServicesResourcesCompany ProfileContact Us
Baumeister Mediasoft Engineering » Bartels AutoEngineer » BAE Documentation » User Language Programmer's Guide » Introduction
Bartels User Language - Programmer's GuideBartels AutoEngineer® Documentation

Chapter 1
Introduction

This chapter introduces the basic concepts of the Bartels User Language. It describes the purpose of the Bartels User Language, provides remarks on the characteristics of this programming language, and introduces the Compiler and the Interpreter of the Bartels User Language programming system.

 

Contents

1.1What is Bartels User Language?
1.1.1Purpose
1.1.2Components
1.2Characteristics of the Bartels User Language
1.2.1Bartels User Language Compared to C
1.2.2Data Types, Constants, Variables
1.2.3Operators, Assignments
1.2.4Control Structures
1.2.5Program Flow, Functions
1.2.6Special In-Build Features

 

1.1 What is Bartels User Language?

 

1.1.1 Purpose

Bartels User Language introduces almost unlimited features for accessing database contents and activating system functions of the Bartels AutoEngineer (BAE). With Bartels User Language the BAE user e.g., is able to

  • produce manufacturer-specific CAM Processor outputs
  • implement and integrate user-specific menu functions ("macros")
  • provide special report functions
  • introduce special design rule checkers
  • develop automatic library management routines
  • implement special automatic part placement and routing features
  • provide CAM batch programs
  • apply the Neural Rule System throughout the AutoEngineer
  • integrate customer-specific relational databases
  • provide tools for third party design data input/output

Bartels AutoEngineer provides powerful features for transparently integrating User Language programs to the BAE menu system. Key bindings can be used to define hotkeys for calling frequently required User Language programs.

There might be BAE users out there not being very skilled at software development. Our customers are not necessarily expected to spend their time practicing extensive User Language programming (though they of course can do that). The User Language concept rather enables Bartels System to implement almost arbitrary advanced and/or additional BAE software features without the need to change the BAE software kernel which would require a time-consuming BAE software release process. Due to this concept, Bartels System is able to offer superior quality in software support, i.e., highest flexibility and shortest response time at the implementation of customer-specific BAE features. As a result, a large number of User Language programs developed due to user-specific demands are delivered with the BAE software. Since these programs are provided with source code, BAE users easily can adjust them to even more specific requirements. See chapter 4 of this manual for a list of the User Language programs provided with the BAE software (including short program descriptions), and for information on how to install these programs for proper use throughout the Bartels AutoEngineer.

 

1.1.2 Components

Bartels User Language consists of its language definition, the Bartels User Language Compiler and the Bartels User Language Interpreter, respectively.

Definition of the User Language Programming Language

Bartels User Language is a C-based programming language including powerful internal object-oriented programming (OOP) features such as automatic memory management for list processing, string (class) data type, etc. Bartels User Language provides special variable types for accessing the design database (DDB) of the Bartels AutoEngineer. A system function library containing standard functions (as known from C) and BAE system functions is included with the Bartels User Language. See chapter 2 for a detailed description of the User Language definition. See appendix B for a detailed description of the variable types defined for accessing DDB. See appendix C for a complete description of the functions included with the User Language system function library.

Bartels User Language Compiler

The Bartels User Language Compiler (ULC) is used for translating the Bartels User Language source code files into machine code to be executed by the Bartels User Language Interpreter. The translation process includes checks on data type compatibility as well as on program executability. The compiler is able to run optimizer passes optionally. Special compiler options can be used to generate linkable Bartels User Language libraries. The built-in Linker of the User Language Compiler features both static library linking (at compile time) and preparation of dynamic library linkage (at runtime). See chapter 3.2 for a complete description of the User Language Compiler.

Bartels User Language Interpreter

The Bartels User Language Interpreter is used to execute compiled User Language programs, i.e., to (dynamically link and) run User Language machine programs generated by the User Language Compiler. 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., compiled User Language programs can be called from any of these Bartels AutoEngineer modules. The program call facilities include explicit program calls from a special BAE menu function as well as implicit program calls by function key-press or program module startup. See chapter 3.3 for a complete description of the Bartels User Language Interpreter.

 

1.2 Characteristics of the Bartels User Language

 

1.2.1 Bartels User Language Compared to C

The Bartels User Language source file format is based on the C programming language. As with C and/or C++, comments are enclosed with /* at the beginning and */ at the end or can start with // and are delimited by the end of the line.

Bartels User Language supports the basic data types char, int and double. The C basic data type float as well as pointers and the possibility of qualifying basic data types (short, unsigned, long) are not supported by Bartels User Language. The User Language basic data type string can be used for representing char arrays. Another extension to C is the User Language basic data type index, which provides access to the Bartels AutoEngineer Design Database (DDB) via predefined index types. Thereby index can be understood as index to a vector of DDB structures. A special operator is available for accessing the index-addressed structure elements. The index types and the corresponding structure elements are predefined (see appendix B).

User Language provides dynamic array memory management. This means, that there is no need to define array length limits. Bartels User Language even allows for direct assignments of type compatible complex data types (structures, arrays) with equal dimensions.

Bartels User Language does not support explicit declaration of storage classes auto, extern and register. Variables defined in functions (local variables) are supposed to be of storage class auto and those defined outside any function (global variables) are supposed to be global unless they are explicitly declared static. Functions defined in the program text are assumed to be global, unless they are explicitly defined static. The scope of global variables and functions covers the whole program, whilst static variables and functions are valid only in the currently compiled program text (but not in any other program or library module yet to be linked with the program).

Bartels User Language provides a macro preprocessor to support language expansion mechanisms. As with C, the preprocessor statements #include, #define, #undef, #if, #ifdef, #ifndef, #else and #endif are available.

 

1.2.2 Data Types, Constants, Variables

Bartels User Language provides the basic data types char (character), int (numeric integer value), double (double precision numeric real value), string (character array) and index (predefined index to DDB structure; see appendix B). Moreover complex composed data type definitions (vectors and/or array as well as structures) can be derived from basic data types.

Basic data types can be represented by constants. char constants must be delimited by single quotes. string constants must be delimited by double quotes. Special characters in char or string constants must be prefixed by the backslash escape character (\). Integer constants (int) can be specified in decimal (base 10), octal (base 8) or hexadecimal (base 16) representation. Numeric real constants (double) can be specified either in fixed floating point representation or in scientific floating point representation (with exponent).

Constant expressions are composed of constants and operators. Constant expressions are evaluated by the Bartels User Language Compiler during the translation process (CEE - Constant Expression Evaluation).

All variables must be declared before use. A variable declaration determines the name and the data type of the variable. Variable names (identifiers) must start either with a letter or an underscore (_) and can then have letters, digits or underscores in accordance with the C standard. The Bartels User Language Compiler distinguishes between lower and upper case letters. Variable declarations can contain variable value initializations. The User Language Compiler issues warning messages when accessing variables which have not been initialized, and the User Language Interpreter assigns type compatible null values to such variables.

 

1.2.3 Operators, Assignments

Bartels User Language supports all the C-known operators (?:, +, -, *, /, %, >, >=, <, <=, ==, !=, &&, ||, !, ++, --, &, |, ^, <<, >>, ~). The operator evaluation sequence and priority correspond to the C programming language. Operands of different data types are automatically casted to a common and/or operator-compatible data type if possible (the User Language Compiler issues an error message if this is not possible). The add operator (+) and the comparison operators (>, >=, <, <=, ==, !=) can operate directly on the string data type.

Assignments usually are performed with the general assignment operator (=). The expression value on the right side of the equal sign is assigned to the variable on the left side. Bartels User Language also provides the composed assignment operators as known from C (+=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>=).

 

1.2.4 Control Structures

The sequence of the instructions to be executed by a program is determined by control structures. Bartels User Language provides all C-known control structures except for the goto statement and the definition of labels. I.e., the available Bartels User Language control structures are if, if-else, switch, while, for, do-while, break and continue. A special User Language control structure is introduced by the forall statement which provides a scan of the specified index data type and can be conditional.

 

1.2.5 Program Flow, Functions

Usually, a function is defined for solving a certain sub-problem derived from different tasks. Using functions can simplify the process of software maintenance considerably. Bartels User Language provides a function library containing a predefined set of system functions (see appendix C). Beyond that the programmer can write his own functions (user functions). The definition and declaration of the user functions and their parameters correspond to the C programming language. The first user function to be called by the Bartels User Language Interpreter when running a program is the one named main. A User Language program not containing a main function usually won't do anything at all. Bartels User Language does not distinguish between "call-by-value" and "call-by-reference" when passing function parameters. All function parameters are evaluated using the "call-by-reference" method. Therefore no pointers are required for passing changed parameter values back to the caller of a function.

 

1.2.6 Special In-Build Features

Bartels User Language provides some powerful in-build features worthwhile to be mentioned here especially.

A BNF precompiler is integrated to the Bartels User Language. This BNF precompiler with its corresponding scanner and parser functions can be utilized to implement programs for processing almost any foreign ASCII file data format. See section 2.6.4 for a detailed description of the BNF precompiler facilities.

Bartels User Language provides SQL (Structured Query Language) functions for maintaining relational databases, thus introducing powerful software tools for programming database management systems. These tools e.g., can be utilized for integrating a component database to the Bartels AutoEngineer for performing stock and cost expenditure analysis on different variants of a layout including facilities for choosing components with controlled case selection and part value assignment. This is just one example from the wide range of possible database applications. Utilizing database systems could also be worthwhile in the fields of project and version management, address list maintenance, production planning and inventory control, supplier and customer registers management, etc. See appendix C of this documentation for the descriptions of the SQL system functions.

Baumeister Mediasoft Engineering » Bartels AutoEngineer » BAE Documentation » User Language Programmer's Guide » Introduction

Introduction • © 1985-2017 Oliver Bartels F+E • Updated: 29 October 2008, 12:56 [UTC]

Baumeister Mediasoft Engineering, Clontarf, Dublin 3, Ireland
© 2017 Manfred Baumeister

Introduction - English Version Einleitung - Deutsche Version