Search in sources :

Example 1 with Assembler

use of com.kasirgalabs.etumulator.lang.Assembler in project ETUmulator by kasirgalabs.

the class ETUmulatorController method runButtonOnAction.

@FXML
private void runButtonOnAction(ActionEvent event) {
    processor.stop();
    processorUnits.reset();
    Assembler assembler = new Assembler(memory);
    ExecutableCode executableCode;
    try {
        executableCode = assembler.assemble(document.getText() + "\n");
    } catch (SyntaxError | LabelError | NumberFormatException ex) {
        System.err.println(ex.getMessage());
        return;
    }
    processor.run(executableCode);
}
Also used : SyntaxError(com.kasirgalabs.etumulator.lang.SyntaxError) LabelError(com.kasirgalabs.etumulator.lang.LabelError) Assembler(com.kasirgalabs.etumulator.lang.Assembler) ExecutableCode(com.kasirgalabs.etumulator.lang.Linker.ExecutableCode) FXML(javafx.fxml.FXML)

Aggregations

Assembler (com.kasirgalabs.etumulator.lang.Assembler)1 LabelError (com.kasirgalabs.etumulator.lang.LabelError)1 ExecutableCode (com.kasirgalabs.etumulator.lang.Linker.ExecutableCode)1 SyntaxError (com.kasirgalabs.etumulator.lang.SyntaxError)1 FXML (javafx.fxml.FXML)1