mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Slow road for IASTNodeLocation.
This commit is contained in:
parent
8d0a12de55
commit
9e365df5f5
6 changed files with 4840 additions and 4555 deletions
|
@ -11,23 +11,27 @@
|
||||||
package org.eclipse.cdt.core.parser.tests.ast2;
|
package org.eclipse.cdt.core.parser.tests.ast2;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTFileLocation;
|
import org.eclipse.cdt.core.dom.ast.IASTFileLocation;
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTNodeLocation;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
|
||||||
import org.eclipse.cdt.core.parser.ParserLanguage;
|
import org.eclipse.cdt.core.parser.ParserLanguage;
|
||||||
import org.eclipse.cdt.internal.core.parser.ParserException;
|
import org.eclipse.cdt.internal.core.parser.ParserException;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author jcamelon
|
* @author jcamelon
|
||||||
*/
|
*/
|
||||||
public class DOMScannerTests extends AST2BaseTest {
|
public class DOMScannerTests extends AST2BaseTest {
|
||||||
|
|
||||||
|
public void testSimpleLocation() throws ParserException {
|
||||||
|
IASTTranslationUnit tu = parse("int x;", ParserLanguage.C); //$NON-NLS-1$
|
||||||
|
IASTNodeLocation[] nodeLocations = tu.getDeclarations()[0]
|
||||||
|
.getNodeLocations();
|
||||||
|
assertNotNull(nodeLocations);
|
||||||
|
assertEquals(nodeLocations.length, 1);
|
||||||
|
assertTrue(nodeLocations[0] instanceof IASTFileLocation);
|
||||||
|
IASTFileLocation fileLocation = ((IASTFileLocation) nodeLocations[0]);
|
||||||
|
assertEquals(fileLocation.getFileName(), "<text>"); //$NON-NLS-1$
|
||||||
|
assertEquals(fileLocation.getNodeOffset(), 0);
|
||||||
|
assertEquals(fileLocation.getNodeLength(), 6);
|
||||||
|
}
|
||||||
|
|
||||||
public void testSimpleLocation() throws ParserException {
|
}
|
||||||
IASTTranslationUnit tu = parse( "int x;", ParserLanguage.C ); //$NON-NLS-1$
|
|
||||||
assertEquals( tu.getDeclarations()[0].getNodeLocations().length, 1 );
|
|
||||||
assertTrue( tu.getDeclarations()[0].getNodeLocations()[0] instanceof IASTFileLocation );
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -26,7 +26,6 @@ import org.eclipse.cdt.core.parser.util.CharArrayUtils;
|
||||||
*/
|
*/
|
||||||
public class CodeReader {
|
public class CodeReader {
|
||||||
public static final String SYSTEM_DEFAULT_ENCODING = System.getProperty( "file.encoding" ); //$NON-NLS-1$
|
public static final String SYSTEM_DEFAULT_ENCODING = System.getProperty( "file.encoding" ); //$NON-NLS-1$
|
||||||
//private static final String UTF_8 = "UTF-8"; //$NON-NLS-1$
|
|
||||||
private static final String NF = "<text>"; //$NON-NLS-1$
|
private static final String NF = "<text>"; //$NON-NLS-1$
|
||||||
private static final char [] NOFILE = NF.toCharArray(); //$NON-NLS-1$
|
private static final char [] NOFILE = NF.toCharArray(); //$NON-NLS-1$
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -14,6 +14,7 @@ package org.eclipse.cdt.internal.core.parser.scanner2;
|
||||||
import org.eclipse.cdt.core.dom.ICodeReaderFactory;
|
import org.eclipse.cdt.core.dom.ICodeReaderFactory;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTProblem;
|
import org.eclipse.cdt.core.dom.ast.IASTProblem;
|
||||||
import org.eclipse.cdt.core.parser.CodeReader;
|
import org.eclipse.cdt.core.parser.CodeReader;
|
||||||
|
import org.eclipse.cdt.core.parser.EndOfFileException;
|
||||||
import org.eclipse.cdt.core.parser.IMacro;
|
import org.eclipse.cdt.core.parser.IMacro;
|
||||||
import org.eclipse.cdt.core.parser.IParserLogService;
|
import org.eclipse.cdt.core.parser.IParserLogService;
|
||||||
import org.eclipse.cdt.core.parser.IScannerInfo;
|
import org.eclipse.cdt.core.parser.IScannerInfo;
|
||||||
|
@ -218,4 +219,22 @@ public class DOMScanner extends BaseScanner {
|
||||||
return contextStart + offset;
|
return contextStart + offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.BaseScanner#postConstructorSetup(org.eclipse.cdt.core.parser.CodeReader, org.eclipse.cdt.core.parser.IScannerInfo)
|
||||||
|
*/
|
||||||
|
protected void postConstructorSetup(CodeReader reader, IScannerInfo info) {
|
||||||
|
super.postConstructorSetup(reader, info);
|
||||||
|
locationMap.startTranslationUnit( getMainFilename() );
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.BaseScanner#throwEOF()
|
||||||
|
*/
|
||||||
|
protected void throwEOF() throws EndOfFileException {
|
||||||
|
locationMap.endTranslationUnit( preprocessedOffset );
|
||||||
|
super.throwEOF();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected int preprocessedOffset = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,8 @@ import org.eclipse.cdt.core.dom.ast.IASTProblem;
|
||||||
*/
|
*/
|
||||||
public interface IScannerPreprocessorLog {
|
public interface IScannerPreprocessorLog {
|
||||||
|
|
||||||
public void endTranslationUnit(int finalOffset);
|
public void startTranslationUnit( char [] filename );
|
||||||
|
public void endTranslationUnit(int offset);
|
||||||
|
|
||||||
public void startInclusion(char[] includePath, int offset);
|
public void startInclusion(char[] includePath, int offset);
|
||||||
|
|
||||||
|
|
|
@ -26,239 +26,319 @@ import org.eclipse.cdt.core.dom.ast.IASTProblem;
|
||||||
*/
|
*/
|
||||||
public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
||||||
|
|
||||||
private List problems = Collections.EMPTY_LIST;
|
private static final char [] EMPTY_CHAR_ARRAY = "".toCharArray(); //$NON-NLS-1$
|
||||||
private static final IASTProblem[] EMPTY_PROBLEMS_ARRAY = new IASTProblem[0];
|
private List problems = Collections.EMPTY_LIST;
|
||||||
/**
|
private static final IASTProblem[] EMPTY_PROBLEMS_ARRAY = new IASTProblem[0];
|
||||||
*
|
private static final IASTNodeLocation [] EMPTY_LOCATION_ARRAY = new IASTNodeLocation[0];
|
||||||
*/
|
private char[] tu_filename = EMPTY_CHAR_ARRAY ;
|
||||||
public LocationMap() {
|
private int finalOffset = 0;
|
||||||
startTranslationUnit();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/**
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver#getMacroDefinitions()
|
*
|
||||||
*/
|
*/
|
||||||
public IASTMacroDefinition[] getMacroDefinitions(IASTNode parent) {
|
public LocationMap() {
|
||||||
// TODO Auto-generated method stub
|
}
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver#getIncludeDirectives()
|
* (non-Javadoc)
|
||||||
*/
|
*
|
||||||
public IASTPreprocessorIncludeStatement[] getIncludeDirectives(IASTNode newParam) {
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver#getMacroDefinitions()
|
||||||
// TODO Auto-generated method stub
|
*/
|
||||||
return null;
|
public IASTMacroDefinition[] getMacroDefinitions(IASTNode parent) {
|
||||||
}
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver#getAllPreprocessorStatements()
|
* (non-Javadoc)
|
||||||
*/
|
*
|
||||||
public IASTPreprocessorStatement[] getAllPreprocessorStatements(IASTNode newParam) {
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver#getIncludeDirectives()
|
||||||
// TODO Auto-generated method stub
|
*/
|
||||||
return null;
|
public IASTPreprocessorIncludeStatement[] getIncludeDirectives(
|
||||||
}
|
IASTNode newParam) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver#getLocations(int, int)
|
* (non-Javadoc)
|
||||||
*/
|
*
|
||||||
public IASTNodeLocation[] getLocations(int offset, int length) {
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver#getAllPreprocessorStatements()
|
||||||
// TODO Auto-generated method stub
|
*/
|
||||||
return null;
|
public IASTPreprocessorStatement[] getAllPreprocessorStatements(
|
||||||
}
|
IASTNode newParam) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver#getLocation(int)
|
* (non-Javadoc)
|
||||||
*/
|
*
|
||||||
public IASTNodeLocation getLocation(int offset) {
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver#getLocations(int,
|
||||||
// TODO Auto-generated method stub
|
* int)
|
||||||
return null;
|
*/
|
||||||
}
|
public IASTNodeLocation[] getLocations(int offset, int length) {
|
||||||
|
if( tu_filename == EMPTY_CHAR_ARRAY ) return EMPTY_LOCATION_ARRAY;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#startTranslationUnit()
|
* (non-Javadoc)
|
||||||
*/
|
*
|
||||||
protected void startTranslationUnit() {
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver#getLocation(int)
|
||||||
}
|
*/
|
||||||
|
public IASTNodeLocation getLocation(int offset) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#endTranslationUnit(int)
|
* (non-Javadoc)
|
||||||
*/
|
*
|
||||||
public void endTranslationUnit(int finalOffset) {
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#startTranslationUnit()
|
||||||
// TODO Auto-generated method stub
|
*/
|
||||||
|
public void startTranslationUnit(char[] filename) {
|
||||||
|
this.tu_filename = filename;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#endTranslationUnit(int)
|
||||||
|
*/
|
||||||
|
public void endTranslationUnit(int offset) {
|
||||||
|
this.finalOffset = offset;
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#startInclusion(char[], int)
|
* (non-Javadoc)
|
||||||
*/
|
*
|
||||||
public void startInclusion(char[] includePath, int offset) {
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#startInclusion(char[],
|
||||||
// TODO Auto-generated method stub
|
* int)
|
||||||
|
*/
|
||||||
|
public void startInclusion(char[] includePath, int offset) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#endInclusion(char[], int)
|
* (non-Javadoc)
|
||||||
*/
|
*
|
||||||
public void endInclusion(char[] includePath, int offset) {
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#endInclusion(char[],
|
||||||
// TODO Auto-generated method stub
|
* int)
|
||||||
|
*/
|
||||||
|
public void endInclusion(char[] includePath, int offset) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#enterObjectStyleMacroExpansion(char[], char[], int)
|
* (non-Javadoc)
|
||||||
*/
|
*
|
||||||
public void enterObjectStyleMacroExpansion(char[] name, char[] expansion,
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#enterObjectStyleMacroExpansion(char[],
|
||||||
int offset) {
|
* char[], int)
|
||||||
// TODO Auto-generated method stub
|
*/
|
||||||
|
public void enterObjectStyleMacroExpansion(char[] name, char[] expansion,
|
||||||
|
int offset) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#exitObjectStyleMacroExpansion(char[], int)
|
* (non-Javadoc)
|
||||||
*/
|
*
|
||||||
public void exitObjectStyleMacroExpansion(char[] name, int offset) {
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#exitObjectStyleMacroExpansion(char[],
|
||||||
// TODO Auto-generated method stub
|
* int)
|
||||||
|
*/
|
||||||
|
public void exitObjectStyleMacroExpansion(char[] name, int offset) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#enterFunctionStyleExpansion(char[], char[][], char[], int)
|
* (non-Javadoc)
|
||||||
*/
|
*
|
||||||
public void enterFunctionStyleExpansion(char[] name, char[][] parameters,
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#enterFunctionStyleExpansion(char[],
|
||||||
char[] expansion, int offset) {
|
* char[][], char[], int)
|
||||||
// TODO Auto-generated method stub
|
*/
|
||||||
|
public void enterFunctionStyleExpansion(char[] name, char[][] parameters,
|
||||||
|
char[] expansion, int offset) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#exitFunctionStyleExpansion(char[], int)
|
* (non-Javadoc)
|
||||||
*/
|
*
|
||||||
public void exitFunctionStyleExpansion(char[] name, int offset) {
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#exitFunctionStyleExpansion(char[],
|
||||||
// TODO Auto-generated method stub
|
* int)
|
||||||
|
*/
|
||||||
|
public void exitFunctionStyleExpansion(char[] name, int offset) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#defineObjectStyleMacro(org.eclipse.cdt.internal.core.parser.scanner2.ObjectStyleMacro, int, int, int, int)
|
* (non-Javadoc)
|
||||||
*/
|
*
|
||||||
public void defineObjectStyleMacro(ObjectStyleMacro m, int startOffset,
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#defineObjectStyleMacro(org.eclipse.cdt.internal.core.parser.scanner2.ObjectStyleMacro,
|
||||||
int nameOffset, int nameEndOffset, int endOffset) {
|
* int, int, int, int)
|
||||||
// TODO Auto-generated method stub
|
*/
|
||||||
|
public void defineObjectStyleMacro(ObjectStyleMacro m, int startOffset,
|
||||||
|
int nameOffset, int nameEndOffset, int endOffset) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#defineFunctionStyleMacro(org.eclipse.cdt.internal.core.parser.scanner2.FunctionStyleMacro, int, int, int, int)
|
* (non-Javadoc)
|
||||||
*/
|
*
|
||||||
public void defineFunctionStyleMacro(FunctionStyleMacro m, int startOffset,
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#defineFunctionStyleMacro(org.eclipse.cdt.internal.core.parser.scanner2.FunctionStyleMacro,
|
||||||
int nameOffset, int nameEndOffset, int endOffset) {
|
* int, int, int, int)
|
||||||
// TODO Auto-generated method stub
|
*/
|
||||||
|
public void defineFunctionStyleMacro(FunctionStyleMacro m, int startOffset,
|
||||||
|
int nameOffset, int nameEndOffset, int endOffset) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#encounterPoundIf(int, int)
|
* (non-Javadoc)
|
||||||
*/
|
*
|
||||||
public void encounterPoundIf(int startOffset, int endOffset) {
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#encounterPoundIf(int,
|
||||||
// TODO Auto-generated method stub
|
* int)
|
||||||
|
*/
|
||||||
}
|
public void encounterPoundIf(int startOffset, int endOffset) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
/* (non-Javadoc)
|
}
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#encounterPoundPragma(int, int)
|
|
||||||
*/
|
|
||||||
public void encounterPoundPragma(int startOffset, int endOffset) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#encounterPoundError(int, int)
|
* (non-Javadoc)
|
||||||
*/
|
*
|
||||||
public void encounterPoundError(int startOffset, int endOffset) {
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#encounterPoundPragma(int,
|
||||||
// TODO Auto-generated method stub
|
* int)
|
||||||
|
*/
|
||||||
}
|
public void encounterPoundPragma(int startOffset, int endOffset) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
/* (non-Javadoc)
|
}
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#encounterPoundIfdef(int, int)
|
|
||||||
*/
|
|
||||||
public void encounterPoundIfdef(int startOffset, int endOffset) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#encounterPoundUndef(int, int)
|
* (non-Javadoc)
|
||||||
*/
|
*
|
||||||
public void encounterPoundUndef(int startOffset, int endOffset) {
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#encounterPoundError(int,
|
||||||
// TODO Auto-generated method stub
|
* int)
|
||||||
|
*/
|
||||||
}
|
public void encounterPoundError(int startOffset, int endOffset) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
/* (non-Javadoc)
|
}
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#encounterPoundElse(int, int)
|
|
||||||
*/
|
|
||||||
public void encounterPoundElse(int startOffset, int endOffset) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#encounterPoundElif(int, int)
|
* (non-Javadoc)
|
||||||
*/
|
*
|
||||||
public void encounterPoundElif(int startOffset, int endOffset) {
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#encounterPoundIfdef(int,
|
||||||
// TODO Auto-generated method stub
|
* int)
|
||||||
|
*/
|
||||||
}
|
public void encounterPoundIfdef(int startOffset, int endOffset) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
/* (non-Javadoc)
|
}
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#encounterPoundEndIf(int, int)
|
|
||||||
*/
|
|
||||||
public void encounterPoundEndIf(int startOffset, int endOffset) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver#getTranslationUnitPath()
|
* (non-Javadoc)
|
||||||
*/
|
*
|
||||||
public String getTranslationUnitPath() {
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#encounterPoundUndef(int,
|
||||||
// TODO Auto-generated method stub
|
* int)
|
||||||
return null;
|
*/
|
||||||
}
|
public void encounterPoundUndef(int startOffset, int endOffset) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
/* (non-Javadoc)
|
}
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver#getInclusionsPaths()
|
|
||||||
*/
|
|
||||||
public String[] getInclusionsPaths() {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver#cleanup()
|
* (non-Javadoc)
|
||||||
*/
|
*
|
||||||
public void cleanup() {
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#encounterPoundElse(int,
|
||||||
// TODO Auto-generated method stub
|
* int)
|
||||||
}
|
*/
|
||||||
|
public void encounterPoundElse(int startOffset, int endOffset) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
/* (non-Javadoc)
|
}
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver#getScannerProblems()
|
|
||||||
*/
|
|
||||||
public IASTProblem[] getScannerProblems() {
|
|
||||||
if( problems == Collections.EMPTY_LIST ) return EMPTY_PROBLEMS_ARRAY;
|
|
||||||
return (IASTProblem[]) problems.toArray( new IASTProblem[ problems.size() ]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/*
|
||||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#encounterIProblem(org.eclipse.cdt.core.parser.IProblem)
|
* (non-Javadoc)
|
||||||
*/
|
*
|
||||||
public void encounterProblem(IASTProblem problem) {
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#encounterPoundElif(int,
|
||||||
if( problems == Collections.EMPTY_LIST )
|
* int)
|
||||||
problems = new ArrayList( 4 );
|
*/
|
||||||
problems.add(problem);
|
public void encounterPoundElif(int startOffset, int endOffset) {
|
||||||
}
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#encounterPoundEndIf(int,
|
||||||
|
* int)
|
||||||
|
*/
|
||||||
|
public void encounterPoundEndIf(int startOffset, int endOffset) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver#getTranslationUnitPath()
|
||||||
|
*/
|
||||||
|
public String getTranslationUnitPath() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver#getInclusionsPaths()
|
||||||
|
*/
|
||||||
|
public String[] getInclusionsPaths() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver#cleanup()
|
||||||
|
*/
|
||||||
|
public void cleanup() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.ILocationResolver#getScannerProblems()
|
||||||
|
*/
|
||||||
|
public IASTProblem[] getScannerProblems() {
|
||||||
|
if (problems == Collections.EMPTY_LIST)
|
||||||
|
return EMPTY_PROBLEMS_ARRAY;
|
||||||
|
return (IASTProblem[]) problems.toArray(new IASTProblem[problems.size()]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see org.eclipse.cdt.internal.core.parser.scanner2.IScannerPreprocessorLog#encounterIProblem(org.eclipse.cdt.core.parser.IProblem)
|
||||||
|
*/
|
||||||
|
public void encounterProblem(IASTProblem problem) {
|
||||||
|
if (problems == Collections.EMPTY_LIST)
|
||||||
|
problems = new ArrayList(4);
|
||||||
|
problems.add(problem);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue