/** * Creates an abstract syntax tree. * <p> * A successful call to this method returns all settings to their * default values so the object is ready to be reused. * </p> * * @param monitor the progress monitor used to report progress and request cancellation, * or <code>null</code> if none * @return an AST node whose type depends on the kind of parse * requested, with a fallback to a <code>CompilationUnit</code> * in the case of severe parsing errors * @exception IllegalStateException if the settings provided * are insufficient, contradictory, or otherwise unsupported */ public ASTNode createAST(IProgressMonitor monitor) { ASTNode result = null; if (monitor != null) monitor.beginTask("", 1); //$NON-NLS-1$ try { if (this.rawSource == null && this.typeRoot == null) { throw new IllegalStateException("source not specified"); //$NON-NLS-1$ } result = internalCreateAST(monitor); } finally { // reset to defaults to allow reuse (and avoid leaking) initializeDefaults(); if (monitor != null) monitor.done(); } return result; }
/** * Creates an abstract syntax tree. * <p> * A successful call to this method returns all settings to their * default values so the object is ready to be reused. * </p> * * @param monitor the progress monitor used to report progress and request cancellation, * or <code>null</code> if none * @return an AST node whose type depends on the kind of parse * requested, with a fallback to a <code>CompilationUnit</code> * in the case of severe parsing errors * @exception IllegalStateException if the settings provided * are insufficient, contradictory, or otherwise unsupported */ public ASTNode createAST(IProgressMonitor monitor) { ASTNode result = null; if (monitor != null) monitor.beginTask("", 1); //$NON-NLS-1$ try { if (this.rawSource == null && this.typeRoot == null) { throw new IllegalStateException("source not specified"); //$NON-NLS-1$ } result = internalCreateAST(monitor); } finally { // reset to defaults to allow reuse (and avoid leaking) initializeDefaults(); if (monitor != null) monitor.done(); } return result; }
/** * Creates an abstract syntax tree. * <p> * A successful call to this method returns all settings to their * default values so the object is ready to be reused. * </p> * * @param monitor the progress monitor used to report progress and request cancellation, * or <code>null</code> if none * @return an AST node whose type depends on the kind of parse * requested, with a fallback to a <code>CompilationUnit</code> * in the case of severe parsing errors * @exception IllegalStateException if the settings provided * are insufficient, contradictory, or otherwise unsupported */ public ASTNode createAST(IProgressMonitor monitor) { ASTNode result = null; if (monitor != null) monitor.beginTask("", 1); //$NON-NLS-1$ try { if (this.rawSource == null && this.typeRoot == null) { throw new IllegalStateException("source not specified"); //$NON-NLS-1$ } result = internalCreateAST(monitor); } finally { // reset to defaults to allow reuse (and avoid leaking) initializeDefaults(); if (monitor != null) monitor.done(); } return result; }
/** * Creates an abstract syntax tree. * <p> * A successful call to this method returns all settings to their * default values so the object is ready to be reused. * </p> * * @param monitor the progress monitor used to report progress and request cancellation, * or <code>null</code> if none * @return an AST node whose type depends on the kind of parse * requested, with a fallback to a <code>CompilationUnit</code> * in the case of severe parsing errors * @exception IllegalStateException if the settings provided * are insufficient, contradictory, or otherwise unsupported */ public ASTNode createAST(IProgressMonitor monitor) { ASTNode result = null; if (monitor != null) monitor.beginTask("", 1); //$NON-NLS-1$ try { if (this.rawSource == null && this.typeRoot == null) { throw new IllegalStateException("source not specified"); //$NON-NLS-1$ } result = internalCreateAST(monitor); } finally { // reset to defaults to allow reuse (and avoid leaking) initializeDefaults(); if (monitor != null) monitor.done(); } return result; }
throw new IllegalStateException("source not specified"); //$NON-NLS-1$ result = internalCreateAST(subMonitor.split(1)); } finally {
/** * Creates an abstract syntax tree. * <p> * A successful call to this method returns all settings to their * default values so the object is ready to be reused. * </p> * * @param monitor the progress monitor used to report progress and request cancellation, * or <code>null</code> if none * @return an AST node whose type depends on the kind of parse * requested, with a fallback to a <code>CompilationUnit</code> * in the case of severe parsing errors * @exception IllegalStateException if the settings provided * are insufficient, contradictory, or otherwise unsupported */ public ASTNode createAST(IProgressMonitor monitor) { SubMonitor subMonitor = SubMonitor.convert(monitor, 1); ASTNode result = null; try { if (this.rawSource == null && this.typeRoot == null) { throw new IllegalStateException("source not specified"); //$NON-NLS-1$ } result = internalCreateAST(subMonitor.split(1)); } finally { // reset to defaults to allow reuse (and avoid leaking) initializeDefaults(); } return result; }