Interpreters From Functions and Grammars

نویسنده

  • Greg J. Michaelson
چکیده

-The addition of context free grammar rules to a functional language simplifies the construction of interpreters from denotationaI semantic language definitions. Functional abstraction over grammar rules enables the specification and processing of context sensitive language syntax aspects in a functional style. DenotatLonaI semantics Language design Language implementation Functional language Grammar rules Interpreters Context sensitive processing 1. I N T R O D U C T I O N 1.1 Denotational semantics Denotational semantics [1] is a formalism for defining programming languages. A denotational semantic definition consists of semantic domains, abstract syntax and semantic functions. The semantic domains define the universe of objects in which the language is given meaning, the abstract syntax defines meaningful syntactic constructs and the meaning of each abstract syntax construct is defined by a semantic function over the serriantic domains. Abstract syntax is distinguished from concrete syntax which describes the physical representation of programs and contains details which are not significant from a semantic point of view [2]. Approaches based on denotational semantics are used to provide succinct and theoretically rigorous programming language standards. These then inform language implementations and program manipulation. Such approaches are also used for programming language design [3] but there are few software tools which are appropriate for experimenting with denotational semantic based designs. 1.2 Compiler generators Compiler generators [4], which are used to automate the construction of production compilers, are based on very different methodologies to denotational semantics and place a far greater emphasis on concrete syntax. A typical compiler generator, like YACC [5], inputs a formalised definition of the context free [6] concrete syntax of a language along with semantic actions written in an imperative language. These implement context sensitive concrete syntax checking and the generation of the target language. When compiler generators are used with denotational semantic designs a basic problem is the lack of correspondence between the functional meta-language used to define semantic equations and the imperative semantic action language. Translating semantic equations into semantic actions loses clarity and is a potential source of errors. When the design changes so must the translation for the compiler generator. One alternative is to use an existing compiler generator with a new semantic action language which has a well defined correspondence with the functional meta-language [7]. Another is to develop a system which is oriented specifically for use with denotational semantics. 1.3 SIS SIS [8] is a language implementation system which enables direct experimentation with denotational semantic language designs. It takes in a full denotational semantic definition and uses it to generate what is in effect the code for an abstract machine. The code is then interpreted. The strict adherence to denotational semantics, however, with the formal separation of concrete syntax, abstract syntax and semantics, appears to restrict the ease with which SIS may be used.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Provable Correctness of Prototype Interpreters in LDL

LDL is a system supporting the design of procedural programming languages and generating prototype interpreters directly from the language definition. A language definition is based on GSFs a kind of attribute grammars and the denotational semantics approach. It is shown how denotational semantics can be transformed into Prolog. It is also shown how the correctness of the prototype interpreters...

متن کامل

A Paradigm for Interpreting Tractable Shape Grammars

Shape grammars are, in general, intractable. Even amongst tractable shape grammars, their characteristics vary significantly. This paper describes a paradigm for practical general shape grammar interpreters, which aim to address computational difficulties posed by parameterization. The paradigm is expressed in terms of frameworks each comprising an underlying data structure, manipulation algori...

متن کامل

Constructing Programs as Executable Attribute Grammars

Attribute grammars provide a formal yet intuitive notation for specifying the static semantics of programming languages and consequently have been used in various compiler generation systems. Their use, however, need not be limited to this. With a little change in perspective, many programs may be regarded as interpreters and constructed as executable attribute grammars. The major advantage is ...

متن کامل

PGF: A Portable Run-time Format for Type-theoretical Grammars

PGF (Portable Grammar Format) is a low-level language used as a target of compiling grammars written in GF (Grammatical Framework). Low-level and simple, PGF is easy to reason about, so that its language-theoretic properties can be established. It is also easy to write interpreters that perform parsing and generation with PGF grammars, and compilers converting PGF to other format. This paper gi...

متن کامل

Sprachen, Grammatiken und Transformationen 33 Evolution of Language Interpreters

Language-based tools involve some (ad-hoc) elements of a language's intended (say, formal) semantics. These elements relate to the specific service provided by a tool. For instance, a program analyser might implement a so-called abstract interpretation; a transformation tool might employ algebraic laws as well as typing and scoping rules; a translator implements the syntax-to-syntax edge in the...

متن کامل

Hemispheric Asymmetry for Language Processing and Lateral Preference in Simultaneous Interpreters

Neuroimaging studies showed that linguistic functions are less lateralized in polyglots than in monolinguals. However, there is not much agreement about the role of the two hemispheres in semantic and syntactic processing in bilinguals. In this study, 35 right-handed Italian speakers were shown 520 words and pseudo-words. The task consisted in detecting a given target letter by pressing a butto...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Comput. Lang.

دوره 11  شماره 

صفحات  -

تاریخ انتشار 1986