
The problem of the semantic definition of a programming language has been approached by Knuth by means of 'attribute grammar'.' They consist of a syntactic part, which is typically a context-free grammar, and of a semantic part, made up of a set of attributes associated to each symbol and of a set of semantic functions used to evaluate the attributes' values while constructing the syntactic tree. Attribute grammars have been widely investigated,~ and rules have been given to evaluate attributes from left to right and to build compilers which use semantic knowledge to overcome syntactic ambiguities.'' A related concept is that of 'affix grammar', for which parsing methods have been defined." The main problem while parsing a sentence by means of an attribute grammar is to perform a suitable error detection and recovery. In Ref. l l a parsing algorithm is presented, which allows the detection of a semantic error as soon as it is required to guarantee that the previously parsed substring of input symbols is a viable prefix. A recovery procedure based on this method can operate only on the new input symbols, exactly as it happens with all the classical syntactic recovery procedures defined for LL(fc) or LR(fc) grammars. Such a recovery algorithm is presented in the third section of this paper, after a short discussion of the theoretical preliminaries, which is included here in order to make the paper self-contained. The last section is devoted to the detailed analysis of two examples of recovery from syntactic and semantic error.
Theory of compilers and interpreters, synthesized attributes, parsing algorithm for attribute grammars, syntactic and semantic errors
Theory of compilers and interpreters, synthesized attributes, parsing algorithm for attribute grammars, syntactic and semantic errors
| selected citations These citations are derived from selected sources. This is an alternative to the "Influence" indicator, which also reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically). | 4 | |
| popularity This indicator reflects the "current" impact/attention (the "hype") of an article in the research community at large, based on the underlying citation network. | Average | |
| influence This indicator reflects the overall/total impact of an article in the research community at large, based on the underlying citation network (diachronically). | Average | |
| impulse This indicator reflects the initial momentum of an article directly after its publication, based on the underlying citation network. | Average |
