|
|
|
General Information
Tutorials
Reference Manuals
Libraries
Translation Tasks
Tools
Administration
|
|
LIDO - Reference ManualAttributesAttributes are associated with symbols and with rules. They are defined and used in rule computations and in symbol computations.
Each symbol has two disjoint sets of attributes:
synthesized ( Attributes are introduced by their occurrence in computations. They are not explicitly declared. How types and classes of attributes are determined is described in Types and Classes of Attributes.
Syntax
Attribute ::= SymbolRef '.' AttrName
| RuleAttr
RuleAttr ::= '.' AttrName
SymbolRef ::= SymbName
| SymbName '[' Number ']'
RhsAttrs ::= 'RHS' '.' AttrName
Examples
RULE: Stmt ::= 'while' Expr 'do' Stmt COMPUTE ...
... Expr.postType ...
... Stmt[1].code ...
... .label ...
... RuleFct ("PTG", RHS.Ptg) ...
END;
SYMBOL Expr COMPUTE
... SYNT.preType ...
... INH.postType ...
... THIS.preType ...
... RuleFct ("PTG", RHS.Ptg) ...
END;
Attributes in rule computations have the form
Rule attributes of the form
In symbol computations attributes of the considered symbol are denoted using
A
Restrictions
The
The
The index of a
Rule attributes may not be used in symbol computations.
Types and Classes of Attributes
Each attribute has a certain type characterizing the values propagated by
the attribute.
Attributes that describe only postconditions of computations
without propagating a value have the predefined type
Each attribute has either the class synthesized (
Syntax
AttrSpec ::= 'ATTR' AttrNames ':' TypeName [ AttrClass ]
SymSpec ::= SymbKind SymbNames ':' [ AttrSpecs ]
AttrSpecs ::= AttrSpecs ',' AttrSpecs
| AttrNames ':' TypeName [ AttrClass ]
AttrClass ::= 'SYNT' | 'INH'
Examples
ATTR code: PTGNode SYNT;
SYMBOL Expr, UseIdent: preType, postType: DefTableKey;
An attribute name specification (
An
If the type of an attribute is left unspecified it is assumed to be
Note: Misspelling of an attribute name in a computation
leads to introduction of a
Note: The type of a non-
Restrictions
There may be several A specified attribute class must be consistent with all computations of that attribute.
The type specified for an attribute must denote an assignable C type that is
available in the generated evaluator.
LIGA does not check whether non-
|