org.eclipse.cdt.internal.ui.editor
Class ASTProvider

java.lang.Object
  extended by org.eclipse.cdt.internal.ui.editor.ASTProvider

public final class ASTProvider
extends java.lang.Object

Provides a shared AST for clients. The shared AST is the AST of the active CEditor's input element.

Since:
4.0

Nested Class Summary
static class ASTProvider.WAIT_FLAG
          Wait flag.
 
Field Summary
static int PARSE_MODE_FAST
          Fast parse mode (use PDOM)
static int PARSE_MODE_FULL
          Full parse mode (no PDOM)
static ASTProvider.WAIT_FLAG WAIT_ACTIVE_ONLY
          Wait flag indicating that a client requesting an AST only wants to wait for the shared AST of the active editor.
static ASTProvider.WAIT_FLAG WAIT_NO
          Wait flag indicating that a client requesting an AST only wants the already available shared AST.
static ASTProvider.WAIT_FLAG WAIT_YES
          Wait flag indicating that a client requesting an AST wants to wait until an AST is ready.
 
Constructor Summary
ASTProvider()
          Creates a new AST provider.
 
Method Summary
 void dispose()
          Disposes this AST provider.
static ASTProvider getASTProvider()
          Returns the C plug-in's AST provider.
 boolean isActive(org.eclipse.cdt.core.model.ITranslationUnit tu)
          Returns whether this AST provider is active on the given translation unit.
 org.eclipse.core.runtime.IStatus runOnAST(org.eclipse.cdt.core.model.ICElement cElement, ASTProvider.WAIT_FLAG waitFlag, org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.cdt.internal.core.model.ASTCache.ASTRunnable astRunnable)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WAIT_YES

public static final ASTProvider.WAIT_FLAG WAIT_YES
Wait flag indicating that a client requesting an AST wants to wait until an AST is ready.

An AST will be created by this AST provider if the shared AST is not for the given C element.


WAIT_ACTIVE_ONLY

public static final ASTProvider.WAIT_FLAG WAIT_ACTIVE_ONLY
Wait flag indicating that a client requesting an AST only wants to wait for the shared AST of the active editor.

No AST will be created by the AST provider.


WAIT_NO

public static final ASTProvider.WAIT_FLAG WAIT_NO
Wait flag indicating that a client requesting an AST only wants the already available shared AST.

No AST will be created by the AST provider.


PARSE_MODE_FULL

public static int PARSE_MODE_FULL
Full parse mode (no PDOM)


PARSE_MODE_FAST

public static int PARSE_MODE_FAST
Fast parse mode (use PDOM)

Constructor Detail

ASTProvider

public ASTProvider()
Creates a new AST provider.

Method Detail

getASTProvider

public static ASTProvider getASTProvider()
Returns the C plug-in's AST provider.

Returns:
the AST provider

isActive

public boolean isActive(org.eclipse.cdt.core.model.ITranslationUnit tu)
Returns whether this AST provider is active on the given translation unit.

Parameters:
tu - the translation unit
Returns:
true if the given translation unit is the active one

dispose

public void dispose()
Disposes this AST provider.


runOnAST

public org.eclipse.core.runtime.IStatus runOnAST(org.eclipse.cdt.core.model.ICElement cElement,
                                                 ASTProvider.WAIT_FLAG waitFlag,
                                                 org.eclipse.core.runtime.IProgressMonitor monitor,
                                                 org.eclipse.cdt.internal.core.model.ASTCache.ASTRunnable astRunnable)