UnBCIC-TP2 / Oberon-Scala

An implementation of the Oberon language using Scala
55 stars 118 forks source link

Refactored Main.scala #126

Closed qrno closed 1 year ago

qrno commented 1 year ago

Refactored Main.Scala using Scallop "subcommands" instead of "options" for everything, which is probably the intended abstraction for the usecase. Also made use of some other features from the Scallop library, such as opt[Path] and validatePathExists(), which makes it so we don't have to check if input files exist ourselves.

The JVM compilation behavior is different from how it was before. I don't know how exactly it is supposed to be.

Usage: java -jar oberon.jar compile --input test.oberon --output test.c --backend c java -jar oberon.jar compile -i test.oberon -o test.c -b c java -jar oberon.jar compile -i test.oberon -o test.llvm -b llvm java -jar oberon.jar interpreter -i test.oberon java -jar oberon.jar repl