wip: interpreter
This commit is contained in:
37
interpreter/interpreter.go
Normal file
37
interpreter/interpreter.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"unicode"
|
||||
"bytes"
|
||||
"bufio"
|
||||
"strings"
|
||||
"strconv"
|
||||
"os"
|
||||
"fmt"
|
||||
"errors"
|
||||
. "e1lama/elm"
|
||||
)
|
||||
|
||||
|
||||
func LoadProgramFromBinary(m *Machine, f *os.File) error {
|
||||
|
||||
}
|
||||
|
||||
func main() {
|
||||
f, err := os.Open("program.elb")
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "[ERR] Couldn't open file: %s\n", err);
|
||||
os.Exit(1)
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
m := Constructor()
|
||||
|
||||
err = LoadProgramFromBinary(m, f)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "[ERR] Error reading binary: %s\n", err);
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
m.Run()
|
||||
}
|
||||
Reference in New Issue
Block a user