Skip to content

Instantly share code, notes, and snippets.

@tangentstorm
Created January 20, 2013 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tangentstorm/4581941 to your computer and use it in GitHub Desktop.
Save tangentstorm/4581941 to your computer and use it in GitHub Desktop.
Oberon07->Haxe!!!
##
## 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