KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > core > util > RecordedParsingInformation


1 /*******************************************************************************
2  * Copyright (c) 2002, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.core.util;
12
13 import org.eclipse.jdt.core.compiler.CategorizedProblem;
14 import org.eclipse.jdt.internal.compiler.CompilationResult;
15
16 /**
17  * Use to keep track of recorded information during the parsing like comment positions,
18  * line ends or problems.
19  */

20 public class RecordedParsingInformation {
21     public CategorizedProblem[] problems;
22     public int problemsCount;
23     public int[] lineEnds;
24     public int[][] commentPositions;
25     
26     public RecordedParsingInformation(CategorizedProblem[] problems, int[] lineEnds, int[][] commentPositions) {
27         this.problems = problems;
28         this.lineEnds = lineEnds;
29         this.commentPositions = commentPositions;
30         this.problemsCount = problems != null ? problems.length : 0;
31     }
32     
33     void updateRecordedParsingInformation(CompilationResult compilationResult) {
34         if (compilationResult.problems != null) {
35             this.problems = compilationResult.problems;
36             this.problemsCount = this.problems.length;
37         }
38     }
39 }
40
Popular Tags