9. Shape Script Syntax
This is the EBNF for Enterprise Architect’s Shape Script language. The start symbol is ShapeScript. Any spaces and tabs between non-terminals are ignored.
ShapeScript = { Shape | Decoration };
Shape = “shape”15 ShapeName ShapeBody;
ShapeName = /* any reserved or non-reserved string literal depending on the context */;
Decoration = “decoration” Name ShapeBody;
Name = /* an arbitrary string that should describe the form of the decoration */;
ShapeBody = “{“ {InitializationAttributeAssignment} {DrawingStatement} {SubShape} “}”
SubShape = Shape /* with a non-reserved name */;
InitializationAttributeAssignment = Attribute “=” Value “;”;
Attribute = /* see chapter Shape Attributes for a list of values /*;
Value = StringLiteral | Integer | Tuple;
StringLiteral = Quote { Character } Quote;
Quote = /* the double quote “ or a single quote ‘ */;
Character = /* any printable character except the used Quote */;
Integer = [”-“] {“0” .. “9”};
Tuple = “(“ Integer “,” Integer “)”;
Block = “{“ {DrawingStatement} “}” | DrawingStatement;
DrawingStatement = IfElseSection | Method;
IfElseSection = “if” “(“ QueryExpression “)” Block [“else” Block];
QueryExpression = /* see chapter Query Methods for the 2 methods and their parameters */;
Method = /* see chapter Shaping Elements for possible methods and their parameters */;