Package tool.editors.method

Source Code of tool.editors.method.MethodAutoEditStrategy

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);
//      }
//    }
  }
}
TOP

Related Classes of tool.editors.method.MethodAutoEditStrategy

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.