1 package de.lathanda.eos.common.gui;
3 import java.util.LinkedList;
5 import de.lathanda.eos.baseparser.AbstractProgram;
6 import de.lathanda.eos.baseparser.CompilerListener;
7 import de.lathanda.eos.baseparser.Program;
8 import de.lathanda.eos.baseparser.Source;
9 import de.lathanda.eos.baseparser.exceptions.TranslationException;
10 import de.lathanda.eos.config.Language;
11 import de.lathanda.eos.interpreter.parser.de.EosParserFactory;
12 import de.lathanda.eos.vm.ErrorInformation;
25 private final Source source;
26 private LinkedList<ErrorInformation> errors;
32 errors =
new LinkedList<>();
42 private void update() {
44 String src = source.getSourceCode();
45 errors =
new LinkedList<>();
52 program.
parse(source.getPath());
54 }
catch (TranslationException te) {
55 errors.add(te.getErrorInformation());
58 if (program !=
null) {
61 cmc.fireCompileComplete();
66 private final LinkedList<CompilerListener> compilerListener;
69 compilerListener =
new LinkedList<>();
73 compilerListener.add(cl);
77 compilerListener.remove(cl);
80 void fireCompileComplete() {
81 compilerListener.forEach((cl) -> {
89 if (program !=
null) {
BackgroundCompiler(Source source)
void removeCompilerListener(CompilerListener cl)
void addCompilerListener(CompilerListener cl)
String getDefaultWindowName()
boolean isLockProperties()
LinkedList< ErrorInformation > getErrors()
void compileComplete(LinkedList< ErrorInformation > errors, AbstractProgram program)