ALGOL-like Languages by Peter W. O’Hearn, Robert D. Tennent

By Peter W. O’Hearn, Robert D. Tennent

To build a compiler for a latest higher-level programming languagel one must constitution the interpretation to a machine-like intermediate language in a fashion that displays the semantics of the language. little is related approximately such struc­ turing in compiler texts which are meant to hide a large choice of software­ ming languages. extra is related within the Iiterature on semantics-directed compiler building [1] yet the following too the perspective is especially basic (though constrained to at least one languages with a finite variety of syntactic types). at the different handl there's a enormous physique of labor utilizing the continuation-passing transformation to constitution compilers for the categorical case of call-by-value languages similar to SCHEME and ML [21 3]. ln this paperl we'll describe a style of structuring the interpretation of ALGOL-like languages that's in keeping with the functor-category semantics devel­ oped by way of Reynolds [4] and Oles [51 6]. another procedure utilizing type thought to constitution compilers is the early paintings of F. L. Morris [7]1 which anticipates our remedy of boolean expressionsl yet doesn't care for approaches. 2 kinds and Syntax An ALGOL-like language is a typed lambda calculus with an strange repertoire of primitive forms. all through such a lot of this paper we suppose that the primi­ tive varieties are comm(and) int(eger)exp(ression) int(eger)acc(eptor) int(eger)var(iable) I and that the set eight of sorts is the least set containing those primitive kinds and closed below the binary operation -.

Show description

Read or Download ALGOL-like Languages PDF

Best programming: programming languages books

An Introduction to Object-Oriented Programming in C++: with Applications in Computer Graphics

An advent to Object-Oriented Programming in C++ with purposes in special effects introduces the reader to programming in C++ step-by-step from the easiest of C++ courses, via positive factors similar to periods and templates to namespaces. Emphasis is put on constructing an excellent programming strategy and demonstrating whilst and the way to take advantage of the extra complicated gains of C++ throughout the improvement of practical programming instruments and periods.

Foundations of 3D Graphics Programming: Using JOGL and Java3D

"A stable, concise special effects textbook masking 3D ideas, crucial basics idea, and easy-to-follow OpenGL sensible programming in Java. "Dr. Jack Bresenham, Retired IBM Senior Technical employees Member Increasingly within the geographical regions of technological know-how and undefined, special effects is a space of serious value and software.

Additional resources for ALGOL-like Languages

Sample text

I\x. · · · p (n- 1) x · · · in · · · , an nth-level evaluation of the parameter will invoke a chain of n subroutines. However, this inefficiency can be avoided if the programmer (or an optimizing compiler) eliminates the parameter by using a global identifier. In any event, although wehavenot pursued the matter, we expect that more traditional calling conventions should also be expressible within the functor-category framework. 1To correct an error in the previously published version of this paper, the author has changed the displacements in the definitions of f+ and s+ from 3 to 2.

CompiSI7 = i where i = [C]rr,commSI}Si. A less trivial example is the wblle command: wblle b do c def escape einletreck =if b then (c; k) eiseein k, where e and k are identifiers not occuring free in b or c. This definition leads to the translation [wblle b do C]rr,commSI}S' K = i, where i = [b]rr,boolexpS' ([rr]* (S ::s S')q)S' ([c]rr,commS' ([rr]* (S ::s; S')q)S'i, K). This is a correct translation, but i = [b]rr,boolexpSI}S' ([c]rr,commSI7S'i, K) gives a simpler translation with the same denotational behavior that sometimes pops the stack sooner.

For a control structure such as C1; C2, the meaning for any state-set is expressed as a function of the meanings oftheimmediate constituents C1 and C2 for the same state-set. This ensures that "intermediate" states between the executions of C1 and C2 will also belong tothat state-set, without requiring that these intermediate states be explicit in command meanings. A specification now becomes a predicate about state-sets as well as environments. In logic, this is known as "possible-world" semantics (Goldblatt, 1979); here, each set of allowed states is a possible world.

Download PDF sample

Rated 4.86 of 5 – based on 21 votes