[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-patch] patch for IProblems with invalid offset/filename
|
[FIXED][77379][IProblems][line: -1]
IProblem with line: -1 in basic_string.tcc (template related?)
[FIXED][77382][IProblems][line: -1]
'this->' in basic_string.tcc has invalid IProblem
[FIXED][77389][IProblems] no filename
associated with IProblem (ambiguity encountered during lookup)
[FIXED][77390][IProblems] no filename
associated with IProblem (Invalid arithmetic conversion in file)
[FIXED][77391][IProblems] no filename/message
associated with IProblem in list.tcc
Aside from these bugs that were specifically
raised, there are no longer IProblems reported for the trilogy/cpp_headers
tests that have offsets=-1 and filename="".
Devin Steffler
IBM's Eclipse CDT
Ottawa (Palladium), Ontario, Canada
Index: parser/org/eclipse/cdt/core/parser/ast/IASTExpression.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTExpression.java,v
retrieving revision 1.24
diff -u -r1.24 IASTExpression.java
--- parser/org/eclipse/cdt/core/parser/ast/IASTExpression.java 7 Sep 2004 18:56:39 -0000 1.24
+++ parser/org/eclipse/cdt/core/parser/ast/IASTExpression.java 5 Nov 2004 16:19:36 -0000
@@ -20,7 +20,7 @@
* @author jcamelon
*
*/
-public interface IASTExpression extends ISourceElementCallbackDelegate, IASTNode
+public interface IASTExpression extends ISourceElementCallbackDelegate, IASTNode, IASTOffsetableElement
{
public class Kind extends Enum
{
Index: parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java,v
retrieving revision 1.73
diff -u -r1.73 IASTFactory.java
--- parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java 7 Sep 2004 18:56:39 -0000 1.73
+++ parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java 5 Nov 2004 16:19:36 -0000
@@ -118,7 +118,7 @@
IASTExpression rhs,
IASTExpression thirdExpression,
IASTTypeId typeId,
- ITokenDuple idExpression, char[] literal, IASTNewExpressionDescriptor newDescriptor) throws ASTSemanticException;
+ ITokenDuple idExpression, char[] literal, IASTNewExpressionDescriptor newDescriptor, ITokenDuple extra) throws ASTSemanticException;
public IASTExpression.IASTNewExpressionDescriptor createNewDescriptor(List newPlacementExpressions,List newTypeIdExpressions,List newInitializerExpressions);
Index: parser/org/eclipse/cdt/internal/core/parser/GCCParserExtension.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/GCCParserExtension.java,v
retrieving revision 1.11
diff -u -r1.11 GCCParserExtension.java
--- parser/org/eclipse/cdt/internal/core/parser/GCCParserExtension.java 13 Oct 2004 14:13:27 -0000 1.11
+++ parser/org/eclipse/cdt/internal/core/parser/GCCParserExtension.java 5 Nov 2004 16:19:36 -0000
@@ -171,7 +171,7 @@
null,
null,
d,
- null, EMPTY_STRING, null);
+ null, EMPTY_STRING, null, null);
}
catch (ASTSemanticException e)
{
@@ -199,7 +199,7 @@
null,
null,
null,
- null, EMPTY_STRING, null);
+ null, EMPTY_STRING, null, null);
}
catch (ASTSemanticException e1)
{
@@ -374,7 +374,7 @@
try {
IASTExpression resultExpression = data.getAstFactory().createExpression(
- scope, expressionKind, lhsExpression, secondExpression, null, null, null, EMPTY_STRING, null );
+ scope, expressionKind, lhsExpression, secondExpression, null, null, null, EMPTY_STRING, null, null );
return resultExpression;
} catch (ASTSemanticException e1) {
data.backup( mark );
Index: parser/org/eclipse/cdt/internal/core/parser/Parser.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java,v
retrieving revision 1.264
diff -u -r1.264 Parser.java
--- parser/org/eclipse/cdt/internal/core/parser/Parser.java 21 Oct 2004 16:15:45 -0000 1.264
+++ parser/org/eclipse/cdt/internal/core/parser/Parser.java 5 Nov 2004 16:19:37 -0000
@@ -371,7 +371,7 @@
expression = astFactory.createExpression(scope,
IASTExpression.Kind.POSTFIX_TYPEID_TYPEID, null, null,
- null, typeId, null, EMPTY_STRING, null);
+ null, typeId, null, EMPTY_STRING, null, null);
list.add(expression);
completedArg = true;
} catch (BacktrackException e) {
@@ -404,7 +404,7 @@
KeywordSetKey.EMPTY);
expression = astFactory.createExpression(scope,
IASTExpression.Kind.ID_EXPRESSION, null, null,
- null, null, nameDuple, EMPTY_STRING, null);
+ null, null, nameDuple, EMPTY_STRING, null, null);
list.add(expression);
continue;
} catch (ASTSemanticException e) {
@@ -827,7 +827,7 @@
assignmentExpression = astFactory.createExpression(scope,
IASTExpression.Kind.EXPRESSIONLIST,
assignmentExpression, secondExpression, null, null,
- null, EMPTY_STRING, null);
+ null, EMPTY_STRING, null, null);
} catch (ASTSemanticException e) {
throwBacktrack(e.getProblem());
} catch (Exception e) {
@@ -868,7 +868,7 @@
consume( IToken.tRPAREN );
try
{
- resultExpression = astFactory.createExpression( scope, extension.getExpressionKindForStatement(), null, null, null, null, null,EMPTY_STRING, null );
+ resultExpression = astFactory.createExpression( scope, extension.getExpressionKindForStatement(), null, null, null, null, null,EMPTY_STRING, null, null );
}
catch (ASTSemanticException e) {
throwBacktrack(e.getProblem());
@@ -970,7 +970,7 @@
try {
return astFactory.createExpression(scope,
IASTExpression.Kind.THROWEXPRESSION, throwExpression, null,
- null, null, null, EMPTY_STRING, null);
+ null, null, null, EMPTY_STRING, null, null);
} catch (ASTSemanticException e) {
throwBacktrack(e.getProblem());
} catch (Exception e) {
@@ -1006,7 +1006,7 @@
return astFactory.createExpression(scope,
IASTExpression.Kind.CONDITIONALEXPRESSION,
firstExpression, secondExpression, thirdExpression,
- null, null, EMPTY_STRING, null);
+ null, null, EMPTY_STRING, null, null);
} catch (ASTSemanticException e) {
throwBacktrack(e.getProblem());
} catch (Exception e) {
@@ -1038,7 +1038,7 @@
firstExpression = astFactory.createExpression(scope,
IASTExpression.Kind.LOGICALOREXPRESSION,
firstExpression, secondExpression, null, null, null,
- EMPTY_STRING, null);
+ EMPTY_STRING, null, null);
} catch (ASTSemanticException e) {
throwBacktrack(e.getProblem());
} catch (Exception e) {
@@ -1070,7 +1070,7 @@
firstExpression = astFactory.createExpression(scope,
IASTExpression.Kind.LOGICALANDEXPRESSION,
firstExpression, secondExpression, null, null, null,
- EMPTY_STRING, null);
+ EMPTY_STRING, null, null);
} catch (ASTSemanticException e) {
throwBacktrack(e.getProblem());
} catch (Exception e) {
@@ -1103,7 +1103,7 @@
firstExpression = astFactory.createExpression(scope,
IASTExpression.Kind.INCLUSIVEOREXPRESSION,
firstExpression, secondExpression, null, null, null,
- EMPTY_STRING, null);
+ EMPTY_STRING, null, null);
} catch (ASTSemanticException e) {
throwBacktrack(e.getProblem());
} catch (Exception e) {
@@ -1136,7 +1136,7 @@
firstExpression = astFactory.createExpression(scope,
IASTExpression.Kind.EXCLUSIVEOREXPRESSION,
firstExpression, secondExpression, null, null, null,
- EMPTY_STRING, null);
+ EMPTY_STRING, null, null);
} catch (ASTSemanticException e) {
throwBacktrack(e.getProblem());
} catch (Exception e) {
@@ -1168,7 +1168,7 @@
try {
firstExpression = astFactory.createExpression(scope,
IASTExpression.Kind.ANDEXPRESSION, firstExpression,
- secondExpression, null, null, null, EMPTY_STRING, null);
+ secondExpression, null, null, null, EMPTY_STRING, null, null);
} catch (ASTSemanticException e) {
throwBacktrack(e.getProblem());
} catch (Exception e) {
@@ -1226,7 +1226,7 @@
? IASTExpression.Kind.EQUALITY_EQUALS
: IASTExpression.Kind.EQUALITY_NOTEQUALS,
firstExpression, secondExpression, null, null,
- null, EMPTY_STRING, null);
+ null, EMPTY_STRING, null, null);
} catch (ASTSemanticException e) {
throwBacktrack(e.getProblem());
} catch (Exception e) {
@@ -1293,7 +1293,7 @@
firstExpression = astFactory.createExpression(scope,
expressionKind, firstExpression,
secondExpression, null, null, null,
- EMPTY_STRING, null);
+ EMPTY_STRING, null, null);
} catch (ASTSemanticException e) {
throwBacktrack(e.getProblem());
} catch (Exception e) {
@@ -1341,7 +1341,7 @@
? IASTExpression.Kind.SHIFT_LEFT
: IASTExpression.Kind.SHIFT_RIGHT),
firstExpression, secondExpression, null, null,
- null, EMPTY_STRING, null);
+ null, EMPTY_STRING, null, null);
} catch (ASTSemanticException e) {
throwBacktrack(e.getProblem());
} catch (Exception e) {
@@ -1382,7 +1382,7 @@
? IASTExpression.Kind.ADDITIVE_PLUS
: IASTExpression.Kind.ADDITIVE_MINUS),
firstExpression, secondExpression, null, null,
- null, EMPTY_STRING, null);
+ null, EMPTY_STRING, null, null);
} catch (ASTSemanticException e) {
throwBacktrack(e.getProblem());
} catch (Exception e) {
@@ -1434,7 +1434,7 @@
firstExpression = astFactory.createExpression(scope,
expressionKind, firstExpression,
secondExpression, null, null, null,
- EMPTY_STRING, null);
+ EMPTY_STRING, null, null);
} catch (ASTSemanticException e) {
firstExpression.freeReferences();
throwBacktrack(e.getProblem());
@@ -1476,7 +1476,7 @@
? IASTExpression.Kind.PM_DOTSTAR
: IASTExpression.Kind.PM_ARROWSTAR),
firstExpression, secondExpression, null, null,
- null, EMPTY_STRING, null);
+ null, EMPTY_STRING, null, null);
} catch (ASTSemanticException e) {
throwBacktrack(e.getProblem());
} catch (Exception e) {
@@ -1540,7 +1540,7 @@
try {
return astFactory.createExpression(scope,
IASTExpression.Kind.CASTEXPRESSION, castExpression,
- null, null, typeId, null, EMPTY_STRING, null);
+ null, null, typeId, null, EMPTY_STRING, null, null);
} catch (ASTSemanticException e) {
throwBacktrack(e.getProblem());
} catch (Exception e) {
@@ -1809,7 +1809,7 @@
return astFactory.createExpression(scope, (vectored
? IASTExpression.Kind.DELETE_VECTORCASTEXPRESSION
: IASTExpression.Kind.DELETE_CASTEXPRESSION),
- castExpression, null, null, null, null, EMPTY_STRING, null);
+ castExpression, null, null, null, null, EMPTY_STRING, null, null);
} catch (ASTSemanticException e) {
throwBacktrack(e.getProblem());
} catch (Exception e) {
@@ -1953,7 +1953,7 @@
astFactory.createNewDescriptor(
newPlacementExpressions,
newTypeIdExpressions,
- newInitializerExpressions));
+ newInitializerExpressions), null);
} catch (ASTSemanticException e) {
throwBacktrack(e.getProblem());
} catch (Exception e) {
@@ -2023,7 +2023,7 @@
IASTExpression.Kind.NEW_TYPEID, null, null, null, typeId,
null, EMPTY_STRING, astFactory.createNewDescriptor(
newPlacementExpressions, newTypeIdExpressions,
- newInitializerExpressions));
+ newInitializerExpressions), null);
} catch (ASTSemanticException e) {
throwBacktrack(e.getProblem());
return null;
@@ -2105,7 +2105,7 @@
try {
return astFactory.createExpression(scope,
IASTExpression.Kind.UNARY_SIZEOF_TYPEID, null,
- null, null, d, null, EMPTY_STRING, null);
+ null, null, d, null, EMPTY_STRING, null, null);
} catch (ASTSemanticException e) {
throwBacktrack(e.getProblem());
} catch (Exception e) {
@@ -2116,7 +2116,7 @@
return astFactory.createExpression(scope,
IASTExpression.Kind.UNARY_SIZEOF_UNARYEXPRESSION,
unaryExpression, null, null, null, null,
- EMPTY_STRING, null);
+ EMPTY_STRING, null, null);
} catch (ASTSemanticException e1) {
throwBacktrack(e1.getProblem());
} catch (Exception e) {
@@ -2195,7 +2195,7 @@
? IASTExpression.Kind.POSTFIX_TYPENAME_TEMPLATEID
: IASTExpression.Kind.POSTFIX_TYPENAME_IDENTIFIER),
expressionList, null, null, null,
- nestedName, EMPTY_STRING, null);
+ nestedName, EMPTY_STRING, null, null);
} catch (ASTSemanticException ase) {
throwBacktrack(ase.getProblem());
} catch (Exception e) {
@@ -2287,7 +2287,7 @@
? IASTExpression.Kind.POSTFIX_TYPEID_TYPEID
: IASTExpression.Kind.POSTFIX_TYPEID_EXPRESSION),
lhs, null, null, typeId, null,
- EMPTY_STRING, null);
+ EMPTY_STRING, null, null);
} catch (ASTSemanticException e6) {
throwBacktrack(e6.getProblem());
} catch (Exception e) {
@@ -2317,7 +2317,7 @@
firstExpression = astFactory.createExpression(scope,
IASTExpression.Kind.POSTFIX_SUBSCRIPT,
firstExpression, secondExpression, null, null,
- null, EMPTY_STRING, null);
+ null, EMPTY_STRING, null, null);
} catch (ASTSemanticException e2) {
throwBacktrack(e2.getProblem());
} catch (Exception e) {
@@ -2361,7 +2361,7 @@
firstExpression = astFactory.createExpression(scope,
IASTExpression.Kind.POSTFIX_FUNCTIONCALL,
firstExpression, secondExpression, null, null,
- null, EMPTY_STRING, null);
+ null, EMPTY_STRING, null, null);
} catch (ASTSemanticException e3) {
throwBacktrack(e3.getProblem());
} catch (Exception e) {
@@ -2376,7 +2376,7 @@
firstExpression = astFactory.createExpression(scope,
IASTExpression.Kind.POSTFIX_INCREMENT,
firstExpression, null, null, null, null,
- EMPTY_STRING, null);
+ EMPTY_STRING, null, null);
} catch (ASTSemanticException e1) {
throwBacktrack(e1.getProblem());
} catch (Exception e) {
@@ -2391,7 +2391,7 @@
firstExpression = astFactory.createExpression(scope,
IASTExpression.Kind.POSTFIX_DECREMENT,
firstExpression, null, null, null, null,
- EMPTY_STRING, null);
+ EMPTY_STRING, null, null);
} catch (ASTSemanticException e4) {
throwBacktrack(e4.getProblem());
} catch (Exception e) {
@@ -2429,7 +2429,7 @@
firstExpression = astFactory.createExpression(scope,
memberCompletionKind, firstExpression,
secondExpression, null, null, null,
- EMPTY_STRING, null);
+ EMPTY_STRING, null, null);
} catch (ASTSemanticException e5) {
throwBacktrack(e5.getProblem());
} catch (Exception e) {
@@ -2466,7 +2466,7 @@
firstExpression = astFactory.createExpression(scope,
arrowCompletionKind, firstExpression,
secondExpression, null, null, null,
- EMPTY_STRING, null);
+ EMPTY_STRING, null, null);
} catch (ASTSemanticException e) {
throwBacktrack(e.getProblem());
} catch (Exception e) {
@@ -2523,7 +2523,7 @@
int endOffset = consume(IToken.tRPAREN).getEndOffset();
try {
return astFactory.createExpression(scope, type, inside, null, null,
- null, null, EMPTY_STRING, null);
+ null, null, EMPTY_STRING, null, null);
} catch (ASTSemanticException e) {
throwBacktrack(e.getProblem());
} catch (Exception e) {
@@ -2549,7 +2549,7 @@
try {
return astFactory.createExpression(scope,
IASTExpression.Kind.PRIMARY_INTEGER_LITERAL, null,
- null, null, null, null, t.getCharImage(), null);
+ null, null, null, null, t.getCharImage(), null, (ITokenDuple)t);
} catch (ASTSemanticException e1) {
throwBacktrack(e1.getProblem());
} catch (Exception e) {
@@ -2561,7 +2561,7 @@
try {
return astFactory.createExpression(scope,
IASTExpression.Kind.PRIMARY_FLOAT_LITERAL, null,
- null, null, null, null, t.getCharImage(), null);
+ null, null, null, null, t.getCharImage(), null, (ITokenDuple)t);
} catch (ASTSemanticException e2) {
throwBacktrack(e2.getProblem());
} catch (Exception e) {
@@ -2574,7 +2574,7 @@
try {
return astFactory.createExpression(scope,
IASTExpression.Kind.PRIMARY_STRING_LITERAL, null,
- null, null, null, null, t.getCharImage(), null);
+ null, null, null, null, t.getCharImage(), null, (ITokenDuple)t);
} catch (ASTSemanticException e5) {
throwBacktrack(e5.getProblem());
} catch (Exception e) {
@@ -2588,7 +2588,7 @@
try {
return astFactory.createExpression(scope,
IASTExpression.Kind.PRIMARY_BOOLEAN_LITERAL, null,
- null, null, null, null, t.getCharImage(), null);
+ null, null, null, null, t.getCharImage(), null, (ITokenDuple)t);
} catch (ASTSemanticException e3) {
throwBacktrack(e3.getProblem());
} catch (Exception e) {
@@ -2603,7 +2603,7 @@
try {
return astFactory.createExpression(scope,
IASTExpression.Kind.PRIMARY_CHAR_LITERAL, null,
- null, null, null, null, t.getCharImage(), null);
+ null, null, null, null, t.getCharImage(), null, (ITokenDuple)t);
} catch (ASTSemanticException e4) {
throwBacktrack(e4.getProblem());
} catch (Exception e) {
@@ -2616,7 +2616,7 @@
try {
return astFactory.createExpression(scope,
IASTExpression.Kind.PRIMARY_THIS, null, null, null,
- null, null, EMPTY_STRING, null);
+ null, null, EMPTY_STRING, null, (ITokenDuple)t);
} catch (ASTSemanticException e7) {
throwBacktrack(e7.getProblem());
} catch (Exception e) {
@@ -2642,7 +2642,7 @@
try {
return astFactory.createExpression(scope,
IASTExpression.Kind.PRIMARY_BRACKETED_EXPRESSION,
- lhs, null, null, null, null, EMPTY_STRING, null);
+ lhs, null, null, null, null, EMPTY_STRING, null, (ITokenDuple)t);
} catch (ASTSemanticException e6) {
throwBacktrack(e6.getProblem());
} catch (Exception e) {
@@ -2691,7 +2691,7 @@
try {
return astFactory.createExpression(scope,
IASTExpression.Kind.ID_EXPRESSION, null, null,
- null, null, duple, EMPTY_STRING, null);
+ null, null, duple, EMPTY_STRING, null, duple);
} catch (ASTSemanticException e8) {
throwBacktrack(e8.getProblem());
} catch (Exception e) {
@@ -2713,7 +2713,7 @@
try {
empty = astFactory.createExpression(scope,
IASTExpression.Kind.PRIMARY_EMPTY, null, null,
- null, null, null, EMPTY_STRING, null);
+ null, null, null, EMPTY_STRING, null, (ITokenDuple)la);
} catch (ASTSemanticException e9) {
throwBacktrack( e9.getProblem() );
return null;
@@ -2756,7 +2756,7 @@
int endOffset = ( lastToken != null ) ? lastToken.getEndOffset() : 0;
try {
return astFactory.createExpression(scope, kind, lhs,
- assignmentExpression, null, null, null, EMPTY_STRING, null);
+ assignmentExpression, null, null, null, EMPTY_STRING, null, null);
} catch (ASTSemanticException e) {
throwBacktrack(e.getProblem());
} catch (Exception e) {
@@ -2780,7 +2780,7 @@
int endOffset = ( lastToken != null ) ? lastToken.getEndOffset() : 0;
try {
return astFactory.createExpression(scope, kind, castExpression,
- null, null, null, null, EMPTY_STRING, null);
+ null, null, null, null, EMPTY_STRING, null, null);
} catch (ASTSemanticException e) {
throwBacktrack(e.getProblem());
} catch (Exception e) {
@@ -2809,7 +2809,7 @@
int endOffset = consume(IToken.tRPAREN).getEndOffset();
try {
return astFactory.createExpression(scope, kind, lhs, null, null,
- duple, null, EMPTY_STRING, null);
+ duple, null, EMPTY_STRING, null, null);
} catch (ASTSemanticException e) {
throwBacktrack(e.getProblem());
} catch (Exception e) {
@@ -6926,4 +6926,5 @@
references.clear();
}
+
}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTEmptyExpression.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTEmptyExpression.java,v
retrieving revision 1.4
diff -u -r1.4 ASTEmptyExpression.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTEmptyExpression.java 7 Sep 2004 18:56:38 -0000 1.4
+++ parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTEmptyExpression.java 5 Nov 2004 16:19:37 -0000
@@ -36,4 +36,60 @@
public String toString(){
return ASTUtil.getExpressionString( this );
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffsetAndLineNumber(int, int)
+ */
+ public void setStartingOffsetAndLineNumber(int offset, int lineNumber) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffsetAndLineNumber(int, int)
+ */
+ public void setEndingOffsetAndLineNumber(int offset, int lineNumber) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset()
+ */
+ public int getStartingOffset() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset()
+ */
+ public int getEndingOffset() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingLine()
+ */
+ public int getStartingLine() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingLine()
+ */
+ public int getEndingLine() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getFilename()
+ */
+ public char[] getFilename() {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTIdExpression.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTIdExpression.java,v
retrieving revision 1.4
diff -u -r1.4 ASTIdExpression.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTIdExpression.java 27 Jul 2004 14:55:57 -0000 1.4
+++ parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTIdExpression.java 5 Nov 2004 16:19:37 -0000
@@ -52,4 +52,58 @@
public String toString(){
return ASTUtil.getExpressionString( this );
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffsetAndLineNumber(int, int)
+ */
+ public void setStartingOffsetAndLineNumber(int offset, int lineNumber) {
+ // TODO Auto-generated method stub
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffsetAndLineNumber(int, int)
+ */
+ public void setEndingOffsetAndLineNumber(int offset, int lineNumber) {
+ // TODO Auto-generated method stub
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset()
+ */
+ public int getStartingOffset() {
+ // TODO Auto-generated method stub
+ return idExpression.getStartOffset();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset()
+ */
+ public int getEndingOffset() {
+ // TODO Auto-generated method stub
+ return idExpression.getEndOffset();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingLine()
+ */
+ public int getStartingLine() {
+ // TODO Auto-generated method stub
+ return idExpression.getLineNumber();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingLine()
+ */
+ public int getEndingLine() {
+ // TODO Auto-generated method stub
+ return idExpression.getLineNumber();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getFilename()
+ */
+ public char[] getFilename() {
+ // TODO Auto-generated method stub
+ return idExpression.getFilename();
+ }
}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTLiteralExpression.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTLiteralExpression.java,v
retrieving revision 1.3
diff -u -r1.3 ASTLiteralExpression.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTLiteralExpression.java 22 Jul 2004 19:32:56 -0000 1.3
+++ parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTLiteralExpression.java 5 Nov 2004 16:19:37 -0000
@@ -41,4 +41,60 @@
public String toString(){
return ASTUtil.getExpressionString( this );
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffsetAndLineNumber(int, int)
+ */
+ public void setStartingOffsetAndLineNumber(int offset, int lineNumber) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffsetAndLineNumber(int, int)
+ */
+ public void setEndingOffsetAndLineNumber(int offset, int lineNumber) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset()
+ */
+ public int getStartingOffset() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset()
+ */
+ public int getEndingOffset() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingLine()
+ */
+ public int getStartingLine() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingLine()
+ */
+ public int getEndingLine() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getFilename()
+ */
+ public char[] getFilename() {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNewExpression.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNewExpression.java,v
retrieving revision 1.7
diff -u -r1.7 ASTNewExpression.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNewExpression.java 29 Sep 2004 14:52:24 -0000 1.7
+++ parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTNewExpression.java 5 Nov 2004 16:19:37 -0000
@@ -111,4 +111,60 @@
return ownerExpression;
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffsetAndLineNumber(int, int)
+ */
+ public void setStartingOffsetAndLineNumber(int offset, int lineNumber) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffsetAndLineNumber(int, int)
+ */
+ public void setEndingOffsetAndLineNumber(int offset, int lineNumber) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset()
+ */
+ public int getStartingOffset() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset()
+ */
+ public int getEndingOffset() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingLine()
+ */
+ public int getStartingLine() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingLine()
+ */
+ public int getEndingLine() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getFilename()
+ */
+ public char[] getFilename() {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypeIdExpression.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypeIdExpression.java,v
retrieving revision 1.5
diff -u -r1.5 ASTTypeIdExpression.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypeIdExpression.java 9 Sep 2004 02:13:58 -0000 1.5
+++ parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTTypeIdExpression.java 5 Nov 2004 16:19:38 -0000
@@ -65,4 +65,53 @@
return this;
return super.findOwnerExpressionForIDExpression(duple);
}
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffsetAndLineNumber(int, int)
+ */
+ public void setStartingOffsetAndLineNumber(int offset, int lineNumber) {
+ // TODO Auto-generated method stub
+
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffsetAndLineNumber(int, int)
+ */
+ public void setEndingOffsetAndLineNumber(int offset, int lineNumber) {
+ // TODO Auto-generated method stub
+
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset()
+ */
+ public int getStartingOffset() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset()
+ */
+ public int getEndingOffset() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingLine()
+ */
+ public int getStartingLine() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingLine()
+ */
+ public int getEndingLine() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getFilename()
+ */
+ public char[] getFilename() {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTUnaryExpression.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTUnaryExpression.java,v
retrieving revision 1.5
diff -u -r1.5 ASTUnaryExpression.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTUnaryExpression.java 7 Sep 2004 18:56:38 -0000 1.5
+++ parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTUnaryExpression.java 5 Nov 2004 16:19:38 -0000
@@ -88,4 +88,53 @@
public String toString(){
return ASTUtil.getExpressionString( this );
}
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffsetAndLineNumber(int, int)
+ */
+ public void setStartingOffsetAndLineNumber(int offset, int lineNumber) {
+ // TODO Auto-generated method stub
+
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffsetAndLineNumber(int, int)
+ */
+ public void setEndingOffsetAndLineNumber(int offset, int lineNumber) {
+ // TODO Auto-generated method stub
+
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset()
+ */
+ public int getStartingOffset() {
+ // TODO Auto-generated method stub
+ return lhs.getStartingOffset();
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset()
+ */
+ public int getEndingOffset() {
+ // TODO Auto-generated method stub
+ return lhs.getEndingOffset();
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingLine()
+ */
+ public int getStartingLine() {
+ // TODO Auto-generated method stub
+ return lhs.getStartingLine();
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingLine()
+ */
+ public int getEndingLine() {
+ // TODO Auto-generated method stub
+ return lhs.getEndingLine();
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getFilename()
+ */
+ public char[] getFilename() {
+ // TODO Auto-generated method stub
+ return lhs.getFilename();
+ }
}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java,v
retrieving revision 1.195
diff -u -r1.195 CompleteParseASTFactory.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java 25 Oct 2004 21:21:57 -0000 1.195
+++ parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java 5 Nov 2004 16:19:39 -0000
@@ -123,6 +123,9 @@
private final CharArrayObjectMap simpleTypeSpecCache = new CharArrayObjectMap( BUILTIN_TYPE_SIZE );
private static final int DEFAULT_QUALIFIEDNAME_REFERENCE_SIZE = 4;
private char[] filename;
+ private int problemStartOffset = -1;
+ private int problemEndOffset = -1;
+ private int problemLineNumber = -1;
static
{
@@ -213,11 +216,11 @@
return true;
}
- private ISymbol lookupElement (IContainerSymbol startingScope, char[] name, ITypeInfo.eType type, List parameters, LookupType lookupType ) throws ASTSemanticException {
- return lookupElement( startingScope, name, type, parameters, null, lookupType );
+ private ISymbol lookupElement (IContainerSymbol startingScope, char[] name, ITypeInfo.eType type, List parameters, LookupType lookupType) throws ASTSemanticException {
+ return lookupElement( startingScope, name, type, parameters, null, lookupType);
}
- private ISymbol lookupElement (IContainerSymbol startingScope, char[] name, ITypeInfo.eType type, List parameters, List arguments, LookupType lookupType ) throws ASTSemanticException {
+ private ISymbol lookupElement (IContainerSymbol startingScope, char[] name, ITypeInfo.eType type, List parameters, List arguments, LookupType lookupType) throws ASTSemanticException {
ISymbol result = null;
if( startingScope == null ) return null;
try {
@@ -269,7 +272,7 @@
return lookupQualifiedName(startingScope, name, ITypeInfo.t_any, null, 0, references, throwOnError, lookup );
}
- protected ISymbol lookupQualifiedName( IContainerSymbol startingScope, char[] name, ITypeInfo.eType type, List parameters, int offset, List references, boolean throwOnError, LookupType lookup ) throws ASTSemanticException
+ protected ISymbol lookupQualifiedName( IContainerSymbol startingScope, char[] name, ITypeInfo.eType type, List parameters, int offset, List references, boolean throwOnError, LookupType lookup) throws ASTSemanticException
{
ISymbol result = null;
if( name == null && throwOnError )
@@ -306,6 +309,7 @@
protected ISymbol lookupQualifiedName( IContainerSymbol startingScope, ITokenDuple name, ITypeInfo.eType type, List parameters, List references, boolean throwOnError, LookupType lookup ) throws ASTSemanticException
{
+ setProblemInfo(name);
ISymbol result = null;
if( name == null && throwOnError ) handleProblem( IProblem.SEMANTIC_NAME_NOT_PROVIDED, null );
else if( name == null ) return null;
@@ -466,7 +470,7 @@
int startingLine, int endingOffset, int endingLine)
throws ASTSemanticException
{
- setFilename( duple );
+ setProblemInfo( duple );
List references = new ArrayList();
ISymbol symbol = lookupQualifiedName(
scopeToSymbol( scope), duple, references, true );
@@ -485,14 +489,6 @@
return using;
}
-
-
- /**
- * @param duple
- */
- private void setFilename(ITokenDuple duple) {
- filename = ( duple == null ) ? EMPTY_STRING : duple.getFilename();
- }
protected IContainerSymbol getScopeToSearchUpon(
IASTScope currentScope,
@@ -525,7 +521,7 @@
int startingOffset,
int startingLine, int endingOffset, int endingLine) throws ASTSemanticException
{
- setFilename( name );
+ setProblemInfo( name );
List references = new ArrayList();
IUsingDeclarationSymbol endResult = null;
@@ -832,12 +828,12 @@
protected void handleProblem( int id, char[] attribute ) throws ASTSemanticException
{
- handleProblem( null, id, attribute, -1, -1, -1, true ); //TODO make this right
+ handleProblem( null, id, attribute, problemStartOffset, problemEndOffset, problemLineNumber, true );
}
protected void handleProblem( IASTScope scope, int id, char[] attribute ) throws ASTSemanticException
{
- handleProblem( scope, id, attribute, -1, -1, -1, true);
+ handleProblem( scope, id, attribute, problemStartOffset, problemEndOffset, problemLineNumber, true);
}
protected void handleProblem( int id, char[] attribute, int startOffset, int endOffset, int lineNumber, boolean isError ) throws ASTSemanticException {
@@ -905,7 +901,7 @@
ASTAccessVisibility visibility,
ITokenDuple parentClassName) throws ASTSemanticException
{
- setFilename( parentClassName );
+ setProblemInfo( parentClassName );
IDerivableContainerSymbol classSymbol = (IDerivableContainerSymbol)scopeToSymbol( astClassSpec);
List references = new ArrayList();
@@ -1086,9 +1082,9 @@
IASTExpression rhs,
IASTExpression thirdExpression,
IASTTypeId typeId,
- ITokenDuple idExpression, char[] literal, IASTNewExpressionDescriptor newDescriptor) throws ASTSemanticException
+ ITokenDuple idExpression, char[] literal, IASTNewExpressionDescriptor newDescriptor, ITokenDuple extra) throws ASTSemanticException
{
- setFilename( idExpression );
+ setProblemInfo( extra );
if( idExpression != null && logService.isTracing() )
{
TraceUtil.outputTrace(
@@ -1116,7 +1112,7 @@
ISymbol symbol = getExpressionSymbol(scope, kind, lhs, rhs, idExpression, references );
// Try to figure out the result that this expression evaluates to
- ExpressionResult expressionResult = getExpressionResultType(scope, kind, lhs, rhs, thirdExpression, typeId, literal, symbol);
+ ExpressionResult expressionResult = getExpressionResultType(scope, kind, lhs, rhs, thirdExpression, typeId, literal, symbol, extra);
if( newDescriptor != null ){
createConstructorReference( newDescriptor, typeId, references );
@@ -1372,7 +1368,12 @@
* Apply the usual arithmetic conversions to find out the result of an expression
* that has a lhs and a rhs as indicated in the specs (section 5.Expressions, page 64)
*/
- protected ITypeInfo usualArithmeticConversions( IASTScope scope, ITypeInfo lhs, ITypeInfo rhs) throws ASTSemanticException{
+ protected ITypeInfo usualArithmeticConversions( IASTScope scope, ASTExpression lhsExp, ASTExpression rhsExp) throws ASTSemanticException{
+ setFilename(lhsExp.getFilename());
+
+ ITypeInfo lhs = lhsExp.getResultType().getResult();
+ ITypeInfo rhs = rhsExp.getResultType().getResult();
+
if( lhs == null ) return null;
if( rhs == null ) return null;
// if you have a variable of type basic type, then we need to go to the basic type first
@@ -1382,12 +1383,11 @@
while( (rhs.getType() == ITypeInfo.t_type) && (rhs.getTypeSymbol() != null)){
rhs = rhs.getTypeSymbol().getTypeInfo();
}
-
- if( !lhs.isType(ITypeInfo.t__Bool, ITypeInfo.t_enumerator ) ||
- !rhs.isType(ITypeInfo.t__Bool, ITypeInfo.t_enumerator ) )
- {
- handleProblem( scope, IProblem.SEMANTIC_INVALID_CONVERSION_TYPE, null );
- }
+
+ if( !lhs.isType(ITypeInfo.t__Bool, ITypeInfo.t_enumerator ) )
+ handleProblem( scope, IProblem.SEMANTIC_INVALID_CONVERSION_TYPE, null, lhsExp.getStartingOffset(), lhsExp.getEndingOffset(), lhsExp.getStartingLine(), true );
+ if( !rhs.isType(ITypeInfo.t__Bool, ITypeInfo.t_enumerator ) )
+ handleProblem( scope, IProblem.SEMANTIC_INVALID_CONVERSION_TYPE, null, rhsExp.getStartingOffset(), rhsExp.getEndingOffset(), rhsExp.getStartingLine(), true );
ITypeInfo info = TypeInfoProvider.newTypeInfo( );
if(
@@ -1553,8 +1553,9 @@
IASTExpression thirdExpression,
IASTTypeId typeId,
char[] literal,
- ISymbol symbol) throws ASTSemanticException
+ ISymbol symbol, ITokenDuple extra) throws ASTSemanticException
{
+ setProblemInfo(extra);
ITypeInfo info = null;
ExpressionResult result = null;
@@ -1738,9 +1739,7 @@
ASTExpression left = (ASTExpression)lhs;
ASTExpression right = (ASTExpression)rhs;
if((left != null ) && (right != null)){
- ITypeInfo leftType =left.getResultType().getResult();
- ITypeInfo rightType =right.getResultType().getResult();
- info = usualArithmeticConversions( scope, leftType, rightType);
+ info = usualArithmeticConversions( scope, left, right);
}
else
handleProblem( scope, IProblem.SEMANTIC_MALFORMED_EXPRESSION, null );
@@ -1903,7 +1902,7 @@
IASTScope scope,
ITokenDuple duple, IASTExpression expressionList)
{
- setFilename( duple );
+ setProblemInfo( duple );
List references = new ArrayList();
IContainerSymbol scopeSymbol = scopeToSymbol(scope);
@@ -1953,7 +1952,7 @@
boolean isImaginary,
boolean isGlobal, Map extensionParms ) throws ASTSemanticException
{
- setFilename( typeName );
+ setProblemInfo( typeName );
if( extension.overrideCreateSimpleTypeSpecifierMethod( kind ))
return extension.createSimpleTypeSpecifier(pst, scope, kind, typeName, isShort, isLong, isSigned, isUnsigned, isTypename, isComplex, isImaginary, isGlobal, extensionParms );
char[] typeNameAsString = typeName.toCharArray();
@@ -2101,7 +2100,7 @@
boolean isExplicit,
boolean isPureVirtual, List constructorChain, boolean isFunctionDefinition, boolean hasFunctionTryBlock, boolean hasVariableArguments ) throws ASTSemanticException
{
- setFilename( name );
+ setProblemInfo( name );
List references = new ArrayList();
IContainerSymbol ownerScope = scopeToSymbol( scope );
@@ -2469,7 +2468,7 @@
boolean isPureVirtual,
ASTAccessVisibility visibility, List constructorChain, List references, boolean isFunctionDefinition, boolean hasFunctionTryBlock, boolean hasVariableArguments ) throws ASTSemanticException
{
- setFilename( nameDuple );
+ setProblemInfo( nameDuple );
boolean isConstructor = false;
boolean isDestructor = false;
@@ -2677,7 +2676,7 @@
IContainerSymbol ownerScope = scopeToSymbol( scope );
if( name == null )
- handleProblem( IProblem.SEMANTIC_NAME_NOT_PROVIDED, null, startingOffset, nameEndOffset, nameLine, true );
+ handleProblem( IProblem.SEMANTIC_NAME_NOT_PROVIDED, null, startingOffset, startingOffset + 1, startingLine, true );
if(name.getSegmentCount() > 1)
{
@@ -2752,7 +2751,7 @@
}
catch (ParserSymbolTableException e)
{
- handleProblem(e.createProblemID(), name.getFirstToken().getCharImage() );
+ handleProblem(e.createProblemID(), name.getFirstToken().getCharImage(), name.getFirstToken().getOffset(), name.getFirstToken().getEndOffset(), name.getFirstToken().getLineNumber(), true );
}
ASTVariable variable = new ASTVariable( newSymbol, abstractDeclaration, initializerClause, bitfieldExpression, startingOffset, startingLine, nameOffset, nameEndOffset, nameLine, references, constructorExpression, previouslyDeclared, filename );
@@ -2993,7 +2992,10 @@
}
catch (ParserSymbolTableException e)
{
- handleProblem(e.createProblemID(), image );
+ if (name==null)
+ handleProblem(e.createProblemID(), image );
+ else
+ handleProblem(e.createProblemID(), image, name.getStartOffset(), name.getEndOffset(), name.getLineNumber(), true );
}
ASTField field = new ASTField( newSymbol, abstractDeclaration, initializerClause, bitfieldExpression, startingOffset, startingLine, nameOffset, nameEndOffset, nameLine, references, previouslyDeclared, constructorExpression, visibility, filename );
@@ -3199,7 +3201,7 @@
public IASTElaboratedTypeSpecifier createElaboratedTypeSpecifier(IASTScope scope, ASTClassKind kind, ITokenDuple name, int startingOffset, int startingLine, int endOffset, int endingLine, boolean isForewardDecl, boolean isFriend) throws ASTSemanticException
{
- setFilename( name );
+ setProblemInfo( name );
IContainerSymbol currentScopeSymbol = scopeToSymbol(scope);
IContainerSymbol originalScope = currentScopeSymbol;
@@ -3343,7 +3345,7 @@
*/
public IASTNamespaceAlias createNamespaceAlias(IASTScope scope, char[] identifier, ITokenDuple alias, int startingOffset, int startingLine, int nameOffset, int nameEndOffset, int nameLine, int endOffset, int endingLine) throws ASTSemanticException
{
- setFilename( alias );
+ setProblemInfo( alias );
IContainerSymbol startingSymbol = scopeToSymbol(scope);
List references = new ArrayList();
@@ -3797,4 +3799,17 @@
return (pst.getTypeInfoProvider().numAllocated() == 0);
}
+ private void setProblemInfo(ITokenDuple extra) {
+ if (extra != null) {
+ this.problemStartOffset = extra.getStartOffset();
+ this.problemEndOffset = extra.getEndOffset();
+ this.problemLineNumber = extra.getLineNumber();
+ this.filename = extra.getFilename();
+ } else {
+ this.problemStartOffset = -1;
+ this.problemEndOffset = -1;
+ this.problemLineNumber = -1;
+ this.filename = EMPTY_STRING;
+ }
+ }
}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTExpression.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTExpression.java,v
retrieving revision 1.10
diff -u -r1.10 ASTExpression.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTExpression.java 28 Sep 2004 17:30:11 -0000 1.10
+++ parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTExpression.java 5 Nov 2004 16:19:39 -0000
@@ -235,5 +235,61 @@
public void freeReferences() {
}
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setStartingOffsetAndLineNumber(int, int)
+ */
+ public void setStartingOffsetAndLineNumber(int offset, int lineNumber) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#setEndingOffsetAndLineNumber(int, int)
+ */
+ public void setEndingOffsetAndLineNumber(int offset, int lineNumber) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingOffset()
+ */
+ public int getStartingOffset() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingOffset()
+ */
+ public int getEndingOffset() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getStartingLine()
+ */
+ public int getStartingLine() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getEndingLine()
+ */
+ public int getEndingLine() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.core.parser.ast.IASTOffsetableElement#getFilename()
+ */
+ public char[] getFilename() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
Index: parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt-core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java,v
retrieving revision 1.78
diff -u -r1.78 QuickParseASTFactory.java
--- parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java 28 Sep 2004 17:30:11 -0000 1.78
+++ parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java 5 Nov 2004 16:19:39 -0000
@@ -157,7 +157,7 @@
/* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createExpression(org.eclipse.cdt.core.parser.ast.IASTExpression.ExpressionKind, org.eclipse.cdt.core.parser.ast.IASTExpression, org.eclipse.cdt.core.parser.ast.IASTExpression, java.lang.String, java.lang.String, java.lang.String)
*/
- public IASTExpression createExpression(IASTScope scope, Kind kind, IASTExpression lhs, IASTExpression rhs, IASTExpression thirdExpression, IASTTypeId typeId, ITokenDuple idExpression, char[] literal, IASTNewExpressionDescriptor newDescriptor) {
+ public IASTExpression createExpression(IASTScope scope, Kind kind, IASTExpression lhs, IASTExpression rhs, IASTExpression thirdExpression, IASTTypeId typeId, ITokenDuple idExpression, char[] literal, IASTNewExpressionDescriptor newDescriptor, ITokenDuple extra) {
return temporarilyDisableNodeConstruction ? ExpressionFactory.createExpression( kind, lhs, rhs, thirdExpression, typeId, idExpression == null ? EMPTY_STRING : idExpression.toCharArray(), literal, newDescriptor ) : null; //$NON-NLS-1$
}