mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-09 09:15:38 +02:00
Format.
This commit is contained in:
parent
0c4f633ecc
commit
d77e74d43e
4 changed files with 4613 additions and 4394 deletions
File diff suppressed because it is too large
Load diff
|
@ -31,10 +31,12 @@ import org.eclipse.cdt.internal.core.parser.token.SimpleToken;
|
|||
public class DOMScanner extends BaseScanner {
|
||||
|
||||
protected final ICodeReaderFactory codeReaderFactory;
|
||||
|
||||
protected int[] bufferDelta = new int[bufferInitialSize];
|
||||
|
||||
private static class DOMInclusion {
|
||||
public final char[] pt;
|
||||
|
||||
public final int o;
|
||||
|
||||
/**
|
||||
|
@ -57,7 +59,8 @@ public class DOMScanner extends BaseScanner {
|
|||
* @param requestor
|
||||
*/
|
||||
public DOMScanner(CodeReader reader, IScannerInfo info,
|
||||
ParserMode parserMode, ParserLanguage language, IParserLogService log,
|
||||
ParserMode parserMode, ParserLanguage language,
|
||||
IParserLogService log,
|
||||
IScannerExtensionConfiguration configuration,
|
||||
ICodeReaderFactory readerFactory) {
|
||||
super(reader, info, parserMode, language, log, configuration);
|
||||
|
@ -112,10 +115,12 @@ public class DOMScanner extends BaseScanner {
|
|||
int textEnd, int endingLine, IMacro macro) {
|
||||
if (macro instanceof FunctionStyleMacro)
|
||||
locationMap.defineFunctionStyleMacro((FunctionStyleMacro) macro,
|
||||
resolveOffset( startingOffset ), resolveOffset( idstart ), resolveOffset( idend ), resolveOffset( textEnd) );
|
||||
resolveOffset(startingOffset), resolveOffset(idstart),
|
||||
resolveOffset(idend), resolveOffset(textEnd));
|
||||
else if (macro instanceof ObjectStyleMacro)
|
||||
locationMap.defineObjectStyleMacro((ObjectStyleMacro) macro,
|
||||
resolveOffset( startingOffset ), resolveOffset( idstart ), resolveOffset( idend ), resolveOffset( textEnd ) );
|
||||
resolveOffset(startingOffset), resolveOffset(idstart),
|
||||
resolveOffset(idend), resolveOffset(textEnd));
|
||||
|
||||
}
|
||||
|
||||
|
@ -128,7 +133,6 @@ public class DOMScanner extends BaseScanner {
|
|||
return codeReaderFactory.createCodeReaderForInclusion(finalPath);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
@ -136,12 +140,12 @@ public class DOMScanner extends BaseScanner {
|
|||
* java.lang.Object)
|
||||
*/
|
||||
protected void pushContext(char[] buffer, Object data) {
|
||||
if( bufferStackPos + 1 == bufferDelta.length )
|
||||
{
|
||||
if (bufferStackPos + 1 == bufferDelta.length) {
|
||||
int size = bufferDelta.length * 2;
|
||||
int[] oldBufferDelta = bufferDelta;
|
||||
bufferDelta = new int[size];
|
||||
System.arraycopy(oldBufferDelta, 0, bufferDelta, 0, oldBufferDelta.length);
|
||||
System.arraycopy(oldBufferDelta, 0, bufferDelta, 0,
|
||||
oldBufferDelta.length);
|
||||
}
|
||||
|
||||
if (data instanceof InclusionData) {
|
||||
|
@ -153,7 +157,8 @@ public class DOMScanner extends BaseScanner {
|
|||
}
|
||||
|
||||
DOMInclusion inc = ((DOMInclusion) ((InclusionData) data).inclusion);
|
||||
locationMap.startInclusion(((InclusionData)data).reader, inc.o, resolveOffset( getCurrentOffset() ));
|
||||
locationMap.startInclusion(((InclusionData) data).reader, inc.o,
|
||||
resolveOffset(getCurrentOffset()));
|
||||
bufferDelta[bufferStackPos + 1] = 0;
|
||||
}
|
||||
super.pushContext(buffer, data);
|
||||
|
@ -168,7 +173,8 @@ public class DOMScanner extends BaseScanner {
|
|||
//TODO calibrate offsets
|
||||
Object result = super.popContext();
|
||||
if (result instanceof CodeReader) {
|
||||
locationMap.endTranslationUnit( bufferDelta[0] + ((CodeReader)result).buffer.length );
|
||||
locationMap.endTranslationUnit(bufferDelta[0]
|
||||
+ ((CodeReader) result).buffer.length);
|
||||
}
|
||||
if (result instanceof InclusionData) {
|
||||
CodeReader codeReader = ((InclusionData) result).reader;
|
||||
|
@ -178,15 +184,17 @@ public class DOMScanner extends BaseScanner {
|
|||
log.traceLog(buffer.toString());
|
||||
}
|
||||
|
||||
locationMap.endInclusion(getGlobalCounter( bufferStackPos + 1 ) + bufferPos[ bufferStackPos + 1 ]);
|
||||
bufferDelta[ bufferStackPos ] += bufferDelta[ bufferStackPos + 1 ] + codeReader.buffer.length;
|
||||
locationMap.endInclusion(getGlobalCounter(bufferStackPos + 1)
|
||||
+ bufferPos[bufferStackPos + 1]);
|
||||
bufferDelta[bufferStackPos] += bufferDelta[bufferStackPos + 1]
|
||||
+ codeReader.buffer.length;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
protected int getGlobalCounter( int value )
|
||||
{
|
||||
if( value < 0 ) return 0;
|
||||
protected int getGlobalCounter(int value) {
|
||||
if (value < 0)
|
||||
return 0;
|
||||
int result = bufferDelta[value];
|
||||
for (int i = value - 1; i >= 0; --i)
|
||||
result += bufferPos[i] + bufferDelta[i];
|
||||
|
@ -195,8 +203,7 @@ public class DOMScanner extends BaseScanner {
|
|||
|
||||
}
|
||||
|
||||
protected int getGlobalCounter()
|
||||
{
|
||||
protected int getGlobalCounter() {
|
||||
return getGlobalCounter(bufferStackPos);
|
||||
}
|
||||
|
||||
|
@ -217,7 +224,8 @@ public class DOMScanner extends BaseScanner {
|
|||
getLineNumber(bufferPos[mostRelevant] + 1));
|
||||
}
|
||||
return new SimpleToken(signal,
|
||||
resolveOffset(bufferPos[bufferStackPos] + 1), getCurrentFilename(),
|
||||
resolveOffset(bufferPos[bufferStackPos] + 1),
|
||||
getCurrentFilename(),
|
||||
getLineNumber(bufferPos[bufferStackPos] + 1));
|
||||
}
|
||||
|
||||
|
@ -287,64 +295,98 @@ public class DOMScanner extends BaseScanner {
|
|||
locationMap.startTranslationUnit(getMainReader());
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.BaseScanner#processIfdef(int, int, boolean, boolean)
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.BaseScanner#processIfdef(int,
|
||||
* int, boolean, boolean)
|
||||
*/
|
||||
protected void processIfdef(int startPos, int endPos, boolean positive, boolean taken) {
|
||||
protected void processIfdef(int startPos, int endPos, boolean positive,
|
||||
boolean taken) {
|
||||
if (positive)
|
||||
locationMap.encounterPoundIfdef( resolveOffset(startPos), resolveOffset(endPos), taken );
|
||||
locationMap.encounterPoundIfdef(resolveOffset(startPos),
|
||||
resolveOffset(endPos), taken);
|
||||
else
|
||||
locationMap.encounterPoundIfndef( resolveOffset(startPos), resolveOffset(endPos), taken );
|
||||
locationMap.encounterPoundIfndef(resolveOffset(startPos),
|
||||
resolveOffset(endPos), taken);
|
||||
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.BaseScanner#processIf(int, int, boolean)
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.BaseScanner#processIf(int,
|
||||
* int, boolean)
|
||||
*/
|
||||
protected void processIf(int startPos, int endPos, boolean taken) {
|
||||
locationMap.encounterPoundIf( resolveOffset( startPos ), resolveOffset( endPos ), taken );
|
||||
locationMap.encounterPoundIf(resolveOffset(startPos),
|
||||
resolveOffset(endPos), taken);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.BaseScanner#processElsif(int, int, boolean)
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.BaseScanner#processElsif(int,
|
||||
* int, boolean)
|
||||
*/
|
||||
protected void processElsif(int startPos, int endPos, boolean taken) {
|
||||
locationMap.encounterPoundElif( resolveOffset( startPos ), resolveOffset( endPos ), taken );
|
||||
locationMap.encounterPoundElif(resolveOffset(startPos),
|
||||
resolveOffset(endPos), taken);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.BaseScanner#processElse(int, int, boolean)
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.BaseScanner#processElse(int,
|
||||
* int, boolean)
|
||||
*/
|
||||
protected void processElse(int startPos, int endPos, boolean taken) {
|
||||
locationMap.encounterPoundElse( resolveOffset( startPos ), resolveOffset( endPos ), taken );
|
||||
locationMap.encounterPoundElse(resolveOffset(startPos),
|
||||
resolveOffset(endPos), taken);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.BaseScanner#processUndef(int, int)
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.BaseScanner#processUndef(int,
|
||||
* int)
|
||||
*/
|
||||
protected void processUndef(int pos, int endPos) {
|
||||
locationMap.encounterPoundUndef( resolveOffset( pos ), resolveOffset( endPos ));
|
||||
locationMap.encounterPoundUndef(resolveOffset(pos),
|
||||
resolveOffset(endPos));
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.BaseScanner#processError(int, int)
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.BaseScanner#processError(int,
|
||||
* int)
|
||||
*/
|
||||
protected void processError(int startPos, int endPos) {
|
||||
locationMap.encounterPoundError( resolveOffset( startPos), resolveOffset( endPos ));
|
||||
locationMap.encounterPoundError(resolveOffset(startPos),
|
||||
resolveOffset(endPos));
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.BaseScanner#processEndif(int, int)
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.BaseScanner#processEndif(int,
|
||||
* int)
|
||||
*/
|
||||
protected void processEndif(int startPos, int endPos) {
|
||||
locationMap.encounterPoundEndIf( resolveOffset( startPos ), resolveOffset( endPos ));
|
||||
locationMap.encounterPoundEndIf(resolveOffset(startPos),
|
||||
resolveOffset(endPos));
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.BaseScanner#processPragma(int, int)
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.cdt.internal.core.parser.scanner2.BaseScanner#processPragma(int,
|
||||
* int)
|
||||
*/
|
||||
protected void processPragma(int startPos, int endPos) {
|
||||
locationMap.encounterPoundPragma( resolveOffset( startPos ), resolveOffset(endPos));
|
||||
locationMap.encounterPoundPragma(resolveOffset(startPos),
|
||||
resolveOffset(endPos));
|
||||
}
|
||||
|
||||
}
|
|
@ -19,32 +19,47 @@ import org.eclipse.cdt.core.parser.CodeReader;
|
|||
public interface IScannerPreprocessorLog {
|
||||
|
||||
public void startTranslationUnit(CodeReader tu_reader);
|
||||
|
||||
public void endTranslationUnit(int offset);
|
||||
|
||||
public void startInclusion(CodeReader reader, int offset, int endOffset);
|
||||
|
||||
public void endInclusion(int offset);
|
||||
|
||||
public void enterObjectStyleMacroExpansion(char[] name, char[] expansion,
|
||||
int offset);
|
||||
|
||||
public void exitObjectStyleMacroExpansion(char[] name, int offset);
|
||||
|
||||
public void enterFunctionStyleExpansion(char[] name, char[][] parameters,
|
||||
char[] expansion, int offset);
|
||||
|
||||
public void exitFunctionStyleExpansion(char[] name, int offset);
|
||||
|
||||
public void defineObjectStyleMacro(ObjectStyleMacro m, int startOffset,
|
||||
int nameOffset, int nameEndOffset, int endOffset);
|
||||
|
||||
public void defineFunctionStyleMacro(FunctionStyleMacro m, int startOffset,
|
||||
int nameOffset, int nameEndOffset, int endOffset);
|
||||
|
||||
public void encounterPoundIf(int startOffset, int endOffset, boolean taken);
|
||||
public void encounterPoundIfdef(int startOffset, int endOffset, boolean taken);
|
||||
public void encounterPoundIfndef( int startOffset, int endOffset, boolean taken );
|
||||
|
||||
public void encounterPoundIfdef(int startOffset, int endOffset,
|
||||
boolean taken);
|
||||
|
||||
public void encounterPoundIfndef(int startOffset, int endOffset,
|
||||
boolean taken);
|
||||
|
||||
public void encounterPoundElse(int startOffset, int endOffset, boolean taken);
|
||||
|
||||
public void encounterPoundElif(int startOffset, int endOffset, boolean taken);
|
||||
|
||||
public void encounterPoundEndIf(int startOffset, int endOffset);
|
||||
|
||||
public void encounterPoundPragma(int startOffset, int endOffset);
|
||||
|
||||
public void encounterPoundError(int startOffset, int endOffset);
|
||||
|
||||
public void encounterPoundUndef(int startOffset, int endOffset);
|
||||
|
||||
public void encounterProblem(IASTProblem problem);
|
||||
|
|
|
@ -53,6 +53,7 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
|||
IASTPreprocessorEndifStatement {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @author jcamelon
|
||||
*/
|
||||
|
@ -60,12 +61,16 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
|||
IASTPreprocessorElifStatement {
|
||||
|
||||
private final boolean taken;
|
||||
/* (non-Javadoc)
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTPreprocessorElifStatement#taken()
|
||||
*/
|
||||
public boolean taken() {
|
||||
return taken;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param taken
|
||||
*/
|
||||
|
@ -74,13 +79,17 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @author jcamelon
|
||||
*/
|
||||
static class ASTElse extends ScannerASTNode implements
|
||||
IASTPreprocessorElseStatement {
|
||||
private final boolean taken;
|
||||
/* (non-Javadoc)
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTPreprocessorElifStatement#taken()
|
||||
*/
|
||||
public boolean taken() {
|
||||
|
@ -95,20 +104,24 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @author jcamelon
|
||||
*/
|
||||
static class ASTIfndef extends ScannerASTNode implements IASTPreprocessorIfndefStatement {
|
||||
static class ASTIfndef extends ScannerASTNode implements
|
||||
IASTPreprocessorIfndefStatement {
|
||||
|
||||
private final boolean taken;
|
||||
/* (non-Javadoc)
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTPreprocessorElifStatement#taken()
|
||||
*/
|
||||
public boolean taken() {
|
||||
return taken;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param taken
|
||||
*/
|
||||
|
@ -117,6 +130,7 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @author jcamelon
|
||||
*/
|
||||
|
@ -124,7 +138,10 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
|||
IASTPreprocessorIfdefStatement {
|
||||
|
||||
private final boolean taken;
|
||||
/* (non-Javadoc)
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTPreprocessorElifStatement#taken()
|
||||
*/
|
||||
public boolean taken() {
|
||||
|
@ -139,6 +156,7 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @author jcamelon
|
||||
*/
|
||||
|
@ -146,7 +164,10 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
|||
IASTPreprocessorIfStatement {
|
||||
|
||||
private final boolean taken;
|
||||
/* (non-Javadoc)
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.cdt.core.dom.ast.IASTPreprocessorElifStatement#taken()
|
||||
*/
|
||||
public boolean taken() {
|
||||
|
@ -161,6 +182,7 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @author jcamelon
|
||||
*/
|
||||
|
@ -168,6 +190,7 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
|||
IASTPreprocessorErrorStatement {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @author jcamelon
|
||||
*/
|
||||
|
@ -175,6 +198,7 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
|||
IASTPreprocessorPragmaStatement {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @author jcamelon
|
||||
*/
|
||||
|
@ -182,6 +206,7 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
|||
IASTPreprocessorUndefStatement {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @author jcamelon
|
||||
*/
|
||||
|
@ -886,9 +911,13 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
|||
}
|
||||
|
||||
private static final IASTProblem[] EMPTY_PROBLEMS_ARRAY = new IASTProblem[0];
|
||||
|
||||
private static final IASTNodeLocation[] EMPTY_LOCATION_ARRAY = new IASTNodeLocation[0];
|
||||
|
||||
private static final IASTPreprocessorMacroDefinition[] EMPTY_MACRO_DEFINITIONS_ARRAY = new IASTPreprocessorMacroDefinition[0];
|
||||
|
||||
private static final IASTPreprocessorIncludeStatement[] EMPTY_INCLUDES_ARRAY = new IASTPreprocessorIncludeStatement[0];
|
||||
|
||||
private static final IASTPreprocessorStatement[] EMPTY_PREPROCESSOR_ARRAY = new IASTPreprocessorStatement[0];
|
||||
|
||||
/*
|
||||
|
@ -969,8 +998,9 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
|||
private IASTPreprocessorIncludeStatement createASTInclusion(_Inclusion inc) {
|
||||
IASTPreprocessorIncludeStatement result = new ASTInclusionStatement(
|
||||
inc.reader.filename);
|
||||
((ScannerASTNode) result).setOffsetAndLength(inc.context_directive_start,
|
||||
inc.context_directive_end - inc.context_directive_start);
|
||||
((ScannerASTNode) result).setOffsetAndLength(
|
||||
inc.context_directive_start, inc.context_directive_end
|
||||
- inc.context_directive_start);
|
||||
((ASTInclusionStatement) result).startOffset = inc.context_directive_end;
|
||||
((ASTInclusionStatement) result).endOffset = inc.context_ends;
|
||||
return result;
|
||||
|
@ -988,8 +1018,7 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
|||
_Context[] contexts = new _Context[size];
|
||||
collectContexts(V_PREPROCESSOR, tu, contexts, 0);
|
||||
IASTPreprocessorStatement[] result = new IASTPreprocessorStatement[size];
|
||||
for (int i = 0; i < size; ++i)
|
||||
{
|
||||
for (int i = 0; i < size; ++i) {
|
||||
if (contexts[i] instanceof _Inclusion)
|
||||
result[i] = createASTInclusion(((_Inclusion) contexts[i]));
|
||||
else if (contexts[i] instanceof _MacroDefinition)
|
||||
|
@ -1023,7 +1052,8 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
|||
*/
|
||||
private IASTPreprocessorStatement createASTEndif(_Endif endif) {
|
||||
IASTPreprocessorEndifStatement result = new ASTEndif();
|
||||
((ASTNode)result).setOffsetAndLength( endif.context_directive_start, endif.context_directive_end - endif.context_directive_start );
|
||||
((ASTNode) result).setOffsetAndLength(endif.context_directive_start,
|
||||
endif.context_directive_end - endif.context_directive_start);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1033,7 +1063,8 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
|||
*/
|
||||
private IASTPreprocessorStatement createASTElif(_Elif elif) {
|
||||
IASTPreprocessorElifStatement result = new ASTElif(elif.taken);
|
||||
((ASTNode)result).setOffsetAndLength( elif.context_directive_start, elif.context_directive_end - elif.context_directive_start);
|
||||
((ASTNode) result).setOffsetAndLength(elif.context_directive_start,
|
||||
elif.context_directive_end - elif.context_directive_start);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1043,7 +1074,8 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
|||
*/
|
||||
private IASTPreprocessorStatement createASTElse(_Else e) {
|
||||
IASTPreprocessorElseStatement result = new ASTElse(e.taken);
|
||||
((ASTNode)result).setOffsetAndLength( e.context_directive_start, e.context_directive_end- e.context_directive_start );
|
||||
((ASTNode) result).setOffsetAndLength(e.context_directive_start,
|
||||
e.context_directive_end - e.context_directive_start);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1053,7 +1085,8 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
|||
*/
|
||||
private IASTPreprocessorStatement createASTIfndef(_Ifndef ifndef) {
|
||||
IASTPreprocessorIfndefStatement result = new ASTIfndef(ifndef.taken);
|
||||
((ASTNode)result).setOffsetAndLength( ifndef.context_directive_start, ifndef.context_directive_end - ifndef.context_directive_start );
|
||||
((ASTNode) result).setOffsetAndLength(ifndef.context_directive_start,
|
||||
ifndef.context_directive_end - ifndef.context_directive_start);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1063,7 +1096,8 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
|||
*/
|
||||
private IASTPreprocessorStatement createASTIfdef(_Ifdef ifdef) {
|
||||
IASTPreprocessorIfdefStatement result = new ASTIfdef(ifdef.taken);
|
||||
((ASTNode)result).setOffsetAndLength( ifdef.context_directive_start, ifdef.context_directive_end - ifdef.context_directive_start);
|
||||
((ASTNode) result).setOffsetAndLength(ifdef.context_directive_start,
|
||||
ifdef.context_directive_end - ifdef.context_directive_start);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1073,7 +1107,8 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
|||
*/
|
||||
private IASTPreprocessorStatement createASTIf(_If i) {
|
||||
IASTPreprocessorIfStatement result = new ASTIf(i.taken);
|
||||
((ASTNode)result).setOffsetAndLength( i.context_directive_start, i.context_directive_end - - i.context_directive_start );
|
||||
((ASTNode) result).setOffsetAndLength(i.context_directive_start,
|
||||
i.context_directive_end - -i.context_directive_start);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1083,7 +1118,8 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
|||
*/
|
||||
private IASTPreprocessorStatement createASTError(_Error error) {
|
||||
IASTPreprocessorErrorStatement result = new ASTError();
|
||||
((ASTNode)result).setOffsetAndLength( error.context_directive_start, error.context_directive_end - error.context_directive_start);
|
||||
((ASTNode) result).setOffsetAndLength(error.context_directive_start,
|
||||
error.context_directive_end - error.context_directive_start);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1102,7 +1138,8 @@ public class LocationMap implements ILocationResolver, IScannerPreprocessorLog {
|
|||
*/
|
||||
private IASTPreprocessorStatement createASTUndef(_Undef undef) {
|
||||
IASTPreprocessorUndefStatement result = new ASTUndef();
|
||||
((ASTNode)result).setOffsetAndLength( undef.context_directive_start, undef.context_directive_end - undef.context_directive_start );
|
||||
((ASTNode) result).setOffsetAndLength(undef.context_directive_start,
|
||||
undef.context_directive_end - undef.context_directive_start);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue