Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2008-02-21 08:34:01 +0000
committerMarkus Schorn2008-02-21 08:34:01 +0000
commitf7b257a9a219c44741802251a920fda33c48ec69 (patch)
tree5eda66b069f9c13cb8cec6e1a7e737b737fdab9d /core/org.eclipse.cdt.core/parser
parent706f8fe3ef1f15e23db63333d56b833ea4175d9d (diff)
downloadorg.eclipse.cdt-f7b257a9a219c44741802251a920fda33c48ec69.tar.gz
org.eclipse.cdt-f7b257a9a219c44741802251a920fda33c48ec69.tar.xz
org.eclipse.cdt-f7b257a9a219c44741802251a920fda33c48ec69.zip
Action to create a parser log, bug 213561.
Diffstat (limited to 'core/org.eclipse.cdt.core/parser')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ParserMessages.properties2
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ASTPreprocessorNode.java30
2 files changed, 31 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ParserMessages.properties b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ParserMessages.properties
index 5e828321b30..0d8d8cd8c22 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ParserMessages.properties
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ParserMessages.properties
@@ -65,7 +65,7 @@ ASTProblemFactory.error.semantic.malformedExpression=Malformed expression
LineOffsetReconciler.error.couldNotResetReader=Could not reset Reader
-BaseProblemFactory.problemPattern={0} in file: {1}:{2, number, integer}.
+BaseProblemFactory.problemPattern={0} in file: {1}:{2, number, integer}
ASTProblemFactory.error.semantic.pst.ambiguousLookup=Ambiguity encountered during lookup: {0}
ASTProblemFactory.error.semantic.pst.invalidType=Invalid type encountered in: {0}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ASTPreprocessorNode.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ASTPreprocessorNode.java
index e9c6ac642bd..ab61429754a 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ASTPreprocessorNode.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/ASTPreprocessorNode.java
@@ -220,6 +220,7 @@ class ASTInclusionStatement extends ASTPreprocessorNode implements IASTPreproces
return fIsSystemInclude;
}
+ @Override
IASTNode findSurroundingNode(int sequenceNumber, int length) {
final int nameSequencNumber= fName.getOffset();
final int nameEndSequencNumber= nameSequencNumber + fName.getLength();
@@ -258,6 +259,7 @@ class ASTMacroDefinition extends ASTPreprocessorNode implements IASTPreprocessor
}
+ @Override
public String getContainingFilename() {
if (fName instanceof ASTBuiltinName) {
return fName.getContainingFilename();
@@ -281,6 +283,7 @@ class ASTMacroDefinition extends ASTPreprocessorNode implements IASTPreprocessor
return (fName == n) ? r_definition : r_unclear;
}
+ @Override
IASTNode findSurroundingNode(int sequenceNumber, int length) {
final int nameSequencNumber= fName.getOffset();
final int nameEndSequencNumber= nameSequencNumber + fName.getLength();
@@ -312,6 +315,11 @@ class ASTMacroDefinition extends ASTPreprocessorNode implements IASTPreprocessor
}
return null;
}
+
+ @Override
+ public String toString() {
+ return getName().toString() + '=' + getExpansion();
+ }
}
class ASTMacroParameter extends ASTPreprocessorNode implements IASTFunctionStyleMacroParameter {
@@ -357,6 +365,25 @@ class ASTFunctionStyleMacroDefinition extends ASTMacroDefinition implements IAST
}
public void addParameter(IASTFunctionStyleMacroParameter parm) {assert false;}
+
+ @Override
+ public String toString() {
+ StringBuilder result= new StringBuilder();
+ result.append(getName().toCharArray());
+ result.append('(');
+ boolean needComma= false;
+ for (IASTFunctionStyleMacroParameter param : getParameters()) {
+ if (needComma) {
+ result.append(',');
+ }
+ result.append(param.getParameter());
+ needComma= true;
+ }
+ result.append(')');
+ result.append('=');
+ result.append(getExpansion());
+ return result.toString();
+ }
}
@@ -371,6 +398,7 @@ class ASTUndef extends ASTPreprocessorNode implements IASTPreprocessorUndefState
return fName;
}
+ @Override
IASTNode findSurroundingNode(int sequenceNumber, int length) {
final int nameSequencNumber= fName.getOffset();
final int nameEndSequencNumber= nameSequencNumber + fName.getLength();
@@ -457,6 +485,7 @@ class ASTFileLocation implements IASTFileLocation {
return fLocationCtx.getSource(fOffset, fLength);
}
+ @Override
public String toString() {
return getFileName() + "[" + fOffset + "," + (fOffset+fLength) + ")"; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
}
@@ -511,6 +540,7 @@ class ASTMacroExpansionLocation implements IASTMacroExpansion {
return fOffset;
}
+ @Override
public String toString() {
return fContext.getMacroDefinition().getName().toString() + "[" + fOffset + "," + (fOffset+fLength) + ")"; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
}

Back to the top