An attribute grammar is a formal way to supplement a formal grammar with semantic information processing. Semantic information is stored in attributes associated with terminal and nonterminal symbols of the grammar. The values of attributes are the result of attribute evaluation rules associated with productions of the grammar. Attributes allow the transfer of information from anywhere in the abstract syntax tree to anywhere else, in a controlled and formal way.[1]
Each semantic function deals with attributes of symbols occurring only in one production rule: both semantic function parameters and its result are attributes of symbols from one particular rule. When a semantic function defines the value of an attribute of the symbol on the left hand side of the rule, the attribute is called synthesized; otherwise it is called inherited.[2] Thus, synthesized attributes serve to pass semantic information up the parse tree, while inherited attributes allow values to be passed from the parent nodes down and across the syntax tree.
In simple applications, such as evaluation of arithmetic expressions, attribute grammar may be used to describe the entire task to be performed besides parsing in straightforward way; in complicated systems, for instance, when constructing a language translation tool, such as a compiler, it may be used to validate semantic checks associated with a grammar, representing the rules of a language not explicitly imparted by the syntax definition. It may be also used by parsers or compilers to translate the syntax tree directly into code for some specific machine, or into some intermediate language.
attributegrammar is a formal way to supplement a formal grammar with semantic information processing. Semantic information is stored in attributes associated...
may be used for certain function with different semantic features. The grammar of a language determines which morpho-syntactic forms are used for which...
an attributed graph grammar is a class of graph grammar that associates vertices with a set of attributes and rewrites with functions on attributes. In...
the hypergrammar is an attributegrammar, i.e. a set of context-free grammar rules in which the nonterminals may have attributes; and the metagrammar is...
such as Prolog. It is closely related to the concept of attributegrammars / affix grammars. DCGs are usually associated with Prolog, but similar languages...
imperatively by actions (e.g., as in Gandalf), or declaratively by an attributegrammar (e.g., as in the Synthesizer Generator) or by unification in a many-sorted...
Affix grammars and attributegrammars allow rewrite rules to be augmented with semantic attributes and operations, useful both for increasing grammar expressiveness...
context-free grammars alone, for example type validity and proper declaration of identifiers. These rules can be formally expressed with attributegrammars. The...
Substance theory, or substance–attribute theory, is an ontological theory positing that objects are constituted each by a substance and properties borne...
e.g. a text editor. Koster, Cornelis HA. "Affix grammars for natural languages." AttributeGrammars, Applications and Systems. Springer, Berlin, Heidelberg...
The Art of Grammar (Greek: Τέχνη Γραμματική - or romanized, Téchnē Grammatikḗ) is a treatise on Greek grammar, attributed to Dionysius Thrax, who wrote...
essentially a set of attribute–value pairs. For example, the attribute named number might have the value singular. The value of an attribute may be either atomic...
Affix grammar Corpus linguistics Affix grammars for natural languages, by C.H.A. Koster, in: AttributeGrammars, Applications and Systems, International...
Content includes an XML element grammar based on HTML for content such as images, buttons, text, etc.; An XML attributegrammar based on CSS and XSL to describe...
Traditional grammar (also known as classical grammar) is a framework for the description of the structure of a language. The roots of traditional grammar are...