Command Language Reference

This document is a reference describing the basic structure and syntax of the Shape_edit Command Language (SCL) interface. The Command Language Specification describes the complete syntax and grammar of SCL. This is an informal reference describing the possible forms and types available in SCL.

Formatting

SCL is insensitive to line-feeds, spaces, or tabs (so-called white space). Comments can be included in .scl files by using the # character. The rest of an input line is ignored when the # character is encountered.

Keywords

Keywords are words that are used to structure commands in SCL or to provide symbols which have special meaning (such as quit or set). These words cannot be used for any other purpose. The Command Language Specification contains a list of all the SCL keywords.

Datatypes

Built-in Datatypes

There are five built-in datatypes in SCL.
Boolean
The keywords true and false are used for boolean values. 
Integer
Integer values are specified by a string of digits.
Real
Real numbers can be specified in a number of ways, for example:
        1.
        .1
        1.234
        1.e2
        .1e3
        .1e-4
        1.2e+6
String
A string value is specified by enclosing a string of characters with double quotes (""):
        "A string of characters"
Identifier
An identifier is a user-defined or system-defined name. Identifiers are strings of characters (no quotes) that must begin with a letter or an underscore (_), and may contain as many upper or lower case letters, digits, or underscores as desired:
        Origin
        _MyOrigin
        UnitCircle
        curve3
An identifier either refers to an object or an operation. Identifiers that refer to objects are also know as variables. Identifiers that refer to operations are also know as functions. A small number of predefined objects and a large number of predefined functions are provided by c_shape_edit (the system-defined identifiers). New user-defined names are created as a byproduct of the interactive modeling process.

Every object has a type which is either one of the built-in types (except the "identifier" type itself) or a system-defined type for geometric modeling. C_shape_edit defines a large set of these types. The Object Types section of the manaul describes them.

 Identifiers are treated in a case-insensitive manner (i.e.: Origin and origin are the same name). Note that this only applies to identifiers. Keywords are case-sensitive.

 

Array
An array is an ordered group of objects (built-in types, or other objects refered to by identifiers) of arbitrary size. The array can be homogeneouse or heterogeneous with respect to type.

Statements

The statement is the basic "command" in SCL. Statements are constructed from built-in types, keywords, and proper punctuation (syntax). Interacting with c_shape_edit involves entering valid statements for c_shape_edit to interpret. This section identifies various syntactic forms for valid SCL statements.

 Most statements in SCL are terminated with a semi-colon (;). The following types of statements will be described: expressions, compound statements, include statements, and SCL system statements.

Expressions

Expressions provide most of the different commands in SCL. An expression can be any of the following:
identifier
Built-in data type (integer, real, boolean, string)
identifier : expression
const identifier : expression
identifier( expression, expression, ... )
identifier()
expression + expression
expression - expression
expression * expression
expression / expression
( expression )
identifier[expression]
An expression followed by a semi-colon is a statement. Here are some examples of statements using expressions:
        origin;
        1.4;
        X : 2;
        Nums : array( X, 2, 3 );
        Nums[0];
        const Origin : pt( 0, 0 );
        Y : X * 3.14159;
        Z : 2 * (Y + X);

Compound Statements

Compound statements are used for grouping statements into a single statement. A valid compound statement is a group of statements (each terminated with a ;) enclosed in double angle brackets (<<...>>):
        <<
                statement;
                statement;
                ...
        >>
Note that no semi-colon is required after the closing brace.

Include Statements

include Filename;
Returns
<null> Reads in and executes the file contents.
Filename
<string> The name of the .scl file.
A valid include statement is of the form:
        include "filename.scl";
Include statements are for reading in entire .scl files to be interpreted.

SCL System Statements

There are two possible SCL system statements:
        set variable expression;
        unset variable;
SCL system statements are used to set system variables (see C_shape_edit User's Manual for specific variables).

 


C_Shape_Edit User's Manual Home Page 
Alpha_1 User's Manual.

Copyright © 1998, University of Utah
a1-web@gr.cs.utah.edu