package tool.editors.method;
import org.antlr.runtime.CommonTokenStream;
import org.antlr.runtime.RecognitionException;
import org.antlr.runtime.TokenStream;
import org.eclipse.jface.text.DocumentCommand;
import org.eclipse.jface.text.IDocument;
import tool.ToolPlugin;
import tool.editors.ToolAutoEditStrategy;
import tool.model.grammar.ForteLexer;
import tool.model.grammar.ForteParser;
import tool.model.grammar.NoCaseStringStream;
public class MethodAutoEditStrategy extends ToolAutoEditStrategy {
ForteParser parser;
NoCaseStringStream stream;
ForteLexer lexer;
TokenStream tokenStream;
public MethodAutoEditStrategy() {
super();
parser = new ForteParser(null);
}
@Override
public void customizeDocumentCommand(IDocument document,
DocumentCommand command) {
super.customizeDocumentCommand(document, command);
// if (ToolPlugin.useParser()){
// try {
// stream = new NoCaseStringStream(document.get());
// lexer = new ForteLexer(stream);
// tokenStream = new CommonTokenStream(lexer);
// parser.setTokenStream(tokenStream);
// parser.implementationFile();
// } catch (RecognitionException e) {
// ToolPlugin.showError("Error parsing method code", e);
// }
// }
}
}