Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
blob: 34ca4957e3e8c5ce7e0e7166ff2ec4b0e22b37dc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
public class A {
	private void updateAnnotation() {
		while (this.astLengthPtr >= 0) {
			// Starting with the stack top, so get references (eg. Expression) coming from @see declarations
			if (this.astLengthPtr == 2) {
				int size = this.astLengthStack[this.astLengthPtr--];
			}
			// Then continuing with class names (eg. TypeReference) coming from @throw/@exception declarations
			else if (this.astLengthPtr == 1) {
				int size = this.astLengthStack[this.astLengthPtr--];
				if (size > 0) {
					this.annotation.thrownExceptions = new TypeReference[size];
					for (int i = (size - 1); i >= 0; i--) {
						this.annotation.thrownExceptions[i] = (TypeReference) this.astStack[astPtr--];
					}
				}
			}
			// Finally, finishing with parameters nales (ie. Argument) coming from @param declaration
			else if (this.astLengthPtr == 0) {
				int size = this.astLengthStack[this.astLengthPtr--];
				if (size > 0) {
					this.annotation.parameters = new AnnotationArgument[size];
					for (int i = (size - 1); i >= 0; i--) {
						this.annotation.parameters[i] = (AnnotationArgument) this.astStack[astPtr--];
					}
				}
			}
			// Flag all nodes got from other ast length stack pointer values as invalid....
			// TODO: (frederic) To be changed when mixed tags declaration will be accepted 
			else {
				int size = this.astLengthStack[this.astLengthPtr--];
				if (size > 0) {
					for (int i = 0; i < size; i++) {
						AstNode node = this.astStack[astPtr--];
						this.sourceParser.problemReporter()
								.annotationUnexpectedTag(node.sourceStart,
										node.sourceEnd);
					}
				}
			}
		}
	}
}

Back to the top