This document introduces a new language for describing the static semantics of programming languages. The language, Attribute Grammar Description Language (AGDL) is based on attribute grammars. Attribute grammars are a technique for formally specifying pro
AGDLAn Attribute Grammar Description Language
Karen Wyrwas, Alan Dearle, Michael Oudshoorn
5, April 1995
1Introduction
This document introduces a new language for describing the static semantics of programminglanguages. The language, Attribute Grammar Description Language (AGDL) is based on attributegrammars. Attribute grammars are a technique for formally specifying programming languages[1]. An attribute grammar is a context-free grammar augmented with semantic information in theform of attributes. Each symbol of the context-free grammar has a set of associated attributes.Attribute values are defined by attribute evaluation rules associated with the productions of thecontext-free grammar. These rules typically specify the value of a particular attribute as a functionof other attribute values within the production. There is also a set of attribute assertions orpredicates associated with a production which restrict the range of valid attribute values at theproduction. These assertions must all hold true for a program in the specified language to besemantically correct.
The remainder of this document describes AGDL and gives two examples of its use. The first ofthese describes a simple expression language intended to illustrate the use of attribute grammars.The second is a description of the persistent language Napier88 [2].
2AGDL
1.Type definitionsThe format of an Attribute Grammar Description is as follows:
2.Constant and attribute declarations
3.Auxiliary function definitions
4.Predicate function definitions
5.Attributed productions
The names and types of all attributes used in the specification must be declared at the start of thespecification. For example the description of the simple attribute grammar starts with the lines,E, E1, E2, E3 : envir
which specifies that the types envir, TYPE and string may be used in the specification and that theattributes E, E1, E2 and E3 are of type envir. No interpretation is placed upon any these namesother than that specified by the auxiliary functions and predicates.
The auxiliary function definitions define the signatures of auxiliary functions used in thespecification. They are function definitions drawn from the calculus of pure functions (λ calculus).Similarly the predicate function definitions contain the signatures of predicates that may be used inthe specification.
Abstract Interpretation of Functional Programs using an Attribute Grammar ...an intermediate language in a Haskell compiler, itself also written in ...
ABSTRACT An Attribute-Grammar Implementation of ...The paper focuses on the description of the ...generation of the language described by the theory...
An AG-based compiler-compiler takes an attribute grammar description of a programming language and generates an e?cient compiler for it. Attribute grammar ...
Parallel Attribute Gramm... 暂无评价 8页 免费 An Attribute Grammar Des... 暂无评价 32页 免费 《Unit 2 Grammar The Pas... 26页 2财富值 grammar(...
?the rules of grammar found mainly in written language. ?an objective description of structures of language, with no comment concerning correct versus ...
An attribute grammar modeling for generating CCLP languages Abstract. The paper presents how we can model Concurrent Constraint Logic Programming (CCLP) ...
grammar found mainly in written language, but not spoken language An objective description of the structures of language, with no comment concerning correct ...
Unit 4 Body Language Grammar V-ing form as Attribute and Adverbial 现在分词做定语和状语 现在分词( Present Participle ,又称 ing 形式、现在进行式 ) ,由...
Past Participle as an attribute the predicative 6...announced 9.attended Learning about language P 4 ...make a noise 9.make a description 3. In ...
Unit 1 Grammar the past__ participle as the attribute and predicative_英语_高中教育_教育专区。 Grammar the The past participle as attribute and ...
热门文档