Attribute Grammar Inversion and Source-to-source Translation by Daniel M. Yellin

By Daniel M. Yellin

With the proliferation of machine languages and dialects, you will need to create instruments to help within the development of source-to-source translators. by means of permitting clients to use software program (or facts) written for one more method, those instruments shape an enormous part within the quest for software program reusability. After discussing the theoretical and functional problems with characteristic grammar inversion, this publication demonstrates how the strategy can be utilized to construct source-to-source translators. this is often performed by way of first deciding upon a standard canonical shape during which to symbolize a number of the resource languages after which writing characteristic grammars from every one resource to the canonical shape. via immediately inverting those characteristic grammars one obtains translators from the canonical shape again to every resource language and by means of composing the fitting pairs of translators one obtains source-to-source translators. To turn out the feasibility of the inversion method of source-to-source translation, it's been used to generate translators among the programming languages Pascal and C.

Show description

Read or Download Attribute Grammar Inversion and Source-to-source Translation PDF

Similar compilers books

Verilog: Frequently Asked Questions: Language, Applications and Extensions

This ebook addresses "front finish" questions and matters encountered in utilizing the Verilog HDL, in the course of all of the levels of layout, Synthesis and Verification. the problems mentioned within the ebook tend to be encountered in either ASIC layout initiatives in addition to in delicate IP designs. those matters are addressed in an easy Q&A layout.

Programming Multi-Agent Systems: Third International Workshop, ProMAS 2005, Utrecht, The Netherlands, July 26, 2005, Revised and Invited Papers

The realm of self sufficient brokers and multi-agent platforms (MAS) has grown right into a promising know-how supplying good choices for the layout of disbursed, clever platforms. numerous efforts were made through researchers and practitioners, either in academia and undefined, and by way of a number of standardisation consortia which will supply new languages, instruments, equipment, and frameworks so one can identify the mandatory criteria for a large use of MAS expertise.

Compilers: Principles, techniques, and tools

Set of rules layout introduces algorithms by way of the real-world difficulties that encourage them. The ebook teaches scholars quite a number layout and research innovations for difficulties that come up in computing purposes. The textual content encourages an realizing of the set of rules layout strategy and an appreciation of the function of algorithms within the broader box of desktop technology.

Rule-Based Programming

Rule-Based Programming is a large presentation of the rule-based programming strategy with many instance courses displaying the strengths of the rule-based procedure. The rule-based procedure has been used greatly within the improvement of man-made intelligence structures, comparable to professional structures and computing device studying.

Additional resources for Attribute Grammar Inversion and Source-to-source Translation

Example text

Control-flow graphs have the advantage of being well known, but blindly relying on them is dangerous. In other words, control-flow graphs don’t allow us to build the exact execution set when the above assumption holds, E = {1257, 1367}. The Problem of Compile-Time Approximation Being able to precisely capture which traces are possible and which are not is extremely important in compilers. The previous section showed how some frameworks to express execution sets can have an edge on others. However, this information can seldom be perfectly precise.

For a given execution e ∈ E of the program, the set of instances of a given statement S is called the domain of S and is denoted with De (S). 3. For execution trace e = 012457, the domain of statement 2 is De (S) = {2}. The latter equation just captures that statement 2 is executed exactly once during execution e. On the other hand, during execution e = 013457, for example, statement 2 does not execute and its domain is empty. We can then define the set Ie of all instances spawned by all statements, for a given execution e: We gather all instances of all possible statements, as written formally below: Ie = De (S) S∈S Of course, the exact set of instances of a given statement S cannot always be known exactly at compile time.

It may then be enough to reason about the set of all possible effects of a statement or a statement instance for all possible executions, or a conservative approximation of this set. To this purpose, we introduce, for any statement S, the set write(S) of memory locations that statement may access. 4) e∈E which requires that write(S) include memory locations written during all possible executions. We readily have a similar approximation at the instance level. 6, we have write(6) ⊇ {a[42], a[43]}.

Download PDF sample

Rated 4.93 of 5 – based on 12 votes
Posted In CategoriesCompilers