Skip to content

AttrRep Language ​

This page focuses on details about the AttrRep language used to specify the structure of a Notebook and representation of attributes.

AttrRep Introduction ​

The AttrRep language is used as part of the special AttrRep attribute and controls the Notebook structure. Each Notebook consists of chapters which contain the attributes. In addition, a chapter's attributes may be visually arranged in groups.

Structure ​

The following main concepts are available to define the Notebook structure:

  • Chapter: Chapters of a Notebook are shown as tabs on the right side.
  • Group: Groups visually arrange attributes together.
  • Attribute: Attributes are embedded in a chapter or group where they should be shown.

The Notebook is build based on using various commands in the sequence that they are used.

Record Type Attributes ​

The columns shown as part of a record type attribute are defined as part of the Notebook of the record class. Following adjustments can be done in the AttrRep of the record class:

  • Which attributes should be shown as columns through ATTR command.
  • In what sequence (left to right).
  • Relative width of the column through the width parameter.

The parameter width is specified for an ATTR command and should have a floating-point number, like ATTR "Value" width:1.0. It determines the column width of the attribute within a table. The column width is relatively calculated on the available space in the table. When extending and reducing the table, the column widths will be adapted accordingly. The width parameter should be provided for all contained attributes, as otherwise the width of all columns can be larger than the available space in the table.

It is still necessary to have the NOTEBOOK and exactly one CHAPTER ... commands before specifying the sequence of columns through ATTR.

Commands ​

The AttrRep language is based on LEO, using commands in a specific sequence to define the desired structure and design.

The basic syntax for a Notebook definition omitting many details:

leo-grammar
NOTEBOOK ChapterDefinition { ChapterDefinition } .

ChapterDefinition : CHAPTER strValue { GroupDefinition | AttributeDefinition } .

GroupDefinition : GROUP strValue { AttributeDefinition } ENDGROUP .

AttributeDefinition : ATTR strValue RepresentationConfiguration .
  • NOTEBOOK: Starts the definition of a notebook.
  • CHAPTER: Chapters can be started with this command.
  • GROUP and ENDGROUP: Encloses the attributes listed between GROUP and ENDGROUP in a group-box. Groups are optional.
  • ATTR: The attribute will be shown in the Notebook on this position. Some attribute types also allow different parameters to adapt the representation and interaction with the attribute.
  • AVAL: Retrieves the value of an attribute. This can be used to control some parts in a Notebook.
  • SET: Sets the value of a variable.

For a more comprehensive overview of the language's syntax see the grammar section and the individual command pages. For more information on how attributes can be represented check the corresponding section of the Notebook page.

A simple example for a Notebook with one chapter called "General" containing three attributes:

leo
NOTEBOOK

CHAPTER "General"
  ATTR "Name"
  ATTR "Position"
  ATTR "Size"

AttrRep Grammar ​

The language describing the notebook's structure is based on the following syntax (similar to EBNF):

  • Terminal symbols are written in code formatting.
  • Non-terminal symbols are written in cursive.
  • The end of a production rule is indicated by a semicolon ;
  • Alternatives / are / separated / by / a / slash.
  • [ Parts between square brackets ] are considered optional and can be used once (none or once).
  • { Parts between curly brackets } are considered optional and are repeatable (none or more).
  • ( Parts between round brackets ) denote groups.
  • (* Comments *) are in bold and between (* and *).
  • Three dots ... are used as placeholders to be replaced appropriate to the meaning (like number value ranges).
Non-terminalDefinition
NotebookNOTEBOOK [ with-relations / move-relations:intValue ] { NBElement / SetAccess / Language / ModelType / Mode} ;
NBElementChapter / Group / VSpace / Attribute / Set / AVal ;
ChapterCHAPTER ChapterName [ color:ColorSpec ] ;
GroupGROUP GroupName [ color:ColorSpec ] { Attribute } ENDGROUP ;
VSpaceVSPACE h:intValue ;
AttributeATTR AttrName [ color:ColorSpec ] [ lines:intValue ] [ dialog:Dialog ] [ ctrltype:ControlType ] [ checked-value: anyValue unchecked-value:anyValue ] [ push-button ] [ no-auto ] [ no-param ] [ write-protected ] [ hidden:boolValue ] [ enabled:boolValue ] [ mandatory:boolValue ] [ width:realValue ] ;
ColorSpecstrValue / intValue
(* See LEO Colors *)
FontFamilydecorative / modern / roman / script / swiss / system ;
Dialogtime / date / datetime / distribution / actor / subprocess / resource / color / transcond ;
ControlTypecheck / radio / dropdown ;
Alignmentl / c / r ;
SetSET VariableName:anyValue ;
AValAVAL { AValAssignment } ;
AValAssignment[ set-format:strValue ] [ set-sep:strValue ] [ as-original-type ] [ set-count-rows ] VariableName:AttrName ;
SetAccessSET_ACCESS usergroup:UserGroupSpec mode:AccessMode ;
UserGroupSpecUserGroupName / all ;
AccessModeblocked / protected / full ;
LanguageLANG ( LangName / all ) ;
ModelTypeMODELTYPE ( ModelTypeName / ModelTypeNameArray / all ) ;
ModeMODE ( ModeName / ModeNameArray / all ) ;
  • ChapterName, GroupName, AttrName, UserGroupName, LangName, ModelTypeName and ModeName should be a strValue.
  • VariableName should be a LowerCaseIdentifier.
  • ModelTypeNameArray and ModeNameArray should be an arrayValue containing strValue.