diff options
author | chris.sutcliffe <ctd.sutcliffe@gmail.com> | 2021-11-30 12:28:05 +0000 |
---|---|---|
committer | chris.sutcliffe <ctd.sutcliffe@gmail.com> | 2021-11-30 12:28:05 +0000 |
commit | 1237b1eb8effe50f77997934d86930f1252fe993 (patch) | |
tree | cc114b177fe6853c94db61c8cffbdff6633d0f01 | |
parent | 4caf60954379915ccc51fd2c1801399dd97c0c89 (diff) | |
parent | 63ddd9e636e374bb3a3a3fe8a97ab26c6abc04c9 (diff) | |
download | esotericFORTRAN-1237b1eb8effe50f77997934d86930f1252fe993.tar.gz esotericFORTRAN-1237b1eb8effe50f77997934d86930f1252fe993.zip |
Merge branch 'main' of github.com:AlfieEagleton/EsotericProject into main
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | src/Compiler/Language.java | 6 | ||||
-rw-r--r-- | src/IDE/IDE/HelloApplication.java | 25 | ||||
-rw-r--r-- | src/IDE/IDE/HelloController.java | 14 | ||||
-rw-r--r-- | src/IDE/IDE/hello-view.fxml | 16 | ||||
-rw-r--r-- | src/IDE/Makefile | 5 | ||||
-rw-r--r-- | src/IDE/readme.md | 19 | ||||
-rw-r--r-- | src/UI/.gitkeep | 0 | ||||
-rw-r--r-- | src/readme.md | 2 |
9 files changed, 83 insertions, 5 deletions
@@ -2,6 +2,7 @@ src/.vscode/ src/build/ *.jar +src/IDE/.idea/ *.class code/simpleSableCCCalulator/sableCCCalculator/analysis/ diff --git a/src/Compiler/Language.java b/src/Compiler/Language.java index 3559c37..b433b36 100644 --- a/src/Compiler/Language.java +++ b/src/Compiler/Language.java @@ -5,11 +5,8 @@ import java.nio.file.Files; import java.nio.file.Paths; import java.nio.file.Path; import java.util.List; -import java.util.Base64; import java.util.Scanner; import java.util.ArrayList; -import java.io.File; -import java.io.FileNotFoundException; //Base class for the interpreter public class Language { @@ -39,7 +36,8 @@ public class Language { return; } - String outname = args[0].split("\\.(?=[^\\.]+$)")[0]; + Path initOutPath = Paths.get(args[0]); + String outname = initOutPath.getName(initOutPath.getNameCount() - 1).toString().split("\\.(?=[^\\.]+$)")[0]; ArrayList<String> arrayArgs = new ArrayList<>(); for (int i = 0; i < args.length; i++) { String arg = args[i]; diff --git a/src/IDE/IDE/HelloApplication.java b/src/IDE/IDE/HelloApplication.java new file mode 100644 index 0000000..aaa728f --- /dev/null +++ b/src/IDE/IDE/HelloApplication.java @@ -0,0 +1,25 @@ +package IDE; + +import javafx.application.Application; +import javafx.fxml.FXMLLoader; +import javafx.scene.Scene; +import javafx.stage.Stage; +import java.io.File; +import javafx.scene.Parent; + +import java.io.IOException; + +public class HelloApplication extends Application { + @Override + public void start(Stage stage) throws IOException { + Parent root = FXMLLoader.load(getClass().getResource("hello-view.fxml")); + Scene scene = new Scene(root, 320, 240); + stage.setTitle("Hello!"); + stage.setScene(scene); + stage.show(); + } + + public static void main(String[] args) { + launch(); + } +}
\ No newline at end of file diff --git a/src/IDE/IDE/HelloController.java b/src/IDE/IDE/HelloController.java new file mode 100644 index 0000000..877e5ba --- /dev/null +++ b/src/IDE/IDE/HelloController.java @@ -0,0 +1,14 @@ +package IDE; + +import javafx.fxml.FXML; +import javafx.scene.control.Label; + +public class HelloController { + @FXML + private Label welcomeText; + + @FXML + protected void onHelloButtonClick() { + welcomeText.setText("Welcome to the FORTRAN compiler application!"); + } +}
\ No newline at end of file diff --git a/src/IDE/IDE/hello-view.fxml b/src/IDE/IDE/hello-view.fxml new file mode 100644 index 0000000..c31d9e2 --- /dev/null +++ b/src/IDE/IDE/hello-view.fxml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<?import javafx.geometry.Insets?> +<?import javafx.scene.control.Label?> +<?import javafx.scene.layout.VBox?> + +<?import javafx.scene.control.Button?> +<VBox alignment="CENTER" spacing="20.0" xmlns:fx="http://javafx.com/fxml" + fx:controller="IDE.HelloController"> + <padding> + <Insets bottom="20.0" left="20.0" right="20.0" top="20.0"/> + </padding> + + <Label fx:id="welcomeText"/> + <Button text="Hello!" onAction="#onHelloButtonClick"/> +</VBox> diff --git a/src/IDE/Makefile b/src/IDE/Makefile new file mode 100644 index 0000000..127db02 --- /dev/null +++ b/src/IDE/Makefile @@ -0,0 +1,5 @@ +all: + javac --module-path ../../../javafx-sdk-17.0.1/lib/ --add-modules javafx.controls,javafx.fxml ./IDE/*.java + +clean: + rm -vf IDE/*.class diff --git a/src/IDE/readme.md b/src/IDE/readme.md new file mode 100644 index 0000000..0dc9faa --- /dev/null +++ b/src/IDE/readme.md @@ -0,0 +1,19 @@ +# esotericFORTRAN IDE + +## Setting Up + +Install FXML from [here](https://gluonhq.com/products/javafx/) and extract it in the directory behind `EsotericProject` + +## Running + +To compile, simply run `make`. Then to run: + +`java --module-path ..\..\..\javafx-sdk-17.0.1\lib\ --add-modules javafx.controls,javafx.fxml IDE.HelloApplication` + +## Editors? + +If you got intellisense and stuff to work in vscodium, well done, coz I couldn't do that :3 + +### IntelliJ + +I hate IntelliJ but its the only way I could get a working intellisense. Right click on this folder and select 'Open Folder as an IntelliJ IDEA Community Edition Project', then follow [this](https://openjfx.io/openjfx-docs/#install-javafx) guide (select 'JavaFX and IntelliJ' in the website sidebar).
\ No newline at end of file diff --git a/src/UI/.gitkeep b/src/UI/.gitkeep deleted file mode 100644 index e69de29..0000000 --- a/src/UI/.gitkeep +++ /dev/null diff --git a/src/readme.md b/src/readme.md index 4031f10..0f5da1e 100644 --- a/src/readme.md +++ b/src/readme.md @@ -12,7 +12,7 @@ Compile ## Example usage (command line) -`java -jar esotericFORTRAN.jar example.txt -c -pc -e` +`java -jar .\esotericFORTRAN.jar .\examples\iteration.ft -c --execute -pc` Full documentaion is avaliable at `Compiler/helptext.txt` or `java -jar esotericFORTRAN.jar --help` |