Commit 5e2597ed authored by Johannes Roith's avatar Johannes Roith

Register syntax highlighter for parser events.

parent edce46be
......@@ -2,6 +2,7 @@ package de.tum.in.www2.cupplugin.editors;
import java.io.IOException;
import java.io.StringReader;
import java.util.EnumSet;
import java.util.HashSet;
import org.eclipse.swt.widgets.Shell;
......@@ -42,6 +43,8 @@ import de.in.tum.www2.cup.ast.ProductionRight;
import de.in.tum.www2.java.JavaScanner;
import de.in.tum.www2.java.JavaSymbol;
import de.tum.in.www2.cupplugin.PluginUtility;
import de.tum.in.www2.cupplugin.controller.Controller.JobsToDo;
import de.tum.in.www2.cupplugin.controller.RegisterForControllerChanges;
import de.tum.in.www2.cupplugin.model.CupParserASTChangeObserver;
import de.tum.in.www2.cupplugin.model.Model;
......@@ -92,7 +95,7 @@ public class CupSourceViewerConfiguration extends SourceViewerConfiguration {
}
public class PresentationModelObserver implements
CupParserASTChangeObserver {
CupParserASTChangeObserver, RegisterForControllerChanges {
private CupTokenScanner cupTokenScanner;
private JavaTokenScanner javaTokenScanner;
private ISourceViewer sourceViewer;
......@@ -114,6 +117,11 @@ public class CupSourceViewerConfiguration extends SourceViewerConfiguration {
cupTokenScanner.updateDeclarations(result.findDeclarations());
}
@Override
public EnumSet<JobsToDo> getRequiredJobs() {
return EnumSet.of(JobsToDo.parseCode);
}
@Override
public void modelChanged(Model model) {
ParserResult result = model.getAstModel();
......@@ -135,6 +143,7 @@ public class CupSourceViewerConfiguration extends SourceViewerConfiguration {
}
}
}
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment