CDL Syntax Details

Miscellaneous syntactical elements of CDL are described here.

CDL Syntactical Elements

The following table lists miscellaneous syntactical elements of CDL.

Element

Description

Comments

Comments are included in rule definitions at your discretion to explain the rule.

Comments aren't tokens and therefore ignored by the Configurator parser.

White space

White space, which includes spaces, line feeds, and carriage returns, format the input for better readability.

The white space category of elements aren't tokens and therefore ignored by the Configurator parser.

Case Sensitivity

Keywords aren't case sensitive. Keyword operators aren't case sensitive. Model object identifiers are case sensitive. Formal parameters are case sensitive and can't be in quotes. The constants E and PI as well as the scientific E aren't case sensitive. The keywords TRUE and FALSE aren't case sensitive. Text literals are case sensitive. All keywords, constant literals, and so on aren't case sensitive.

Quotation Marks

Model structure node names that contain white space, or text that would be interpreted by the parser as keywords or operators, must be enclosed in single quotation marks.

Syntax Notation

The following table describes the valid statement syntax notation for CDL. The table lists the available symbols and provides a description of each. This notation is used for CDL examples and in the syntax reference.

Symbol

Description

-- or //

A double hyphen or double slash begins a single line comment that extends to the end of the line.

/* */

A slash asterisk and an asterisk slash delimits a comment that spans multiple lines.

&lower case

Lower case prefixed by the ampersand sign is used for names of formal parameters and iterator local variables.

UPPER CASE

Upper case is used for keywords and names of predefined variables or formal parameters.

Mixed Case

Mixed case is used for names of user-defined Model nodes, names of user-defined rules.

;

A semi-colon indicates the end of one statement and the beginning of the next.

In the examples for CDL, an implied carriage return happens at the end of each line, unless otherwise noted. You must press the Enter key at the end of a line of input. The following table lists the typographic and symbol conventions used in this book, such as ellipses, bold face, italics.

Convention

Meaning

.
.
.

Vertical ellipsis points in an example mean that information not directly related to the example has been omitted.

...

Horizontal ellipsis points in statements or commands mean that parts of the statement or command not directly related to the example or relevant to the discussion have been omitted.

boldface text

Boldface type in text indicates a new term, a term defined in the glossary, specific keys, and labels of user interface objects. Boldface type also indicates a menu, command, or option, especially within procedures

[]

Brackets enclose optional clauses from which you can select one or none.

>

The left bracket alone represents the MS DOS prompt.

$

The dollar sign represents the DIGITAL Command Language prompt in Windows and the Bourne shell prompt in Digital UNIX.

%

The per cent sign alone represents the UNIX prompt.

name()

In text other than code examples, the names of programming language methods and functions are shown with trailing parentheses. The parentheses are always shown as empty. For the actual argument or parameter list, see the reference documentation. This convention isn't used in code examples.

Terminology

The following table defines the terms used here.

Term

Description

Cartesian product

A set of tuples that's constructed from two or more given sets and comprises all permutations of single elements from each set such that the first element of the tuple is from the first set and the second is from the second set, and so on.

clause

A segment of a rule statement consisting of a keyword and expression.

collection

A set of multiple operands within parentheses and separated by commas.

compiler

The part of Configurator that first parses rule definitions and then generates code that's executable at run time.

explicit statement

Explicit statements express relations among explicitly identified participants and restrict execution of the rule to those participants and the Model containing those participants.

expression

A subset of the statement that contains operators and operands

formal identifier

A variable that's defined in the scope of an iterator statement to represent an iterating identifier.

iterator statement

Iterators are query-like statements that iterate, or repeat, over one or multiple relations or constraints.

non-terminal

The kind of symbols used in the notation for presenting CDL grammar that represent the names of grammar rules.

parser

A component of the Configurator compiler that analyzes the syntactic and semantic correctness of statements used in rule definitions.

relationship

A type of constraint expressed in a single statement or clause. A relationship can be equivalent to a simple rule. A Statement Rule expresses one or more relationship types but isn't itself a type of relationship.

signature

The distinct combination of a function's attributes, such as name, number of parameters, type of parameters, return type, mutability, and so on.

singleton

A single operand that isn't within a collection.

statement

The entire sentence that expresses the rule's intent. A CDL rule definition can consist of multiple statements, each consisting of clauses containing expressions, and separated by semi-colons.

terminal

The kind of symbols used in the notation for presenting CDL grammar that represent the names, characters, or literal strings of tokens.

token

The result of translating characters into recognizable lexical meaning. All text strings in the input stream to the parser, except white space characters and comments, are tokens.

unicode

A 16-bit character encoding scheme allowing characters from Western European, Eastern European, Cyrillic, Greek, Arabic, Hebrew, Chinese, Japanese, Korean, Thai, Urdu, Hindi and all other major world languages, to be encoded in a single character set.

Separators

Separators are characters that serve as syntactic filling between the keywords and the expressions. Their goal is to maintain the structure of the token stream by introducing boundaries between the tokens and by grouping the tokens through some syntactic criteria.

The following table lists the separators that are valid in CDL.

Separator

Description

(

The open parenthesis indicates the beginning of function arguments or the beginning of an expression.

)

The close parenthesis indicates the end of function arguments or the end of an expression.

,

The comma separates arguments or collection elements.

;

The semi-colon separates statements.

.

The dot character separates identifiers in compound references.