@Override public BindingKeyParser newParser() { return new BindingKeyResolver(this, this.compiler, this.environment, this.outerMostParsedUnit == null ? this.parsedUnit : this.outerMostParsedUnit, this.resolvedUnits); }
@Override public void consumeKey() { if (this.typeBinding != null) { this.typeBinding = getArrayBinding(this.dimension, this.typeBinding); this.compilerBinding = this.typeBinding; } }
public void consumeBaseType(char[] baseTypeSig) { this.compoundName = new char[][] {getKey().toCharArray()}; TypeBinding baseTypeBinding = getBaseTypeBinding(baseTypeSig); if (baseTypeBinding != null) { this.typeBinding = baseTypeBinding; } }
BindingKeyResolver resolver = new BindingKeyResolver(bindingKeys[i], this, this.lookupEnvironment); resolver.parse(true/*pause after fully qualified name*/); CompilationUnitDeclaration parsedUnit = resolver.hasTypeName() ? resolver.getCompilationUnitDeclaration() : null; if (parsedUnit != null) { char[] fileName = parsedUnit.compilationResult.getFileName(); char[] key = resolver.hasTypeName() ? resolver.getKey().toCharArray() // binary binding : CharOperation.concatWith(resolver.compoundName(), '.'); // package binding or base type binding this.requestedKeys.put(key, resolver);
private void reportBinding(Object key, ASTRequestor astRequestor, WorkingCopyOwner owner, CompilationUnitDeclaration unit) { BindingKeyResolver keyResolver = (BindingKeyResolver) key; Binding compilerBinding = keyResolver.getCompilerBinding(); if (compilerBinding != null) { DefaultBindingResolver resolver = new DefaultBindingResolver(unit.scope, owner, this.bindingTables, false, this.fromJavaProject); AnnotationBinding annotationBinding = keyResolver.getAnnotationBinding(); IBinding binding; if (annotationBinding != null) { binding = resolver.getAnnotationInstance(annotationBinding); } else { binding = resolver.getBinding(compilerBinding); } if (binding != null) astRequestor.acceptBinding(keyResolver.getKey(), binding); } }
BindingKeyResolver resolver = new BindingKeyResolver(bindingKeys[i], this, this.lookupEnvironment); resolver.parse(true/*pause after fully qualified name*/); CompilationUnitDeclaration parsedUnit = resolver.hasTypeName() ? resolver.getCompilationUnitDeclaration() : null; if (parsedUnit != null) { char[] fileName = parsedUnit.compilationResult.getFileName(); char[] key = resolver.hasTypeName() ? resolver.getKey().toCharArray() // binary binding : resolver.hasModuleName() ? resolver.moduleName() : CharOperation.concatWith(resolver.compoundName(), '.'); // package binding or base type binding this.requestedKeys.put(key, resolver);
public void consumeTopLevelType() { char[] fileName; this.parsedUnit = getCompilationUnitDeclaration(); if (this.parsedUnit != null && this.compiler != null && !this.resolvedUnits.containsKey(fileName = this.parsedUnit.getFileName())) { this.compiler.process(this.parsedUnit, this.compiler.totalUnits+1); // unit is resolved only once thanks to the resolvedUnits protection this.resolvedUnits.put(fileName, fileName); } if (this.parsedUnit == null) { this.typeBinding = getBinaryBinding(); } else { char[] typeName = this.secondarySimpleName == null ? this.compoundName[this.compoundName.length-1] : this.secondarySimpleName; this.typeBinding = getTypeBinding(typeName); } }
IBinding createBinding(String key) { if (this.bindingTables == null) throw new RuntimeException("Cannot be called outside ASTParser#createASTs(...)"); //$NON-NLS-1$ BindingKeyResolver keyResolver = new BindingKeyResolver(key, this, this.lookupEnvironment); Binding compilerBinding = keyResolver.getCompilerBinding(); if (compilerBinding == null) return null; DefaultBindingResolver resolver = new DefaultBindingResolver(this.lookupEnvironment, null/*no owner*/, this.bindingTables, false, this.fromJavaProject); return resolver.getBinding(compilerBinding); }
static class IntArrayList { public int[] list = new int[5]; public int length = 0; public void add(int i) { if (this.list.length == this.length) { System.arraycopy(this.list, 0, this.list = new int[this.length*2], 0, this.length); } this.list[this.length++] = i; } }
public void consumeParameterizedGenericMethod() { if (this.methodBinding == null) return; TypeBinding[] arguments = getTypeBindingArguments(); if (arguments == null) { this.methodBinding = null; this.compilerBinding = null; return; } if (arguments.length != this.methodBinding.typeVariables().length) this.methodBinding = this.environment.createParameterizedGenericMethod(this.methodBinding, (RawTypeBinding) null); else this.methodBinding = this.environment.createParameterizedGenericMethod(this.methodBinding, arguments); this.compilerBinding = this.methodBinding; }
@Override public String toString() { return getKey(); }
@Override public void consumeMemberType(char[] simpleTypeName) { this.typeBinding = getTypeBinding(simpleTypeName); }
BindingKeyResolver resolver = new BindingKeyResolver(bindingKeys[i], this, this.lookupEnvironment); resolver.parse(true/*pause after fully qualified name*/); CompilationUnitDeclaration parsedUnit = resolver.hasTypeName() ? resolver.getCompilationUnitDeclaration() : null; if (parsedUnit != null) { char[] fileName = parsedUnit.compilationResult.getFileName(); char[] key = resolver.hasTypeName() ? resolver.getKey().toCharArray() // binary binding : CharOperation.concatWith(resolver.compoundName(), '.'); // package binding or base type binding this.requestedKeys.put(key, resolver);
private void reportBinding(Object key, FileASTRequestor astRequestor, CompilationUnitDeclaration unit) { BindingKeyResolver keyResolver = (BindingKeyResolver) key; Binding compilerBinding = keyResolver.getCompilerBinding(); if (compilerBinding != null) { DefaultBindingResolver resolver = new DefaultBindingResolver(unit.scope, null, this.bindingTables, false, this.fromJavaProject); AnnotationBinding annotationBinding = keyResolver.getAnnotationBinding(); IBinding binding; if (annotationBinding != null) { binding = resolver.getAnnotationInstance(annotationBinding); } else { binding = resolver.getBinding(compilerBinding); } if (binding != null) astRequestor.acceptBinding(keyResolver.getKey(), binding); } }
BindingKeyResolver resolver = new BindingKeyResolver(bindingKeys[i], this, this.lookupEnvironment); resolver.parse(true/*pause after fully qualified name*/); CompilationUnitDeclaration parsedUnit = resolver.hasTypeName() ? resolver.getCompilationUnitDeclaration() : null; if (parsedUnit != null) { char[] fileName = parsedUnit.compilationResult.getFileName(); char[] key = resolver.hasTypeName() ? resolver.getKey().toCharArray() // binary binding : resolver.hasModuleName() ? resolver.moduleName() : CharOperation.concatWith(resolver.compoundName(), '.'); // package binding or base type binding this.requestedKeys.put(key, resolver);
public void consumeTopLevelType() { char[] fileName; this.parsedUnit = getCompilationUnitDeclaration(); if (this.parsedUnit != null && this.compiler != null && !this.resolvedUnits.containsKey(fileName = this.parsedUnit.getFileName())) { this.compiler.process(this.parsedUnit, this.compiler.totalUnits+1); // unit is resolved only once thanks to the resolvedUnits protection this.resolvedUnits.put(fileName, fileName); } if (this.parsedUnit == null) { this.typeBinding = getBinaryBinding(); } else { char[] typeName = this.secondarySimpleName == null ? this.compoundName[this.compoundName.length-1] : this.secondarySimpleName; this.typeBinding = getTypeBinding(typeName); } }
IBinding createBinding(String key) { if (this.bindingTables == null) throw new RuntimeException("Cannot be called outside ASTParser#createASTs(...)"); //$NON-NLS-1$ BindingKeyResolver keyResolver = new BindingKeyResolver(key, this, this.lookupEnvironment); Binding compilerBinding = keyResolver.getCompilerBinding(); if (compilerBinding == null) return null; DefaultBindingResolver resolver = new DefaultBindingResolver(this.lookupEnvironment, null/*no owner*/, this.bindingTables, false, this.fromJavaProject); return resolver.getBinding(compilerBinding); }
static class IntArrayList { public int[] list = new int[5]; public int length = 0; public void add(int i) { if (this.list.length == this.length) { System.arraycopy(this.list, 0, this.list = new int[this.length*2], 0, this.length); } this.list[this.length++] = i; } }