• Refine Query
  • Source
  • Publication year
  • to
  • Language
  • No language data
  • Tagged with
  • 1
  • 1
  • 1
  • 1
  • 1
  • 1
  • 1
  • 1
  • About
  • The Global ETD Search service is a free service for researchers to find electronic theses and dissertations. This service is provided by the Networked Digital Library of Theses and Dissertations.
    Our metadata is collected from universities around the world. If you manage a university/consortium/country archive and want to be added, details can be found on the NDLTD website.
1

Implementing a smalltalk to Java translator

Engelbrecht, Roelof Lourens 05 October 2005 (has links)
A number of essential issues in translating Smalltalk to Java are addressed. The fIrst chapter gives a brief overview of Smalltalk and Java with respect to the relevant language features that will be translated. In the next section a convention is proposed for mapping Smalltalk method selectors to Java method names. The dynamic nature of Smalltalk instance methods is compared with Java's static type model as well as a solution to simulate the dynamic nature of Smalltalk in Java. A Java class hierarchy that parallels the Smalltalk class hierarchy (including the metaclass objects) is suggested. A further proposal is given for translating the dynamic attributes of Smalltalk class methods to the same behaviour to Java. These proposals are used to support ways of mapping both Smalltalk instance methods, as well as Smalltalk class methods to their Java counterparts. Ways of translating Smalltalk class variables, Smalltalk class instance variables and Smalltalk global variables are illustrated. A method for translating Smalltalk blocks to Java inner classes is implemented using Java exceptions to unwind the call stack. Various types of Small talk blocks are translated with increasing complexity. The various types of blocks translated are simple blocks; blocks with references to variables in the enclosing context; blocks with block arguments; blocks that need to refer to their own context executed from other contexts; blocks with multiple exit points as well as nested blocks. Some performance tests to illustrate the impact of using exceptions in Java are also reported. The next section introduces the Small talk grammar with the necessary productions used to implement a parser. Lexical and syntax analysis are explained. A brief overview of a recursive descent parser is given where an example of Smalltalk source code is parsed and all the relevant parse nodes illustrated. The encoding in each parse node to Java source is shown. The last section focuses on similar initiatives being pursued and compares the solutions in the dissertation against them. This dissertation focuses on key areas of the Smalltalk to Java translation process, but a few peculiar and unique Smalltalk features are not addressed. These are discussed in the last section and some suggestions are made on how the translations can be achieved. / Dissertation (MSc (Computer Science))--University of Pretoria, 2006. / Computer Science / unrestricted

Page generated in 0.075 seconds