Package org.eclipse.dltk.ast.parser

Examples of org.eclipse.dltk.ast.parser.ISourceParser


  protected CodeBlock[] getCodeBlocks(String code, int offset) {
    /*
     * if an ASTVisitor implementation is created for this, just override getFoldingVisitor() and
     * remove this method
     */
    ISourceParser pp = null;
    pp = DLTKLanguageManager.getSourceParser(RutaNature.NATURE_ID);
    ModuleDeclaration md = (ModuleDeclaration) pp.parse(new ModuleSource(code), null);
    List statements = md.getStatements();
    if (statements == null) {
      return new CodeBlock[0];
    }

View Full Code Here


    // fPairs = pairs;
    this.editor = editor;
  }

  private PairBlock[] computePairRanges(final int offset, String contents) {
    ISourceParser pp = null;
    pp = DLTKLanguageManager.getSourceParser(RutaNature.NATURE_ID);
    ModuleDeclaration md = null;// pp.parse(null, contents.toCharArray(),
    // null);
    IModelElement el = this.editor.getInputModelElement();
    if (el != null && el instanceof ISourceModule) {
      md = SourceParserUtil.getModuleDeclaration((ISourceModule) el, null);
    }
    if (md == null) {
      md = (ModuleDeclaration) pp.parse(new ModuleSource(contents), null);
    }
    if (md == null) {
      return new PairBlock[0];
    }
    final List result = new ArrayList();
View Full Code Here

  protected CodeBlock[] getCodeBlocks(String code, int offset) {
    /*
     * if an ASTVisitor implementation is created for this, just override getFoldingVisitor() and
     * remove this method
     */
    ISourceParser pp = null;
    pp = DLTKLanguageManager.getSourceParser(RutaNature.NATURE_ID);
    ModuleDeclaration md = (ModuleDeclaration) pp.parse(new ModuleSource(code), null);
    List statements = md.getStatements();
    if (statements == null) {
      return new CodeBlock[0];
    }

View Full Code Here

    // fPairs = pairs;
    this.editor = editor;
  }

  private PairBlock[] computePairRanges(final int offset, String contents) {
    ISourceParser pp = null;
    pp = DLTKLanguageManager.getSourceParser(RutaNature.NATURE_ID);
    ModuleDeclaration md = null;// pp.parse(null, contents.toCharArray(),
    // null);
    IModelElement el = this.editor.getInputModelElement();
    if (el != null && el instanceof ISourceModule) {
      md = SourceParserUtil.getModuleDeclaration((ISourceModule) el, null);
    }
    if (md == null) {
      md = (ModuleDeclaration) pp.parse(new ModuleSource(contents), null);
    }
    if (md == null) {
      return new PairBlock[0];
    }
    final List result = new ArrayList();
View Full Code Here

  @Override
  public IBuildParticipant createBuildParticipant(IScriptProject project)
      throws CoreException {
    if (natureId != null) {
      final ISourceParser parser = DLTKLanguageManager
          .getSourceParser(natureId);
      if (parser != null) {
        return new ParserBuildParticipant(parser);
      }
    }
View Full Code Here

  protected void parse(IProject project, IFile file, Reporter reporter)
    throws Exception
  {
    // lame cast, but we have to use the SourceModule for pdt.
    IModuleSource module = (IModuleSource)DltkUtils.getSourceModule(file);
    ISourceParser parser = SourceParserManager
      .getInstance().getSourceParser(project, getNature());
    parser.parse(module, reporter);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.ast.parser.ISourceParser

Copyright © 2018 www.massapicom. 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.