added some test files nothing is working t#34
This commit is contained in:
30
library.alpha
Normal file
30
library.alpha
Normal file
@ -0,0 +1,30 @@
|
||||
(* At compiler start-up your program should create symbol table entries for the four primitive types:
|
||||
Boolean (1 byte)
|
||||
character (1 byte)
|
||||
integer (4 bytes)
|
||||
address (8 bytes)
|
||||
You should #include this file at the start of your alpha file.
|
||||
Some useful types are defined below.
|
||||
*)
|
||||
type string: 1 -> character
|
||||
type BooleanXBoolean: [Boolean: x, y]
|
||||
type characterXcharacter: [character: x, y]
|
||||
type integerXinteger: [integer: x, y]
|
||||
|
||||
type Boolean2Boolean: Boolean -> Boolean
|
||||
type integer2integer: integer -> integer
|
||||
type character2integer: character -> integer
|
||||
type Boolean2integer: Boolean -> integer
|
||||
type string2integer: string -> integer
|
||||
type integerXinteger2integer: integerXinteger -> integer
|
||||
type integerXinteger2Boolean: integerXinteger -> Boolean
|
||||
type characterXcharacter2Boolean: characterXcharacter -> Boolean
|
||||
type BooleanXBoolean2Boolean: BooleanXBoolean -> Boolean
|
||||
type integer2address: integer -> address
|
||||
type address2integer: address -> integer
|
||||
external function printInteger: integer2integer
|
||||
external function printCharacter: character2integer
|
||||
external function printBoolean: Boolean2integer
|
||||
external function reserve: integer2address
|
||||
external function release: address2integer
|
||||
function entry: string2integer
|
4
simple.alpha
Normal file
4
simple.alpha
Normal file
@ -0,0 +1,4 @@
|
||||
#include "library.alpha"
|
||||
entry(arg) := {
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user