Welcome to the Bartels Group of Companies
Konventionen - Deutsche Version Lexical Conventions - English Version

Bartels System GmbH
Bartels AutoEngineer
BAE Product Info
BAE Price List
BAE Downloads
BAE Documentation
BAE Installation Guide
BAE User Manual
BAE Libraries
User Language Programmer's Guide
1 Introduction
2 Language Description
2.1 Introducing User Language Programming
2.2 Lexical Conventions
2.2.1 Spacing
2.2.2 Identifiers
2.2.3 Constants and Constant Expressions
2.2.4 Terminal Symbols
2.3 Data Types and Definitions
2.4 Expressions
2.5 Control Structures
2.6 Preprocessor Statements
2.7 Syntax Definition
3 Programming System
4 BAE User Language Programs
A Conventions and Definitions
B Index Variable Types
C System Functions
BAE Update History
BAE Next Version Release Notes Preliminary
BAE V8.0 Release Notes
BAE V7.8 Release Notes
BAE V7.6 Release Notes
BAE V7.4 Release Notes
BAE V7.2 Release Notes
BAE V7.0 Release Notes
BAE V6.8 Release Notes
BAE V6.6 Release Notes
BAE V6.4 Release Notes
BAE V6.2 Release Notes
BAE V6.0 Release Notes
BAE V5.4 Release Notes
BAE V5.0 Release Notes
BAE V4.6 Release Notes
BAE V4.4 Release Notes
BAE V4.2 Release Notes
BAE V4.0 Release Notes
BAE V3.4 Release Notes
BAE Support
BAE Contributions
BAE Development and Service Companies
Electronics Development
Bartels Sport Service
Company Profile
Corporate Info
Bartels :: Bartels AutoEngineer :: BAE Documentation :: User Language Programmer's Guide :: Language Description :: Lexical Conventions
Bartels User Language - Programmer's Guide

2.2 Lexical Conventions

Bartels AutoEngineer® Dokumentation

Bartels User Language defines spacing, identifier, constant, reserved word and operator token classes.


2.2.1 Spacing

The spacing token class includes blanks, tabulators, newlines and comments. Comments start with the token /* and end with */; they do not nest. Another type of comment starts with the token // and extends to the end of line. Spacings are ignored by the Compiler except as they serve to separate adjacent identifiers, reserved words and constants.


2.2.2 Identifiers

An identifier is the name of a variable, a function or a symbolic constant. Each Identifier consists of a sequence of letters and digits. The first identifier character must be a letter. The underscore (_) is treated as a letter. The User Language Compiler distinguishes between upper case letters and lower case letters (case-sensitivity). Identifiers must differ from reserved words (see below).


X_coord   value   P4   File_Name   _euklid

2.2.3 Constants and Constant Expressions

This section describes the Bartels User Language constant types.

Integer Constants

Numeric integer constants are associated with the data type int. They consist of a sequence of digits, and they are usually interpreted as decimal numbers. A constant integer specification is interpreted as octal number (in base 8), if it starts with 0 (digit zero), in which case the digits 8 and 9 are not allowed. A constant integer specification is interpreted as hexadecimal number (in base 16), if it starts with 0x or 0X (digit zero followed by letter x) in which case the letters a to A through f to F correspond to the hexadecimal digit values 10 through 15. Negative integer constants are not provided (the minus sign rather works as operator in order to form negative constant integer expressions; see below).


1432   073   0xF4A5   9

Floating Point Constants

Floating point constants are associated with the data type double. They consist of an integer part, a decimal point (.), a fraction part, an e or E character (letter e), and an optionally signed integer exponent. Either the integer part or fraction part (not both) can be missing; or otherwise either the decimal point or the e letter and the exponent (not both) can be missing.


2.54   .78   4.   4.1508E-3   0.81037e6   17228E5

Character Constants

Character constants are associated with the data type char. They consist of a single character enclosed by single quotes (apostrophes). The value of a character constant accords to the corresponding numeric value of the character in the machine's character set.

The escape character \ (backslash) can be used for specifying special characters. Table 2-1 contains a list of characters represented by escape sequences.

Table 2-1: Character Escape Sequences

Backspace BS \b
Horizontal Tabulator HT \t
Line Feed LF \n
Form Feed FF \f
Carriage Return CR \r
Escape Character \ \\
Apostrophe ' \'
Null Character NUL\0

Arbitrary bit patterns consisting of an escape symbol followed by up to three octal digits can be specified to represent the value of the desired character; the null character (NUL, \0) is a special case of this construction.

String Constants

String constants are associated with the data type string. They consist of a sequence of characters enclosed by double quotes (quotation marks). The Bartels User Language Compiler automatically appends a null character (NUL, \0) to the end of string constants; this convention is utilized by the Bartels User Language Interpreter to match the end of constant strings. Quotation marks included with a constant string must be preceded by the escape character (\); in addition the same escape character sequences as for character constants (see above) are permitted.


"IC1"   "4.8 kOhm"   "This is a string with Newline\n"

Constant Expressions

A constant expression is an expression, which is composed of constant values and operators. Constant expressions are evaluated at compile time already (CEE, Constant Expression Evaluation), i.e., they do not have to be calculated by the Interpreter at runtime. This means, that wherever constants are required, corresponding constant expressions can be used without disadvantages regarding to the program memory or runtime requirements.


int i=19-(010+0x10);                  CEE: int i=-5;
double d=-(4.7+2*16.3);               CEE: double d=-37.3;
string s="Part"+' '+"IC1";            CEE: string s="Part IC1";

2.2.4 Terminal Symbols

Reserved Words

Table 2-2 contains the list of Bartels User Language identifiers reserved for use as keywords. These identifiers can only be used in their predefined meaning.

Table 2-2: Reserved Words

#bnf #define #else #endif #if #ifdef #ifndef #include
#undef break case char continue default do double
else for forall if index int of return
static string struct switch typedef void where while


Table 2-3 lists the Bartels User Language operators. These operators activate special operations regarding to the current program context.

Table 2-3: Operators

! != % %= & && &= ( ) * *=
+ ++ += , - -- -= . / /= :
; < << <<= <= = == > >= >> >>=
? [ ] ^ ^= { | |= || } ~
Bartels :: Bartels AutoEngineer :: BAE Documentation :: User Language Programmer's Guide :: Language Description :: Lexical Conventions

Lexical Conventions
© 1985-2017 Oliver Bartels F+E • Updated: 05 December 2006, 16:54 [UTC]

© 1985-2017 Oliver Bartels F+E Bartels Homepage Contact and Corporate Info

Web Development by Baumeister Mediasoft Engineering

Konventionen - Deutsche Version Lexical Conventions - English Version