mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 17:35:35 +02:00
LocationMap meet IProblem.
This commit is contained in:
parent
65428b9be0
commit
38f71e03c8
1 changed files with 10 additions and 4 deletions
|
@ -10,6 +10,10 @@
|
|||
**********************************************************************/
|
||||
package org.eclipse.cdt.internal.core.parser.scanner2;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.IASTMacroDefinition;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||
import org.eclipse.cdt.core.dom.ast.IASTNodeLocation;
|
||||
|
@ -22,6 +26,8 @@ import org.eclipse.cdt.core.parser.IProblem;
|
|||
*/
|
||||
public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
||||
|
||||
private List problems = Collections.EMPTY_LIST;
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver#getMacroDefinitions()
|
||||
*/
|
||||
|
@ -237,16 +243,16 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
|||
* @see org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver#getScannerProblems()
|
||||
*/
|
||||
public IProblem[] getScannerProblems() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
return (IProblem[]) problems.toArray( new IProblem[ problems.size() ]);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#encounterIProblem(org.eclipse.cdt.core.parser.IProblem)
|
||||
*/
|
||||
public void encounterProblem(IProblem problem) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
if( problems == Collections.EMPTY_LIST )
|
||||
problems = new ArrayList( 4 );
|
||||
problems.add(problem);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue