Prev Next

Syntax Grammar

A section of a Shape Script can be quite complex, containing a number of commands and parameters. This table provides a breakdown of the Shape Script structure, illustrating how commands and parameters are constructed. The first entry is the top-level declaration, and subsequent entries show the composition of successively more detailed components.

Grammar Symbols

  • *  =  zero or more
  • +  =  one or more
  • |  =  or

;  =  terminator

Symbol

Description

See also

ShapeScript ::=

<Shape>*;

Shape ::=

<ShapeDeclaration> <ShapeBody>;

ShapeDeclaration ::=

<ShapeType> <ShapeName>;

ShapeType ::=

"shape" | "decoration" | "label";

ShapeName ::=

<ReservedShapeName> | <stringliteral>;

ReservedShapeName ::=

See Reserved Names for full reserved shape listing.

Reserved Names

ShapeBody ::=

"{" <InitialisationAttributeAssignment>* <DrawingStatement>* <SubShape>* "}";

InitialisationAttributeAssignment ::=

<Attribute> "=" <Value> ";";

Attribute ::=

See Shape Attributes for full listing of attribute names.

Shape Attributes

DrawingStatement ::=

<IfElseSection> | <Method>;

IfElseSection ::=

"if" "("<QueryExpression>")" <TrueSection> (<ElseSection>);

QueryExpression ::=

<QueryName> "(" <ParameterList> ")";

See Query Methods for descriptions of the queries and their parameters.

Query Methods

QueryName ::=

See Query Methods for the possible Query names.

Query Methods

TrueSection ::=

"{" <DrawingStatement>* "}"

ElseSection ::=

"else" "{" <DrawingStatement>* "}"

Method ::=

<MethodName> "(" <ParameterList> ")" ";";

MethodName ::=

See Drawing Methods for a full listing of method names.

Drawing Methods