/** * Creates a new AST parser for the given API level. * <p> * N.B. This constructor is package-private. * </p> * * @param level the API level; one of the LEVEL constants * declared on <code>AST</code> */ ASTParser(int level) { if ((level != AST.JLS2_INTERNAL) && (level != AST.JLS3)) { throw new IllegalArgumentException(); } this.apiLevel = level; initializeDefaults(); }
/** * Creates a new AST parser for the given API level. * <p> * N.B. This constructor is package-private. * </p> * * @param level the API level; one of the <code>JLS*</code> level constants * declared on {@link AST} */ ASTParser(int level) { switch(level) { case AST.JLS2_INTERNAL: case AST.JLS3_INTERNAL: case AST.JLS4_INTERNAL: case AST.JLS8: break; default: throw new IllegalArgumentException(); } this.apiLevel = level; initializeDefaults(); }
/** * Creates a new AST parser for the given API level. * <p> * N.B. This constructor is package-private. * </p> * * @param level the API level; one of the <code>JLS*</code> level constants * declared on {@link AST} */ ASTParser(int level) { switch(level) { case AST.JLS2_INTERNAL: case AST.JLS3_INTERNAL: case AST.JLS4_INTERNAL: case AST.JLS8: break; default: throw new IllegalArgumentException(); } this.apiLevel = level; initializeDefaults(); }
/** * Creates a new AST parser for the given API level. * <p> * N.B. This constructor is package-private. * </p> * * @param level the API level; one of the <code>JLS*</code> level constants * declared on {@link AST} */ ASTParser(int level) { switch(level) { case AST.JLS2_INTERNAL: case AST.JLS3_INTERNAL: case AST.JLS4_INTERNAL: case AST.JLS8_INTERNAL: case AST.JLS9_INTERNAL: case AST.JLS10_INTERNAL: case AST.JLS11_INTERNAL: break; default: throw new IllegalArgumentException(); } this.apiLevel = level; initializeDefaults(); }
/** * Creates a new AST parser for the given API level. * <p> * N.B. This constructor is package-private. * </p> * * @param level the API level; one of the <code>JLS*</code> level constants * declared on {@link AST} */ ASTParser(int level) { switch(level) { case AST.JLS2_INTERNAL: case AST.JLS3_INTERNAL: case AST.JLS4_INTERNAL: case AST.JLS8: break; default: throw new IllegalArgumentException(); } this.apiLevel = level; initializeDefaults(); }
/** * Creates a new AST parser for the given API level. * <p> * N.B. This constructor is package-private. * </p> * * @param level the API level; one of the <code>JLS*</code> level constants * declared on {@link AST} */ ASTParser(int level) { switch(level) { case AST.JLS2_INTERNAL: case AST.JLS3_INTERNAL: case AST.JLS4_INTERNAL: case AST.JLS8_INTERNAL: case AST.JLS9_INTERNAL: break; default: throw new IllegalArgumentException(); } this.apiLevel = level; initializeDefaults(); }
/** * 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; }
} finally { initializeDefaults();
/** * 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; }