wip: interpreter

This commit is contained in:
2024-01-25 10:57:23 +07:00
parent 8cd8859c85
commit 692babe938
6 changed files with 84 additions and 42 deletions

View 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()
}