Package org.eclipse.php.internal.core.ast.nodes

Examples of org.eclipse.php.internal.core.ast.nodes.ASTParser


    if (progressMonitor != null && progressMonitor.isCanceled()) {
      return null;
    }

    final ASTParser parser = ASTParser.newParser(SHARED_AST_LEVEL, input);
    if (parser == null) {
      return null;
    }

    if (progressMonitor != null && progressMonitor.isCanceled()) {
      return null;
    }

    final Program root[] = new Program[1];

    SafeRunner.run(new ISafeRunnable() {
      public void run() {
        try {
          if (progressMonitor != null && progressMonitor.isCanceled()) {
            return;
          }
          if (DEBUG) {
            System.err
                .println(getThreadName()
                    + " - " + DEBUG_PREFIX + "creating AST for: " + input.getElementName()); //$NON-NLS-1$ //$NON-NLS-2$
          }
          root[0] = (Program) parser.createAST(progressMonitor);

          // mark as unmodifiable
          ASTNodes.setFlagsToAST(root[0], ASTNode.PROTECT);
        } catch (OperationCanceledException ex) {
          return;
View Full Code Here


      endTime= System.currentTimeMillis();
     
    } else {
      ISourceModule sm = (ISourceModule) input;
      StringReader st = new StringReader (sm.getBuffer().getContents());
      ASTParser parser= ASTParser.newParser(st, PHPVersion.byAlias(astLevel),  false, sm);
      startTime= System.currentTimeMillis();
      root= (Program) parser.createAST(null);
      endTime= System.currentTimeMillis();
    }
    if (root != null) {
      updateContentDescription(input, root, endTime - startTime);
    }
View Full Code Here

    if (project != null) {
      version = ProjectOptions.getPhpVersion(project);
    } else {
      version = ProjectOptions.getDefaultPhpVersion();
    }
    ASTParser newParser = ASTParser.newParser(version,
        (ISourceModule) source);
    return newParser.createAST(null);
  }
View Full Code Here

    IModelElement editorElement = ((PHPStructuredEditor) targetEditor)
        .getModelElement();
    if (editorElement != null) {
      ISourceModule sourceModule = ((ModelElement) editorElement)
          .getSourceModule();
      ASTParser parser = ASTParser.newParser(sourceModule);

      Program program;
      try {
        program = parser.createAST(null);
        program.recordModifications();

        AST ast = program.getAST();
        IDocument document = ((PHPStructuredEditor) targetEditor)
            .getDocument();
View Full Code Here

    if (project != null) {
      version = ProjectOptions.getPhpVersion(project);
    } else {
      version = ProjectOptions.getDefaultPhpVersion();
    }
    ASTParser newParser = ASTParser.newParser(version,
        (ISourceModule) source);
    return newParser.createAST(null);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.php.internal.core.ast.nodes.ASTParser

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.