Created
January 20, 2013 21:38
-
-
Save tangentstorm/4581941 to your computer and use it in GitHub Desktop.
Oberon07->Haxe!!!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
## noct : the nickelsworth oberon07 compiler/transpiler | |
## | |
## Work in progress from https://github.com/nickelsworth/noct | |
## | |
## This is the first Oberon07 program to be sucessfully | |
## translated to haxe and executed on haxe's neko vm. | |
## [0120.2013 03:36PM] | |
## | |
## source: T00Output.mod ###################################### | |
MODULE T00Output; | |
IMPORT Out; | |
BEGIN | |
Out.String( "Hello World" ); | |
Out.Ln; | |
Out.Int( -1, 0 ); | |
Out.Ln; | |
Out.Int( 0, 0 ); | |
Out.Ln; | |
Out.Int( 1, 0 ); | |
Out.Ln | |
END T00Output. | |
## abstract syntax tree ######################################## | |
## created with ./parse-oberon07 and manually re-indented | |
(MODULE T00Output | |
(IMPORT Out) | |
(BEGIN (BLOCK | |
(INVOKE (. Out String) (ARGS (STRING "Hello World"))) | |
(INVOKE (. Out Ln)) | |
(INVOKE (. Out Int) (ARGS (NEG 1) 0)) | |
(INVOKE (. Out Ln)) | |
(INVOKE (. Out Int) (ARGS 0 0)) | |
(INVOKE (. Out Ln)) | |
(INVOKE (. Out Int) (ARGS 1 0)) | |
(INVOKE (. Out Ln))))) | |
## generated Haxe code ######################################### | |
import Out; | |
class T00Output { | |
public static function main() { | |
Out.String( "Hello World" ); | |
Out.Ln( ); | |
Out.Int( -1, 0 ); | |
Out.Ln( ); | |
Out.Int( 0, 0 ); | |
Out.Ln( ); | |
Out.Int( 1, 0 ); | |
Out.Ln( ); | |
} | |
} | |
## output of the program ####################################### | |
Hello World | |
-1 | |
0 | |
1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment