Implementing a smalltalk to Java translator

Show simple item record

dc.contributor.advisor Kourie, Derrick G. en
dc.contributor.postgraduate Engelbrecht, Roelof Lourens en
dc.date.accessioned 2013-09-07T13:29:24Z
dc.date.available 2005-10-07 en
dc.date.available 2013-09-07T13:29:24Z
dc.date.created 2002-09-05 en
dc.date.issued 2006-10-07 en
dc.date.submitted 2005-10-05 en
dc.description Dissertation (MSc (Computer Science))--University of Pretoria, 2006. en
dc.description.abstract 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. en
dc.description.availability unrestricted en
dc.description.department Computer Science en
dc.identifier.citation Engelbrecht, RL 2002 Implementing a smalltalk to Java translator, MSc dissertation, University of Pretoria, Pretoria, viewed yymmdd < http://hdl.handle.net/2263/28433 > en
dc.identifier.other H209/ag en
dc.identifier.upetdurl http://upetd.up.ac.za/thesis/available/etd-10052005-141150/ en
dc.identifier.uri http://hdl.handle.net/2263/28433
dc.language.iso en
dc.publisher University of Pretoria en_ZA
dc.rights © 2002, University of Pretoria. All rights reserved. The copyright in this work vests in the University of Pretoria. No part of this work may be reproduced or transmitted in any form or by any means, without the prior written permission of the University of Pretoria. en
dc.subject Smalltalk 80 computer program language en
dc.subject Translators computer program en
dc.subject Java computer program language en
dc.subject UCTD en_US
dc.title Implementing a smalltalk to Java translator en
dc.type Dissertation en


Files in this item

This item appears in the following Collection(s)

Show simple item record