CDL Syntax and Other Details

Get more details to help you code in CDL, such as details about elements, notation, separators, and terminology.

CDL Elements

Element Description
Comment

Include comments in your rule at your discretion to help explain the rule.

Comments aren't tokens so Oracle Configurator ignores them.

White space

White space includes spaces, line feeds, and carriage returns.

Use white space to improve your code's readability.

White space isn't a token so Configurator ignores it.

Case Sensitivity

These are case sensitive:

  • Values that identify objects in a model.
  • Parameters. Also, you can't enclose a parameter in quotes, such as (" ") or (' ').
  • Text literals.

These aren't case sensitive:

  • Keywords
  • Keyword operators
  • The constants E and PI and the scientific E
  • The keywords TRUE and FALSE
  • All keywords, constant literals, and so on
Quotation Mark

You must enclose these in single quotation marks (' '):

  • The name of a node that contains a white space. If the name doesn't have a white space, then you don't need to enclose it.
  • Text that Configurator might interpret as a keyword or operator.

Notation

Symbol Description
-- or // Use a double hyphen (--) or a double slash (//) to begin a single line comment that extends to the end of the line.
/* */

Use a slash asterisk (/*) to start a comment that spans more than one line of code.

Use an asterisk slash (*/) to end a comment that spans more than one line of code.

&lower case Use lower case text and prefix it with an ampersand to identify the name of a parameter or to identify the iterator for a local variable.
UPPER CASE Use upper case text for a keyword, for the name of a predefined variable, or for the name of a parameter.
Mixed Case Use mixed case for the name of node that you create or for the name of a rule that you create.
; Use a semicolon to indicate the end of one statement and the beginning of the next statement.

Separators

You use a separator to separate keywords and expressions from each other. They help you maintain each of your token’s structure.

Separator Description
( The open parenthesis indicates the beginning of a function argument or the beginning of an expression.
) The close parenthesis indicates the end of a function argument or the end of an expression.
, The comma separates arguments or elements.
; The semicolon separates statements.
. The dot separates identifiers.

Terminology

Term Description
Clause A segment of a statement rule that includes a keyword and an expression.
Collection A set of operands, inside a parentheses and separated by commas.
explicit statement Statement that creates a relationship between participants that you explicitly reference. You apply the rule to the participants and the model that contains those participants.
expression A subset of the statement that contains operators and operands.
formal identifier A variable that you define in the scope of an iterator statement to represent an iterating identifier.
iterator statement An iterator is a statement that works like a query to iterate, or repeat, over one or more relations or constraints.
nonterminal The kind of symbols that we use to present CDL that includes names.
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 can include more than one statement, and each statement can include clauses that contain expressions separated by semicolons.
terminal The kind of symbols that we use to present CDL that includes the names, characters, or literal strings of tokens.
Token The result of translating characters into a format that Configurator can use. All text except white space characters and comments are tokens.
unicode A 16 bit, character encoding that allows you use to characters from Western European, Eastern European, Cyrillic, Greek, Arabic, Hebrew, Chinese, Japanese, Korean, Thai, Urdu, Hindi and all other major languages, and encode them in a single character set.

Style That This Book Uses

Style Description
Italics

Italics text represents a variable.

This book doesn't use angle brackets (< >), square brackets ([ ]), or curly brackets ({ }) to indicate a variable. We use this style to avoid confusion. Code often uses these brackets as part of the syntax for other reasons.

[] A set of square brackets encloses an optional clause.
> Represents the Microsoft DOS command line prompt.
$ Represents the DIGITAL Command Language prompt in Windows and the Bourne shell prompt in Digital UNIX.
% The percent sign by itself represents the UNIX command line prompt.
name()

A set of parentheses at the end of text means the text contains the names of a method or a function. For example, the text Round(), means the Round function.

We don't use this style in the code itself or in code examples in this book. If you see a set of parentheses added at the end of text in code, then that means its part of the code.

.

.

.

A vertical ellipsis in code represents code that we have removed from the example because it isn't relevant to the topic.
... A horizontal ellipsis represents statements or commands that we have removed from the example because they aren't relevant to the topic.

For formatting and print purposes, the example CDL code in this book doesn't always have a carriage return. If it doesn't, assume the carriage return is implied. When you code your CDL, you must press the Enter key at the end of each line to insert a carriage return.