文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > An Attribute Grammar Description Language
侵权投诉

An Attribute Grammar Description Language

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.

第1页

你可能喜欢

热门文档

相关文档

  • ...Programs using an Attribute Grammar Syst_免费下...

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

    ABSTRACT An Attribute-Grammar Implementation of ...The paper focuses on the description of the ...generation of the language described by the theory...

  • Systematic Debugging of Attribute Grammars

    An AG-based compiler-compiler takes an attribute grammar description of a programming language and generates an e?cient compiler for it. Attribute grammar ...

  • Grammar Attribute

    Parallel Attribute Gramm... 暂无评价 8页 免费 An Attribute Grammar Des... 暂无评价 32页 免费 《Unit 2 Grammar The Pas... 26页 2财富值 grammar(...

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

    An attribute grammar modeling for generating CCLP languages Abstract. The paper presents how we can model Concurrent Constraint Logic Programming (CCLP) ...

  • Grammar

    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

    Unit 4 Body Language Grammar V-ing form as Attribute and Adverbial 现在分词做定语和状语 现在分词( Present Participle ,又称 ing 形式、现在进行式 ) ,由...

  • ...Period4 Grammar past participle as attribute and...

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

  • ...the past__ participle as the attribute and predi...

    Unit 1 Grammar the past__ participle as the attribute and predicative_英语_高中教育_教育专区。 Grammar the The past participle as attribute and ...

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email