Full Text Available

Note: Clicking the button above will open the full text document at the original institutional repository in a new window.

Implementing a smalltalk to Java translator

Dissertation (MSc (Computer Science))--University of Pretoria, 2006.

Saved in:
Bibliographic Details
Other Authors: Kourie, Derrick G.
Format: Thesis
Published: University of Pretoria 2013
Subjects:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1867613654191439872
access_status_str Open Access
author2 Kourie, Derrick G.
author_browse Kourie, Derrick G.
author_facet Kourie, Derrick G.
collection Thesis
dc_rights_str_mv © 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.
description Dissertation (MSc (Computer Science))--University of Pretoria, 2006.
format Thesis
id oai:repository.up.ac.za:2263/28433
institution University of Pretoria (South Africa)
last_indexed 2026-06-10T12:39:34.803Z
license_str Other — see source repository
provenance_str_mv Harvested via OAI-PMH from UPSpace — University of Pretoria Institutional Repository
publishDate 2013
publishDateRange 2013
publishDateSort 2013
publisher University of Pretoria
publisherStr University of Pretoria
record_format dspace
source_str UPSpace — University of Pretoria Institutional Repository
spelling oai:repository.up.ac.za:2263/28433 Implementing a smalltalk to Java translator Kourie, Derrick G. upetd@up.ac.za Engelbrecht, Roelof Lourens Smalltalk 80 computer program language Translators computer program Java computer program language UCTD Dissertation (MSc (Computer Science))--University of Pretoria, 2006. 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. Computer Science unrestricted 2013-09-07T13:29:24Z 2005-10-07 2013-09-07T13:29:24Z 2002-09-05 2006-10-07 2005-10-05 Dissertation Engelbrecht, RL 2002 Implementing a smalltalk to Java translator, MSc dissertation, University of Pretoria, Pretoria, viewed yymmdd < http://hdl.handle.net/2263/28433 > H209/ag http://hdl.handle.net/2263/28433 http://upetd.up.ac.za/thesis/available/etd-10052005-141150/ © 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. application/pdf University of Pretoria
spellingShingle Smalltalk 80 computer program language
Translators computer program
Java computer program language
UCTD
Implementing a smalltalk to Java translator
title Implementing a smalltalk to Java translator
title_full Implementing a smalltalk to Java translator
title_fullStr Implementing a smalltalk to Java translator
title_full_unstemmed Implementing a smalltalk to Java translator
title_short Implementing a smalltalk to Java translator
title_sort implementing a smalltalk to java translator
topic Smalltalk 80 computer program language
Translators computer program
Java computer program language
UCTD
url http://hdl.handle.net/2263/28433
http://upetd.up.ac.za/thesis/available/etd-10052005-141150/