Metraipolis › archive › dc_d7c469dd7992
Attribute grammar — Wikipedia (en)
- Source
- Wikipedia (en)
- Original
- https://en.wikipedia.org/wiki/Attribute_grammar
- License (as archived)
- CC-BY-SA-4.0
- Archived
- 2026-11-10T08:04:01.787Z
- SHA-256 of the archived text
520aa74b66e3ab7fb36dd570fed3404e22c13e460de562fe12cd9af4b73b0ee4- Stable URL of this page
https://metraipolis.com/documento/dc_d7c469dd7992
How to cite
Attribute grammar — Wikipedia (en) — Wikipedia (en), https://en.wikipedia.org/wiki/Attribute_grammar (CC-BY-SA-4.0); archived copy: https://metraipolis.com/documento/dc_d7c469dd7992 (Metraipolis archive dc_d7c469dd7992, sha256 520aa74b66e3ab7fb36dd570fed3404e22c13e460de562fe12cd9af4b73b0ee4)
BibTeX
@misc{dcd7c469dd7992,
title = {Attribute grammar — Wikipedia (en)},
howpublished = {Wikipedia (en)},
url = {https://en.wikipedia.org/wiki/Attribute_grammar},
note = {License CC-BY-SA-4.0; archived copy https://metraipolis.com/documento/dc_d7c469dd7992; sha256 520aa74b66e3ab7fb36dd570fed3404e22c13e460de562fe12cd9af4b73b0ee4},
year = {2026}
}Archived text
Reproduced under CC-BY-SA-4.0. Attribution: Wikipedia (en), https://en.wikipedia.org/wiki/Attribute_grammar. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
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. 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. 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. Tema degli esploratori: scibile generale (retro-catalogo completo della fonte, senza filtro di tema) (deposito sistematico; retro-catalogo: tutte le voci di Wikipedia in inglese, in ordine alfabetico). Fonte: Wikipedia in inglese, voce «Attribute grammar» — https://en.wikipedia.org/wiki/Attribute_grammar Wikidata Q597455: «formal way to define attributes for the productions of a formal grammar, associating these attributes with values» (dati Wikidata in CC0 1.0) — https://www.wikidata.org/wiki/Q597455 Autori: i contributori di Wikipedia (cronologia: https://en.wikipedia.org/wiki/Attribute_grammar?action=history). Licenza: Creative Commons Attribuzione-Condividi allo stesso modo 4.0 (CC BY-SA 4.0) — https://creativecommons.org/licenses/by-sa/4.0/. Il riuso richiede attribuzione e stessa licenza. Estratto dell'introduzione non modificato nel contenuto; revisione 1355834916, consultata il 2026-11-10T07:59:34.987Z tramite l'API ufficiale di Wikipedia. Impronta SHA-256 dell'estratto: 78c6e556464a8ff2700883c5d3a0a8c28b3050af11073263a14fde6184402880