Global Information Lookup Global Information

Attribute grammar information


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.

  1. ^ Knuth 1968, p. 134.
  2. ^ Knuth 1968, p. 132.

and 18 Related for: Attribute grammar information

Request time (Page generated in 0.8197 seconds.)

Attribute grammar

Last Update:

attribute grammar is a formal way to supplement a formal grammar with semantic information processing. Semantic information is stored in attributes associated...

Word Count : 1183

Grammatical modifier

Last Update:

may be used for certain function with different semantic features. The grammar of a language determines which morpho-syntactic forms are used for which...

Word Count : 1207

Attributed graph grammar

Last Update:

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...

Word Count : 136

Van Wijngaarden grammar

Last Update:

the hypergrammar is an attribute grammar, i.e. a set of context-free grammar rules in which the nonterminals may have attributes; and the metagrammar is...

Word Count : 2910

Definite clause grammar

Last Update:

such as Prolog. It is closely related to the concept of attribute grammars / affix grammars. DCGs are usually associated with Prolog, but similar languages...

Word Count : 1892

AG

Last Update:

German astronomical society Attogram, an SI derived unit of mass Attribute grammar, in formal language theory Inequality of arithmetic and geometric...

Word Count : 487

Structure editor

Last Update:

imperatively by actions (e.g., as in Gandalf), or declaratively by an attribute grammar (e.g., as in the Synthesizer Generator) or by unification in a many-sorted...

Word Count : 1190

Formal grammar

Last Update:

Affix grammars and attribute grammars allow rewrite rules to be augmented with semantic attributes and operations, useful both for increasing grammar expressiveness...

Word Count : 3431

Parsing

Last Update:

context-free grammars alone, for example type validity and proper declaration of identifiers. These rules can be formally expressed with attribute grammars. The...

Word Count : 4857

Substance theory

Last Update:

Substance theory, or substance–attribute theory, is an ontological theory positing that objects are constituted each by a substance and properties borne...

Word Count : 5456

List of formal language and literal string topics

Last Update:

grammar Chomsky hierarchy Concatenation Context-free grammar Context-sensitive grammar Context-sensitive language Decidable language ECLR-attributed grammar...

Word Count : 154

Affix grammar

Last Update:

e.g. a text editor. Koster, Cornelis HA. "Affix grammars for natural languages." Attribute Grammars, Applications and Systems. Springer, Berlin, Heidelberg...

Word Count : 673

Donald Knuth

Last Update:

no. 606), 1992. ix+109pp. ISBN 3-540-55611-7 Asymptotic notation Attribute grammar CC system Dancing Links Knuth -yllion Knuth–Bendix completion algorithm...

Word Count : 5733

The Art of Grammar

Last Update:

The Art of Grammar (Greek: Τέχνη Γραμματική - or romanized, Téchnē Grammatikḗ) is a treatise on Greek grammar, attributed to Dionysius Thrax, who wrote...

Word Count : 492

Feature structure

Last Update:

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...

Word Count : 299

Extended affix grammar

Last Update:

Affix grammar Corpus linguistics Affix grammars for natural languages, by C.H.A. Koster, in: Attribute Grammars, Applications and Systems, International...

Word Count : 331

Advanced Content

Last Update:

Content includes an XML element grammar based on HTML for content such as images, buttons, text, etc.; An XML attribute grammar based on CSS and XSL to describe...

Word Count : 1444

Traditional grammar

Last Update:

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...

Word Count : 2985

PDF Search Engine © AllGlobal.net