mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 06:05:24 +02:00
Bug 53213: Externalize Strings
This commit is contained in:
parent
27c1639a5e
commit
95f42aeb9e
84 changed files with 817 additions and 811 deletions
|
@ -1,3 +1,6 @@
|
|||
2004-02-26 Andrew Niefer
|
||||
Mark strings that don't need to be externalized for translation
|
||||
|
||||
2004-02-26 Alain Magloire
|
||||
|
||||
To catch with the documentation change to ICElementDelta
|
||||
|
|
|
@ -34,11 +34,11 @@ public class Node {
|
|||
|
||||
public String toString() {
|
||||
StringBuffer tempBuffer = new StringBuffer();
|
||||
tempBuffer.append("[FileRef: ");
|
||||
tempBuffer.append("[FileRef: "); //$NON-NLS-1$
|
||||
tempBuffer.append(fileRef);
|
||||
tempBuffer.append(", Id: ");
|
||||
tempBuffer.append(", Id: "); //$NON-NLS-1$
|
||||
tempBuffer.append(nodeId);
|
||||
tempBuffer.append("]");
|
||||
tempBuffer.append("]"); //$NON-NLS-1$
|
||||
return tempBuffer.toString();
|
||||
}
|
||||
|
||||
|
|
|
@ -374,14 +374,14 @@ public class Util {
|
|||
String[] sourceExtensions = CModelManager.sourceExtensions;
|
||||
String[] headerExtensions = CModelManager.headerExtensions;
|
||||
|
||||
int dot =fileName.lastIndexOf(".");
|
||||
int dot =fileName.lastIndexOf("."); //$NON-NLS-1$
|
||||
|
||||
//No extension, give benefit of doubt
|
||||
if (dot == -1)
|
||||
return true;
|
||||
|
||||
//Extract extension
|
||||
String extension = "";
|
||||
String extension = ""; //$NON-NLS-1$
|
||||
if (dot + 1 <= fileName.length())
|
||||
extension = fileName.substring(dot + 1);
|
||||
|
||||
|
|
|
@ -189,17 +189,17 @@ public class IncludeEntry {
|
|||
|
||||
public String toString() {
|
||||
StringBuffer tempBuffer = new StringBuffer();
|
||||
tempBuffer.append("<Name: ");
|
||||
tempBuffer.append("<Name: "); //$NON-NLS-1$
|
||||
tempBuffer.append(fFile);
|
||||
tempBuffer.append(", Id: ");
|
||||
tempBuffer.append(", Id: "); //$NON-NLS-1$
|
||||
tempBuffer.append(fId);
|
||||
tempBuffer.append(", Refs:{");
|
||||
tempBuffer.append(", Refs:{"); //$NON-NLS-1$
|
||||
for (int i = 0; i < fRefs.length; i++){
|
||||
if (i > 0) tempBuffer.append(',');
|
||||
tempBuffer.append(' ');
|
||||
tempBuffer.append(fRefs[i]);
|
||||
}
|
||||
tempBuffer.append("}, Parents:{");
|
||||
tempBuffer.append("}, Parents:{"); //$NON-NLS-1$
|
||||
Iterator x = fParent.iterator();
|
||||
while (x.hasNext())
|
||||
{
|
||||
|
@ -210,7 +210,7 @@ public class IncludeEntry {
|
|||
tempBuffer.append(' ');
|
||||
}
|
||||
}
|
||||
tempBuffer.append("}, Children:{");
|
||||
tempBuffer.append("}, Children:{"); //$NON-NLS-1$
|
||||
Iterator y = fChild.iterator();
|
||||
while (y.hasNext())
|
||||
{
|
||||
|
@ -221,7 +221,7 @@ public class IncludeEntry {
|
|||
tempBuffer.append(' ');
|
||||
}
|
||||
}
|
||||
tempBuffer.append("} >");
|
||||
tempBuffer.append("} >"); //$NON-NLS-1$
|
||||
return tempBuffer.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public abstract class AddFileToIndex extends IndexRequest {
|
|||
monitor.enterWrite(); // ask permission to write
|
||||
if (!indexDocument(index)) return false;
|
||||
} catch (IOException e) {
|
||||
org.eclipse.cdt.internal.core.model.Util.log(null, "Index I/O Exception: " + e.getMessage() + " on File: " + resource.getName(), ICLogConstants.CDT);
|
||||
org.eclipse.cdt.internal.core.model.Util.log(null, "Index I/O Exception: " + e.getMessage() + " on File: " + resource.getName(), ICLogConstants.CDT); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
if (IndexManager.VERBOSE) {
|
||||
JobManager.verbose("-> failed to index " + this.resource + " because of the following exception:"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
e.printStackTrace();
|
||||
|
|
|
@ -60,10 +60,10 @@ public interface IIndexConstants {
|
|||
char[] TYPEDEF_DECL = "typeDecl/T/".toCharArray(); //$NON-NLS-1$
|
||||
int TYPEDEF_DECL_LENGTH = 11;
|
||||
|
||||
char[] MACRO_DECL = "macroDecl/".toCharArray();
|
||||
char[] MACRO_DECL = "macroDecl/".toCharArray(); //$NON-NLS-1$
|
||||
int MACRO_DECL_LENGTH = 10;
|
||||
|
||||
char[] INCLUDE_REF = "includeRef/".toCharArray();
|
||||
char[] INCLUDE_REF = "includeRef/".toCharArray(); //$NON-NLS-1$
|
||||
int INCLUDE_REF_LENGTH = 11;
|
||||
//a Var REF will be treated as a typeREF
|
||||
//char[] VAR_REF= "varRef/".toCharArray(); //$NON-NLS-1$
|
||||
|
|
|
@ -101,18 +101,18 @@ public class SourceIndexer extends AbstractIndexer {
|
|||
boolean retVal = parser.parse();
|
||||
|
||||
if (!retVal)
|
||||
org.eclipse.cdt.internal.core.model.Util.log(null, "Failed to index " + resourceFile.getFullPath(), ICLogConstants.CDT);
|
||||
org.eclipse.cdt.internal.core.model.Util.log(null, "Failed to index " + resourceFile.getFullPath(), ICLogConstants.CDT); //$NON-NLS-1$
|
||||
|
||||
if (AbstractIndexer.VERBOSE){
|
||||
if (!retVal)
|
||||
AbstractIndexer.verbose("PARSE FAILED " + resourceFile.getName().toString());
|
||||
AbstractIndexer.verbose("PARSE FAILED " + resourceFile.getName().toString()); //$NON-NLS-1$
|
||||
else
|
||||
AbstractIndexer.verbose("PARSE SUCCEEDED " + resourceFile.getName().toString());
|
||||
AbstractIndexer.verbose("PARSE SUCCEEDED " + resourceFile.getName().toString()); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
catch ( VirtualMachineError vmErr){
|
||||
if (vmErr instanceof OutOfMemoryError){
|
||||
org.eclipse.cdt.internal.core.model.Util.log(null, "Out Of Memory error: " + vmErr.getMessage() + " on File: " + resourceFile.getName(), ICLogConstants.CDT);
|
||||
org.eclipse.cdt.internal.core.model.Util.log(null, "Out Of Memory error: " + vmErr.getMessage() + " on File: " + resourceFile.getName(), ICLogConstants.CDT); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
catch ( Exception ex ){
|
||||
|
|
|
@ -124,7 +124,7 @@ public class CModelBuilder {
|
|||
new StringReader( code ),
|
||||
(translationUnit.getUnderlyingResource() != null ?
|
||||
translationUnit.getUnderlyingResource().getLocation().toOSString() :
|
||||
""),
|
||||
""), //$NON-NLS-1$
|
||||
scanInfo,
|
||||
mode,
|
||||
language,
|
||||
|
@ -171,7 +171,7 @@ public class CModelBuilder {
|
|||
// For the debuglog to take place, you have to call
|
||||
// Util.setDebugging(true);
|
||||
// Or set debug to true in the core plugin preference
|
||||
Util.debugLog("CModel build: "+ ( System.currentTimeMillis() - startTime ) + "ms", IDebugLogConstants.MODEL);
|
||||
Util.debugLog("CModel build: "+ ( System.currentTimeMillis() - startTime ) + "ms", IDebugLogConstants.MODEL); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
return this.newElements;
|
||||
|
||||
}
|
||||
|
@ -345,7 +345,7 @@ public class CModelBuilder {
|
|||
// create element
|
||||
String type = "namespace"; //$NON-NLS-1$
|
||||
String nsName = (nsDef.getName() == null )
|
||||
? ""
|
||||
? "" //$NON-NLS-1$
|
||||
: nsDef.getName().toString();
|
||||
Namespace element = new Namespace ((ICElement)parent, nsName );
|
||||
// add to parent
|
||||
|
@ -364,7 +364,7 @@ public class CModelBuilder {
|
|||
// create element
|
||||
String type = "enum"; //$NON-NLS-1$
|
||||
String enumName = (enumSpecifier.getName() == null )
|
||||
? ""
|
||||
? "" //$NON-NLS-1$
|
||||
: enumSpecifier.getName().toString();
|
||||
Enumeration element = new Enumeration ((ICElement)parent, enumName );
|
||||
// add to parent
|
||||
|
@ -418,7 +418,7 @@ public class CModelBuilder {
|
|||
kind = ICElement.C_TEMPLATE_CLASS;
|
||||
type = "class"; //$NON-NLS-1$
|
||||
className = (classSpecifier.getName() == null )
|
||||
? ""
|
||||
? "" //$NON-NLS-1$
|
||||
: classSpecifier.getName().toString();
|
||||
}
|
||||
if(classkind == ASTClassKind.STRUCT){
|
||||
|
@ -428,7 +428,7 @@ public class CModelBuilder {
|
|||
kind = ICElement.C_TEMPLATE_STRUCT;
|
||||
type = "struct"; //$NON-NLS-1$
|
||||
className = (classSpecifier.getName() == null )
|
||||
? ""
|
||||
? "" //$NON-NLS-1$
|
||||
: classSpecifier.getName().toString();
|
||||
}
|
||||
if(classkind == ASTClassKind.UNION){
|
||||
|
@ -438,7 +438,7 @@ public class CModelBuilder {
|
|||
kind = ICElement.C_TEMPLATE_UNION;
|
||||
type = "union"; //$NON-NLS-1$
|
||||
className = (classSpecifier.getName() == null )
|
||||
? ""
|
||||
? "" //$NON-NLS-1$
|
||||
: classSpecifier.getName().toString();
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ public class FunctionTemplate extends FunctionDeclaration implements ITemplate{
|
|||
int i = 0;
|
||||
sig.append(paramTypes[i++]);
|
||||
while (i < paramTypes.length){
|
||||
sig.append(", ");
|
||||
sig.append(", "); //$NON-NLS-1$
|
||||
sig.append(paramTypes[i++]);
|
||||
}
|
||||
sig.append(">"); //$NON-NLS-1$
|
||||
|
|
|
@ -171,7 +171,7 @@ public class PathEntryManager {
|
|||
return;
|
||||
}
|
||||
|
||||
IPath containerPath = (newContainer == null) ? new Path("") : newContainer.getPath();
|
||||
IPath containerPath = (newContainer == null) ? new Path("") : newContainer.getPath(); //$NON-NLS-1$
|
||||
final int projectLength = affectedProjects.length;
|
||||
final ICProject[] modifiedProjects = new ICProject[projectLength];
|
||||
System.arraycopy(affectedProjects, 0, modifiedProjects, 0, projectLength);
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
2004-02-26 Andrew Niefer
|
||||
mark strings that don't need to be externalized for translation
|
||||
|
||||
2004-02-25 Bogdan Gheorghe
|
||||
Added a check to make sure that the parser is in the top context before throwing
|
||||
an EOF exception in SeletionParser.
|
||||
|
|
|
@ -15,18 +15,18 @@ package org.eclipse.cdt.core.parser;
|
|||
*/
|
||||
public class Directives {
|
||||
|
||||
public static final String POUND_DEFINE = "#define";
|
||||
public static final String POUND_UNDEF = "#undef";
|
||||
public static final String POUND_IF = "#if";
|
||||
public static final String POUND_IFDEF = "#ifdef";
|
||||
public static final String POUND_IFNDEF = "#ifndef";
|
||||
public static final String POUND_ELSE = "#else";
|
||||
public static final String POUND_ENDIF = "#endif";
|
||||
public static final String POUND_INCLUDE = "#include";
|
||||
public static final String POUND_LINE = "#line";
|
||||
public static final String POUND_ERROR = "#error";
|
||||
public static final String POUND_PRAGMA = "#pragma";
|
||||
public static final String POUND_ELIF = "#elif";
|
||||
public static final String POUND_BLANK = "#";
|
||||
public static final String POUND_DEFINE = "#define"; //$NON-NLS-1$
|
||||
public static final String POUND_UNDEF = "#undef"; //$NON-NLS-1$
|
||||
public static final String POUND_IF = "#if"; //$NON-NLS-1$
|
||||
public static final String POUND_IFDEF = "#ifdef"; //$NON-NLS-1$
|
||||
public static final String POUND_IFNDEF = "#ifndef"; //$NON-NLS-1$
|
||||
public static final String POUND_ELSE = "#else"; //$NON-NLS-1$
|
||||
public static final String POUND_ENDIF = "#endif"; //$NON-NLS-1$
|
||||
public static final String POUND_INCLUDE = "#include"; //$NON-NLS-1$
|
||||
public static final String POUND_LINE = "#line"; //$NON-NLS-1$
|
||||
public static final String POUND_ERROR = "#error"; //$NON-NLS-1$
|
||||
public static final String POUND_PRAGMA = "#pragma"; //$NON-NLS-1$
|
||||
public static final String POUND_ELIF = "#elif"; //$NON-NLS-1$
|
||||
public static final String POUND_BLANK = "#"; //$NON-NLS-1$
|
||||
|
||||
}
|
||||
|
|
|
@ -10,14 +10,14 @@ import org.eclipse.cdt.core.parser.ast.IASTFactory;
|
|||
*/
|
||||
public interface IScanner {
|
||||
|
||||
public static final String __CPLUSPLUS = "__cplusplus";
|
||||
public static final String __STDC_VERSION__ = "__STDC_VERSION__";
|
||||
public static final String __STDC_HOSTED__ = "__STDC_HOSTED__";
|
||||
public static final String __STDC__ = "__STDC__";
|
||||
public static final String __FILE__ = "__FILE__";
|
||||
public static final String __TIME__ = "__TIME__";
|
||||
public static final String __DATE__ = "__DATE__";
|
||||
public static final String __LINE__ = "__LINE__";
|
||||
public static final String __CPLUSPLUS = "__cplusplus"; //$NON-NLS-1$
|
||||
public static final String __STDC_VERSION__ = "__STDC_VERSION__"; //$NON-NLS-1$
|
||||
public static final String __STDC_HOSTED__ = "__STDC_HOSTED__"; //$NON-NLS-1$
|
||||
public static final String __STDC__ = "__STDC__"; //$NON-NLS-1$
|
||||
public static final String __FILE__ = "__FILE__"; //$NON-NLS-1$
|
||||
public static final String __TIME__ = "__TIME__"; //$NON-NLS-1$
|
||||
public static final String __DATE__ = "__DATE__"; //$NON-NLS-1$
|
||||
public static final String __LINE__ = "__LINE__"; //$NON-NLS-1$
|
||||
|
||||
public static final int tPOUNDPOUND = -6;
|
||||
public static final int tPOUND = -7;
|
||||
|
|
|
@ -15,83 +15,83 @@ package org.eclipse.cdt.core.parser;
|
|||
*/
|
||||
public class Keywords {
|
||||
|
||||
public static final String _BOOL = "_Bool";
|
||||
public static final String _COMPLEX = "_Complex";
|
||||
public static final String _IMAGINARY = "_Imaginary";
|
||||
public static final String AND = "and";
|
||||
public static final String AND_EQ = "and_eq";
|
||||
public static final String ASM = "asm";
|
||||
public static final String AUTO = "auto";
|
||||
public static final String BITAND = "bitand";
|
||||
public static final String BITOR = "bitor";
|
||||
public static final String BOOL = "bool";
|
||||
public static final String BREAK = "break";
|
||||
public static final String CASE = "case";
|
||||
public static final String CATCH = "catch";
|
||||
public static final String CHAR = "char";
|
||||
public static final String CLASS = "class";
|
||||
public static final String COMPL = "compl";
|
||||
public static final String CONST = "const";
|
||||
public static final String CONST_CAST = "const_cast";
|
||||
public static final String CONTINUE = "continue";
|
||||
public static final String DEFAULT = "default";
|
||||
public static final String DELETE = "delete";
|
||||
public static final String DO = "do";
|
||||
public static final String DOUBLE = "double";
|
||||
public static final String DYNAMIC_CAST = "dynamic_cast";
|
||||
public static final String ELSE = "else";
|
||||
public static final String ENUM = "enum";
|
||||
public static final String EXPLICIT = "explicit";
|
||||
public static final String EXPORT = "export";
|
||||
public static final String EXTERN = "extern";
|
||||
public static final String FALSE = "false";
|
||||
public static final String FLOAT = "float";
|
||||
public static final String FOR = "for";
|
||||
public static final String FRIEND = "friend";
|
||||
public static final String GOTO = "goto";
|
||||
public static final String IF = "if";
|
||||
public static final String INLINE = "inline";
|
||||
public static final String INT = "int";
|
||||
public static final String LONG = "long";
|
||||
public static final String MUTABLE = "mutable";
|
||||
public static final String NAMESPACE = "namespace";
|
||||
public static final String NEW = "new";
|
||||
public static final String NOT = "not";
|
||||
public static final String NOT_EQ = "not_eq";
|
||||
public static final String OPERATOR = "operator";
|
||||
public static final String OR = "or";
|
||||
public static final String OR_EQ = "or_eq";
|
||||
public static final String PRIVATE = "private";
|
||||
public static final String PROTECTED = "protected";
|
||||
public static final String PUBLIC = "public";
|
||||
public static final String REGISTER = "register";
|
||||
public static final String REINTERPRET_CAST = "reinterpret_cast";
|
||||
public static final String RESTRICT = "restrict";
|
||||
public static final String RETURN = "return";
|
||||
public static final String SHORT = "short";
|
||||
public static final String SIGNED = "signed";
|
||||
public static final String SIZEOF = "sizeof";
|
||||
public static final String STATIC = "static";
|
||||
public static final String STATIC_CAST = "static_cast";
|
||||
public static final String STRUCT = "struct";
|
||||
public static final String SWITCH = "switch";
|
||||
public static final String TEMPLATE = "template";
|
||||
public static final String THIS = "this";
|
||||
public static final String THROW = "throw";
|
||||
public static final String TRUE = "true";
|
||||
public static final String TRY = "try";
|
||||
public static final String TYPEDEF = "typedef";
|
||||
public static final String TYPEID = "typeid";
|
||||
public static final String TYPENAME = "typename";
|
||||
public static final String UNION = "union";
|
||||
public static final String UNSIGNED = "unsigned";
|
||||
public static final String USING = "using";
|
||||
public static final String VIRTUAL = "virtual";
|
||||
public static final String VOID = "void";
|
||||
public static final String VOLATILE = "volatile";
|
||||
public static final String WCHAR_T = "wchar_t";
|
||||
public static final String WHILE = "while";
|
||||
public static final String XOR = "xor";
|
||||
public static final String XOR_EQ = "xor_eq";
|
||||
public static final String _BOOL = "_Bool"; //$NON-NLS-1$
|
||||
public static final String _COMPLEX = "_Complex"; //$NON-NLS-1$
|
||||
public static final String _IMAGINARY = "_Imaginary"; //$NON-NLS-1$
|
||||
public static final String AND = "and"; //$NON-NLS-1$
|
||||
public static final String AND_EQ = "and_eq"; //$NON-NLS-1$
|
||||
public static final String ASM = "asm"; //$NON-NLS-1$
|
||||
public static final String AUTO = "auto"; //$NON-NLS-1$
|
||||
public static final String BITAND = "bitand"; //$NON-NLS-1$
|
||||
public static final String BITOR = "bitor"; //$NON-NLS-1$
|
||||
public static final String BOOL = "bool"; //$NON-NLS-1$
|
||||
public static final String BREAK = "break"; //$NON-NLS-1$
|
||||
public static final String CASE = "case"; //$NON-NLS-1$
|
||||
public static final String CATCH = "catch"; //$NON-NLS-1$
|
||||
public static final String CHAR = "char"; //$NON-NLS-1$
|
||||
public static final String CLASS = "class"; //$NON-NLS-1$
|
||||
public static final String COMPL = "compl"; //$NON-NLS-1$
|
||||
public static final String CONST = "const"; //$NON-NLS-1$
|
||||
public static final String CONST_CAST = "const_cast"; //$NON-NLS-1$
|
||||
public static final String CONTINUE = "continue"; //$NON-NLS-1$
|
||||
public static final String DEFAULT = "default"; //$NON-NLS-1$
|
||||
public static final String DELETE = "delete"; //$NON-NLS-1$
|
||||
public static final String DO = "do"; //$NON-NLS-1$
|
||||
public static final String DOUBLE = "double"; //$NON-NLS-1$
|
||||
public static final String DYNAMIC_CAST = "dynamic_cast"; //$NON-NLS-1$
|
||||
public static final String ELSE = "else"; //$NON-NLS-1$
|
||||
public static final String ENUM = "enum"; //$NON-NLS-1$
|
||||
public static final String EXPLICIT = "explicit"; //$NON-NLS-1$
|
||||
public static final String EXPORT = "export"; //$NON-NLS-1$
|
||||
public static final String EXTERN = "extern"; //$NON-NLS-1$
|
||||
public static final String FALSE = "false"; //$NON-NLS-1$
|
||||
public static final String FLOAT = "float"; //$NON-NLS-1$
|
||||
public static final String FOR = "for"; //$NON-NLS-1$
|
||||
public static final String FRIEND = "friend"; //$NON-NLS-1$
|
||||
public static final String GOTO = "goto"; //$NON-NLS-1$
|
||||
public static final String IF = "if"; //$NON-NLS-1$
|
||||
public static final String INLINE = "inline"; //$NON-NLS-1$
|
||||
public static final String INT = "int"; //$NON-NLS-1$
|
||||
public static final String LONG = "long"; //$NON-NLS-1$
|
||||
public static final String MUTABLE = "mutable"; //$NON-NLS-1$
|
||||
public static final String NAMESPACE = "namespace"; //$NON-NLS-1$
|
||||
public static final String NEW = "new"; //$NON-NLS-1$
|
||||
public static final String NOT = "not"; //$NON-NLS-1$
|
||||
public static final String NOT_EQ = "not_eq"; //$NON-NLS-1$
|
||||
public static final String OPERATOR = "operator"; //$NON-NLS-1$
|
||||
public static final String OR = "or"; //$NON-NLS-1$
|
||||
public static final String OR_EQ = "or_eq"; //$NON-NLS-1$
|
||||
public static final String PRIVATE = "private"; //$NON-NLS-1$
|
||||
public static final String PROTECTED = "protected"; //$NON-NLS-1$
|
||||
public static final String PUBLIC = "public"; //$NON-NLS-1$
|
||||
public static final String REGISTER = "register"; //$NON-NLS-1$
|
||||
public static final String REINTERPRET_CAST = "reinterpret_cast"; //$NON-NLS-1$
|
||||
public static final String RESTRICT = "restrict"; //$NON-NLS-1$
|
||||
public static final String RETURN = "return"; //$NON-NLS-1$
|
||||
public static final String SHORT = "short"; //$NON-NLS-1$
|
||||
public static final String SIGNED = "signed"; //$NON-NLS-1$
|
||||
public static final String SIZEOF = "sizeof"; //$NON-NLS-1$
|
||||
public static final String STATIC = "static"; //$NON-NLS-1$
|
||||
public static final String STATIC_CAST = "static_cast"; //$NON-NLS-1$
|
||||
public static final String STRUCT = "struct"; //$NON-NLS-1$
|
||||
public static final String SWITCH = "switch"; //$NON-NLS-1$
|
||||
public static final String TEMPLATE = "template"; //$NON-NLS-1$
|
||||
public static final String THIS = "this"; //$NON-NLS-1$
|
||||
public static final String THROW = "throw"; //$NON-NLS-1$
|
||||
public static final String TRUE = "true"; //$NON-NLS-1$
|
||||
public static final String TRY = "try"; //$NON-NLS-1$
|
||||
public static final String TYPEDEF = "typedef"; //$NON-NLS-1$
|
||||
public static final String TYPEID = "typeid"; //$NON-NLS-1$
|
||||
public static final String TYPENAME = "typename"; //$NON-NLS-1$
|
||||
public static final String UNION = "union"; //$NON-NLS-1$
|
||||
public static final String UNSIGNED = "unsigned"; //$NON-NLS-1$
|
||||
public static final String USING = "using"; //$NON-NLS-1$
|
||||
public static final String VIRTUAL = "virtual"; //$NON-NLS-1$
|
||||
public static final String VOID = "void"; //$NON-NLS-1$
|
||||
public static final String VOLATILE = "volatile"; //$NON-NLS-1$
|
||||
public static final String WCHAR_T = "wchar_t"; //$NON-NLS-1$
|
||||
public static final String WHILE = "while"; //$NON-NLS-1$
|
||||
public static final String XOR = "xor"; //$NON-NLS-1$
|
||||
public static final String XOR_EQ = "xor_eq"; //$NON-NLS-1$
|
||||
|
||||
}
|
||||
|
|
|
@ -221,8 +221,8 @@ public interface IASTFactory
|
|||
|
||||
public boolean queryIsTypeName( IASTScope scope, ITokenDuple nameInQuestion ) ;
|
||||
|
||||
static final String DOUBLE_COLON = "::";
|
||||
static final String TELTA = "~";
|
||||
static final String DOUBLE_COLON = "::"; //$NON-NLS-1$
|
||||
static final String TELTA = "~"; //$NON-NLS-1$
|
||||
/**
|
||||
* @param scope
|
||||
* @return
|
||||
|
|
|
@ -72,7 +72,7 @@ public class ContextualParser extends CompleteParser {
|
|||
* @return
|
||||
*/
|
||||
protected String getCompletionPrefix() {
|
||||
return ( finalToken == null ? "" : finalToken.getImage() );
|
||||
return ( finalToken == null ? "" : finalToken.getImage() ); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -601,7 +601,7 @@ public class DeclarationWrapper implements IDeclaratorOwner
|
|||
declarator.getPointerOperators(),
|
||||
declarator.getArrayModifiers(),
|
||||
null, null, declarator.getName() == null
|
||||
? ""
|
||||
? "" //$NON-NLS-1$
|
||||
: declarator.getName(), declarator.getInitializerClause(), wrapper.getStartingOffset(), getStartingLine(), declarator.getNameStartOffset(), declarator.getNameEndOffset(), declarator.getNameLine(), wrapper.getEndOffset(), getEndLine()));
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
@ -39,7 +39,7 @@ public class Declarator implements IParameterCollection, IDeclaratorOwner, IDecl
|
|||
private boolean pureVirtual = false;
|
||||
private final IDeclaratorOwner owner;
|
||||
private Declarator ownedDeclarator = null;
|
||||
private String name = "";
|
||||
private String name = ""; //$NON-NLS-1$
|
||||
private IASTInitializerClause initializerClause = null;
|
||||
private List ptrOps = new ArrayList();
|
||||
private List parameters = new ArrayList();
|
||||
|
|
|
@ -431,7 +431,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
secondExpression,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e)
|
||||
{
|
||||
|
@ -541,7 +541,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
null,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e)
|
||||
{
|
||||
|
@ -574,7 +574,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
secondExpression,
|
||||
thirdExpression,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e)
|
||||
{
|
||||
|
@ -609,7 +609,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
secondExpression,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e)
|
||||
{
|
||||
|
@ -642,7 +642,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
secondExpression,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e)
|
||||
{
|
||||
|
@ -676,7 +676,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
secondExpression,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e)
|
||||
{
|
||||
|
@ -711,7 +711,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
secondExpression,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e)
|
||||
{
|
||||
|
@ -745,7 +745,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
secondExpression,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e)
|
||||
{
|
||||
|
@ -786,7 +786,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
secondExpression,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e)
|
||||
{
|
||||
|
@ -863,7 +863,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
secondExpression,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e)
|
||||
{
|
||||
|
@ -907,7 +907,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
secondExpression,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e)
|
||||
{
|
||||
|
@ -950,7 +950,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
secondExpression,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e)
|
||||
{
|
||||
|
@ -1004,7 +1004,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
secondExpression,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e)
|
||||
{
|
||||
|
@ -1047,7 +1047,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
secondExpression,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e)
|
||||
{
|
||||
|
@ -1090,7 +1090,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
null,
|
||||
null,
|
||||
typeId,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e)
|
||||
{
|
||||
|
@ -1331,7 +1331,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
null,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e)
|
||||
{
|
||||
|
@ -1468,7 +1468,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
return astFactory.createExpression(
|
||||
scope, IASTExpression.Kind.NEW_TYPEID,
|
||||
null, null, null, typeId, null,
|
||||
"", astFactory.createNewDescriptor(newPlacementExpressions, newTypeIdExpressions, newInitializerExpressions));
|
||||
"", astFactory.createNewDescriptor(newPlacementExpressions, newTypeIdExpressions, newInitializerExpressions)); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e)
|
||||
{
|
||||
|
@ -1516,7 +1516,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
return astFactory.createExpression(
|
||||
scope, IASTExpression.Kind.NEW_TYPEID,
|
||||
null, null, null, typeId, null,
|
||||
"", astFactory.createNewDescriptor(newPlacementExpressions, newTypeIdExpressions, newInitializerExpressions));
|
||||
"", astFactory.createNewDescriptor(newPlacementExpressions, newTypeIdExpressions, newInitializerExpressions)); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e)
|
||||
{
|
||||
|
@ -1600,7 +1600,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
null,
|
||||
null,
|
||||
d,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e)
|
||||
{
|
||||
|
@ -1619,7 +1619,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
null,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e1)
|
||||
{
|
||||
|
@ -1693,7 +1693,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
null,
|
||||
null,
|
||||
nestedName,
|
||||
"",
|
||||
"", //$NON-NLS-1$
|
||||
null );
|
||||
} catch (ASTSemanticException ase ) {
|
||||
throw backtrack;
|
||||
|
@ -1801,7 +1801,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
null,
|
||||
null,
|
||||
typeId,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e6)
|
||||
{
|
||||
|
@ -1835,7 +1835,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
secondExpression,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e2)
|
||||
{
|
||||
|
@ -1861,7 +1861,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
secondExpression,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e3)
|
||||
{
|
||||
|
@ -1884,7 +1884,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
null,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e1)
|
||||
{
|
||||
|
@ -1907,7 +1907,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
null,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e4)
|
||||
{
|
||||
|
@ -1948,7 +1948,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
secondExpression,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e5)
|
||||
{
|
||||
|
@ -1988,7 +1988,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
secondExpression,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e)
|
||||
{
|
||||
|
@ -2045,7 +2045,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
null,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e)
|
||||
{
|
||||
|
@ -2177,7 +2177,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
null,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e7)
|
||||
{
|
||||
|
@ -2199,7 +2199,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
null,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e6)
|
||||
{
|
||||
|
@ -2263,7 +2263,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
null,
|
||||
null,
|
||||
null,
|
||||
duple, "", null);
|
||||
duple, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e8)
|
||||
{
|
||||
|
@ -2282,7 +2282,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
null,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
} catch (ASTSemanticException e9) {
|
||||
// TODO Auto-generated catch block
|
||||
e9.printStackTrace();
|
||||
|
@ -2322,7 +2322,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
}
|
||||
catch (ScannerException e)
|
||||
{
|
||||
log.traceLog( "ScannerException thrown : " + e.getProblem().getMessage() );
|
||||
log.traceLog( "ScannerException thrown : " + e.getProblem().getMessage() ); //$NON-NLS-1$
|
||||
log.errorLog( "Scanner Exception: " + e.getProblem().getMessage()); //$NON-NLS-1$h
|
||||
failParse();
|
||||
return fetchToken();
|
||||
|
@ -2438,7 +2438,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
assignmentExpression,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e)
|
||||
{
|
||||
|
@ -2469,7 +2469,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
null,
|
||||
null,
|
||||
null,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e)
|
||||
{
|
||||
|
@ -2497,7 +2497,7 @@ public class ExpressionParser implements IExpressionParser {
|
|||
null,
|
||||
null,
|
||||
duple,
|
||||
null, "", null);
|
||||
null, "", null); //$NON-NLS-1$
|
||||
}
|
||||
catch (ASTSemanticException e)
|
||||
{
|
||||
|
|
|
@ -106,12 +106,12 @@ public abstract class Parser extends ExpressionParser implements IParser
|
|||
// Util.setDebugging(true);
|
||||
// Or set debug to true in the core plugin preference
|
||||
log.traceLog(
|
||||
"Parse "
|
||||
"Parse " //$NON-NLS-1$
|
||||
+ (++parseCount)
|
||||
+ ": "
|
||||
+ ": " //$NON-NLS-1$
|
||||
+ (System.currentTimeMillis() - startTime)
|
||||
+ "ms"
|
||||
+ (parsePassed ? "" : " - parse failure") );
|
||||
+ "ms" //$NON-NLS-1$
|
||||
+ (parsePassed ? "" : " - parse failure") ); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
return parsePassed;
|
||||
}
|
||||
|
||||
|
@ -575,7 +575,7 @@ public abstract class Parser extends ExpressionParser implements IParser
|
|||
returnValue.add(
|
||||
astFactory.createTemplateParameter(
|
||||
kind,
|
||||
( id == null )? "" : id.getImage(),
|
||||
( id == null )? "" : id.getImage(), //$NON-NLS-1$
|
||||
(typeId == null) ? null : typeId.getTypeOrClassName(),
|
||||
null,
|
||||
null));
|
||||
|
@ -613,8 +613,8 @@ public abstract class Parser extends ExpressionParser implements IParser
|
|||
returnValue.add(
|
||||
astFactory.createTemplateParameter(
|
||||
IASTTemplateParameter.ParamKind.TEMPLATE_LIST,
|
||||
( optionalId == null )? "" : optionalId.getImage(),
|
||||
( optionalTypeId == null ) ? "" : optionalTypeId.toString(),
|
||||
( optionalId == null )? "" : optionalId.getImage(), //$NON-NLS-1$
|
||||
( optionalTypeId == null ) ? "" : optionalTypeId.toString(), //$NON-NLS-1$
|
||||
null,
|
||||
subResult));
|
||||
}
|
||||
|
@ -650,7 +650,7 @@ public abstract class Parser extends ExpressionParser implements IParser
|
|||
declarator.getPointerOperators(),
|
||||
declarator.getArrayModifiers(),
|
||||
null, null, declarator.getName() == null
|
||||
? ""
|
||||
? "" //$NON-NLS-1$
|
||||
: declarator.getName(), declarator.getInitializerClause(), wrapper.getStartingOffset(), wrapper.getStartingLine(), declarator.getNameStartOffset(), declarator.getNameEndOffset(), declarator.getNameLine(), wrapper.getEndOffset(), wrapper.getEndLine()),
|
||||
null));
|
||||
}
|
||||
|
@ -831,7 +831,7 @@ public abstract class Parser extends ExpressionParser implements IParser
|
|||
namespaceDefinition =
|
||||
astFactory.createNamespaceDefinition(
|
||||
scope,
|
||||
(identifier == null ? "" : identifier.getImage()),
|
||||
(identifier == null ? "" : identifier.getImage()), //$NON-NLS-1$
|
||||
first.getOffset(),
|
||||
first.getLineNumber(),
|
||||
(identifier == null ? first.getOffset() : identifier.getOffset()),
|
||||
|
@ -2112,7 +2112,7 @@ public abstract class Parser extends ExpressionParser implements IParser
|
|||
{
|
||||
failParse();
|
||||
log.traceLog(
|
||||
"Unexpected Token ="
|
||||
"Unexpected Token =" //$NON-NLS-1$
|
||||
+ image );
|
||||
consume();
|
||||
// eat this token anyway
|
||||
|
@ -2141,7 +2141,7 @@ public abstract class Parser extends ExpressionParser implements IParser
|
|||
// check for optional pure virtual
|
||||
if (LT(1) == IToken.tASSIGN
|
||||
&& LT(2) == IToken.tINTEGER
|
||||
&& LA(2).getImage().equals("0"))
|
||||
&& LA(2).getImage().equals("0")) //$NON-NLS-1$
|
||||
{
|
||||
consume(IToken.tASSIGN);
|
||||
consume(IToken.tINTEGER);
|
||||
|
@ -2265,7 +2265,7 @@ public abstract class Parser extends ExpressionParser implements IParser
|
|||
{
|
||||
enumeration = astFactory.createEnumerationSpecifier(
|
||||
sdw.getScope(),
|
||||
((identifier == null) ? "" : identifier.getImage()),
|
||||
((identifier == null) ? "" : identifier.getImage()), //$NON-NLS-1$
|
||||
mark.getOffset(),
|
||||
mark.getLineNumber(),
|
||||
((identifier == null)
|
||||
|
|
|
@ -37,15 +37,15 @@ public class SelectionParser extends ContextualParser {
|
|||
protected void handleNewToken(IToken value) {
|
||||
if( value != null && scanner.isOnTopContext() )
|
||||
{
|
||||
log.traceLog( "IToken provided w/offsets " + value.getOffset() + " & " + value.getEndOffset() );
|
||||
log.traceLog( "IToken provided w/offsets " + value.getOffset() + " & " + value.getEndOffset() ); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
if( value.getOffset() == offsetRange.getFloorOffset() )
|
||||
{
|
||||
log.traceLog( "Offset Floor Hit w/token \"" + value.getImage() + "\"");
|
||||
log.traceLog( "Offset Floor Hit w/token \"" + value.getImage() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
firstTokenOfDuple = value;
|
||||
}
|
||||
if( value.getEndOffset() == offsetRange.getCeilingOffset() )
|
||||
{
|
||||
log.traceLog( "Offset Ceiling Hit w/token \"" + value.getImage() + "\"");
|
||||
log.traceLog( "Offset Ceiling Hit w/token \"" + value.getImage() + "\""); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
lastTokenOfDuple = value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ public class BaseASTFactory {
|
|||
public IASTDesignator createDesignator(DesignatorKind kind, IASTExpression constantExpression, IToken fieldIdentifier)
|
||||
{
|
||||
return new ASTDesignator( kind, constantExpression,
|
||||
fieldIdentifier == null ? "" : fieldIdentifier.getImage(),
|
||||
fieldIdentifier == null ? "" : fieldIdentifier.getImage(), //$NON-NLS-1$
|
||||
fieldIdentifier == null ? -1 : fieldIdentifier.getOffset() );
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ public class ASTExpression implements IASTExpression
|
|||
this.newDescriptor = newDescriptor;
|
||||
this.references = references;
|
||||
this.idExpressionDuple = idExpression;
|
||||
this.idExpression = idExpressionDuple == null ? "" : idExpressionDuple.toString();
|
||||
this.idExpression = idExpressionDuple == null ? "" : idExpressionDuple.toString(); //$NON-NLS-1$
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.parser.ast.IASTExpression#getExpressionKind()
|
||||
|
|
|
@ -49,7 +49,7 @@ public class ASTTypeId implements IASTTypeId
|
|||
public ASTTypeId( Type kind, ITokenDuple duple, List pointerOps, List arrayMods, String signature,
|
||||
boolean isConst, boolean isVolatile, boolean isUnsigned, boolean isSigned, boolean isShort, boolean isLong, boolean isTypeName )
|
||||
{
|
||||
typeName = ( duple == null ) ? "" : duple.toString() ;
|
||||
typeName = ( duple == null ) ? "" : duple.toString() ; //$NON-NLS-1$
|
||||
this.tokenDuple = duple;
|
||||
this.kind = kind;
|
||||
this.pointerOps = pointerOps;
|
||||
|
|
|
@ -56,7 +56,7 @@ public class ASTUsingDirective extends ASTAnonymousDeclaration implements IASTUs
|
|||
{
|
||||
buffer.append( fqn[ i ] );
|
||||
if( i + 1 != fqn.length )
|
||||
buffer.append( "::");
|
||||
buffer.append( "::"); //$NON-NLS-1$
|
||||
}
|
||||
return buffer.toString();
|
||||
}
|
||||
|
|
|
@ -423,7 +423,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
|||
ISymbol namespaceSymbol = null;
|
||||
|
||||
|
||||
if( ! identifier.equals( "" ) )
|
||||
if( ! identifier.equals( "" ) ) //$NON-NLS-1$
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -443,7 +443,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
|||
else
|
||||
{
|
||||
namespaceSymbol = pst.newContainerSymbol( identifier, TypeInfo.t_namespace );
|
||||
if( identifier.equals( "" ) )
|
||||
if( identifier.equals( "" ) ) //$NON-NLS-1$
|
||||
namespaceSymbol.setContainingSymbol( pstScope );
|
||||
else
|
||||
{
|
||||
|
@ -544,7 +544,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
|||
TypeInfo.eType pstType = classKindToTypeInfo(kind);
|
||||
List references = new ArrayList();
|
||||
|
||||
String newSymbolName = "";
|
||||
String newSymbolName = ""; //$NON-NLS-1$
|
||||
|
||||
if( name != null ){
|
||||
IToken lastToken = name.getLastToken();
|
||||
|
@ -561,7 +561,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
|||
}
|
||||
|
||||
ISymbol classSymbol = null;
|
||||
if( !newSymbolName.equals("") ){
|
||||
if( !newSymbolName.equals("") ){ //$NON-NLS-1$
|
||||
try
|
||||
{
|
||||
classSymbol = currentScopeSymbol.lookupMemberForDefinition(newSymbolName);
|
||||
|
@ -870,7 +870,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
|||
// go up the scope until you hit a class
|
||||
if (kind == IASTExpression.Kind.PRIMARY_THIS){
|
||||
try{
|
||||
symbol = startingScope.lookup("this");
|
||||
symbol = startingScope.lookup("this"); //$NON-NLS-1$
|
||||
}catch (ParserSymbolTableException e){
|
||||
throw new ASTSemanticException();
|
||||
}
|
||||
|
@ -1515,7 +1515,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
|||
getExpressionReferences( expressionList, references );
|
||||
return new ASTConstructorMemberInitializer(
|
||||
expressionList,
|
||||
duple == null ? "" : duple.toString(),
|
||||
duple == null ? "" : duple.toString(), //$NON-NLS-1$
|
||||
duple == null ? 0 : duple.getFirstToken().getOffset(),
|
||||
references, requireReferenceResolution );
|
||||
}
|
||||
|
@ -1551,7 +1551,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
|||
type = TypeInfo.t__Bool;
|
||||
|
||||
List references = new ArrayList();
|
||||
ISymbol s = pst.newSymbol( "", type );
|
||||
ISymbol s = pst.newSymbol( "", type ); //$NON-NLS-1$
|
||||
if( kind == IASTSimpleTypeSpecifier.Type.CLASS_OR_TYPENAME )
|
||||
{
|
||||
// lookup the duple
|
||||
|
@ -1849,7 +1849,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
|||
newReferences.add( createReference( xrefSymbol, elab.getName(), elab.getNameOffset()) );
|
||||
}
|
||||
|
||||
String paramName = "";
|
||||
String paramName = ""; //$NON-NLS-1$
|
||||
if(absDecl instanceof IASTParameterDeclaration){
|
||||
paramName = ((IASTParameterDeclaration)absDecl).getName();
|
||||
}
|
||||
|
@ -2091,7 +2091,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
|||
while( initializers.hasNext())
|
||||
{
|
||||
IASTConstructorMemberInitializer initializer = (IASTConstructorMemberInitializer)initializers.next();
|
||||
if( !initializer.getName().equals( "") &&
|
||||
if( !initializer.getName().equals( "") && //$NON-NLS-1$
|
||||
initializer instanceof ASTConstructorMemberInitializer &&
|
||||
((ASTConstructorMemberInitializer)initializer).requiresNameResolution() )
|
||||
{
|
||||
|
@ -2157,7 +2157,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
|||
int tokencount = tokenizer.countTokens();
|
||||
if(tokencount > 1){
|
||||
List tokens = new ArrayList();
|
||||
String oneToken = "";
|
||||
String oneToken = ""; //$NON-NLS-1$
|
||||
// This is NOT a function. This is a method definition
|
||||
while (tokenizer.hasMoreTokens()){
|
||||
oneToken = tokenizer.nextToken();
|
||||
|
@ -2696,7 +2696,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
|||
public IASTCodeScope createNewCodeBlock(IASTScope scope) {
|
||||
IContainerSymbol symbol = scopeToSymbol( scope );
|
||||
|
||||
IContainerSymbol newScope = pst.newContainerSymbol("", TypeInfo.t_block);
|
||||
IContainerSymbol newScope = pst.newContainerSymbol("", TypeInfo.t_block); //$NON-NLS-1$
|
||||
newScope.setContainingSymbol(symbol);
|
||||
|
||||
ASTCodeScope codeScope = new ASTCodeScope( newScope );
|
||||
|
@ -2742,7 +2742,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
|||
boolean isLong, boolean isSigned, boolean isUnsigned, boolean isTypename, ITokenDuple name, List pointerOps, List arrayMods) throws ASTSemanticException
|
||||
{
|
||||
ASTTypeId result =
|
||||
new ASTTypeId( kind, name, pointerOps, arrayMods, "", //TODO
|
||||
new ASTTypeId( kind, name, pointerOps, arrayMods, "", //TODO //$NON-NLS-1$
|
||||
isConst, isVolatile, isUnsigned, isSigned, isShort, isLong, isTypename );
|
||||
result.setTypeSymbol( createSymbolForTypeId( scope, result ) );
|
||||
return result;
|
||||
|
@ -2780,7 +2780,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
|||
if( id == null ) return null;
|
||||
|
||||
ASTTypeId typeId = (ASTTypeId)id;
|
||||
ISymbol result = pst.newSymbol( "", CompleteParseASTFactory.getTypeKind(id));
|
||||
ISymbol result = pst.newSymbol( "", CompleteParseASTFactory.getTypeKind(id)); //$NON-NLS-1$
|
||||
|
||||
result.getTypeInfo().setBit( id.isConst(), TypeInfo.isConst );
|
||||
result.getTypeInfo().setBit( id.isVolatile(), TypeInfo.isVolatile );
|
||||
|
|
|
@ -106,11 +106,11 @@ public class ASTExpression implements IASTExpression {
|
|||
{
|
||||
try
|
||||
{
|
||||
if( getLiteralString().startsWith( "0x") || getLiteralString().startsWith( "0x") )
|
||||
if( getLiteralString().startsWith( "0x") || getLiteralString().startsWith( "0x") ) //$NON-NLS-1$ //$NON-NLS-2$
|
||||
{
|
||||
return Integer.parseInt( getLiteralString().substring(2), 16 );
|
||||
}
|
||||
if( getLiteralString().startsWith( "0") && getLiteralString().length() > 1 )
|
||||
if( getLiteralString().startsWith( "0") && getLiteralString().length() > 1 ) //$NON-NLS-1$
|
||||
return Integer.parseInt( getLiteralString().substring(1), 8 );
|
||||
return Integer.parseInt( getLiteralString() );
|
||||
}
|
||||
|
|
|
@ -384,7 +384,7 @@ public class ExpressionParseASTFactory implements IASTFactory {
|
|||
rhs,
|
||||
thirdExpression,
|
||||
typeId,
|
||||
idExpression == null ? "" : idExpression.toString(),
|
||||
idExpression == null ? "" : idExpression.toString(), //$NON-NLS-1$
|
||||
literal,
|
||||
newDescriptor,
|
||||
extensionFactory.createExpressionExtension());
|
||||
|
@ -395,7 +395,7 @@ public class ExpressionParseASTFactory implements IASTFactory {
|
|||
rhs,
|
||||
thirdExpression,
|
||||
typeId,
|
||||
idExpression == null ? "" : idExpression.toString(),
|
||||
idExpression == null ? "" : idExpression.toString(), //$NON-NLS-1$
|
||||
literal,
|
||||
newDescriptor,
|
||||
new IASTExpressionExtension() {
|
||||
|
|
|
@ -35,14 +35,14 @@ public class ASTSimpleTypeSpecifier extends ASTNode implements IASTSimpleTypeSpe
|
|||
static
|
||||
{
|
||||
nameMap = new Hashtable();
|
||||
nameMap.put( Type.BOOL, "bool");
|
||||
nameMap.put( Type.CHAR, "char");
|
||||
nameMap.put( Type.DOUBLE, "double");
|
||||
nameMap.put( Type.FLOAT, "float");
|
||||
nameMap.put( Type.INT, "int");
|
||||
nameMap.put( Type.VOID, "void" );
|
||||
nameMap.put( Type.WCHAR_T, "wchar_t" );
|
||||
nameMap.put( Type._BOOL, "_Bool");
|
||||
nameMap.put( Type.BOOL, "bool"); //$NON-NLS-1$
|
||||
nameMap.put( Type.CHAR, "char"); //$NON-NLS-1$
|
||||
nameMap.put( Type.DOUBLE, "double"); //$NON-NLS-1$
|
||||
nameMap.put( Type.FLOAT, "float"); //$NON-NLS-1$
|
||||
nameMap.put( Type.INT, "int"); //$NON-NLS-1$
|
||||
nameMap.put( Type.VOID, "void" ); //$NON-NLS-1$
|
||||
nameMap.put( Type.WCHAR_T, "wchar_t" ); //$NON-NLS-1$
|
||||
nameMap.put( Type._BOOL, "_Bool"); //$NON-NLS-1$
|
||||
}
|
||||
/**
|
||||
* @param kind
|
||||
|
@ -63,9 +63,9 @@ public class ASTSimpleTypeSpecifier extends ASTNode implements IASTSimpleTypeSpe
|
|||
if( this.kind == IASTSimpleTypeSpecifier.Type.CHAR || this.kind == IASTSimpleTypeSpecifier.Type.WCHAR_T )
|
||||
{
|
||||
if (isUnsigned())
|
||||
type.append("unsigned ");
|
||||
type.append("unsigned "); //$NON-NLS-1$
|
||||
else if( isSigned() )
|
||||
type.append("signed ");
|
||||
type.append("signed "); //$NON-NLS-1$
|
||||
type.append( (String)nameMap.get( this.kind ));
|
||||
}
|
||||
else if( this.kind == Type.BOOL || this.kind == Type.VOID || this.kind == Type._BOOL )
|
||||
|
@ -75,47 +75,47 @@ public class ASTSimpleTypeSpecifier extends ASTNode implements IASTSimpleTypeSpe
|
|||
else if( this.kind == Type.INT )
|
||||
{
|
||||
if (isUnsigned())
|
||||
type.append("unsigned ");
|
||||
type.append("unsigned "); //$NON-NLS-1$
|
||||
if (isShort())
|
||||
type.append("short ");
|
||||
type.append("short "); //$NON-NLS-1$
|
||||
if (isLong())
|
||||
type.append("long ");
|
||||
type.append("long "); //$NON-NLS-1$
|
||||
type.append( (String)nameMap.get( this.kind ));
|
||||
}
|
||||
else if( this.kind == Type.FLOAT )
|
||||
{
|
||||
type.append( (String)nameMap.get( this.kind ));
|
||||
if( isComplex() )
|
||||
type.append( "_Complex" );
|
||||
type.append( "_Complex" ); //$NON-NLS-1$
|
||||
else if( isImaginary() )
|
||||
type.append( "_Imaginary" );
|
||||
type.append( "_Imaginary" ); //$NON-NLS-1$
|
||||
}
|
||||
else if( this.kind == Type.DOUBLE )
|
||||
{
|
||||
if (isLong())
|
||||
type.append("long ");
|
||||
type.append("long "); //$NON-NLS-1$
|
||||
type.append( (String)nameMap.get( this.kind ));
|
||||
if( isComplex() )
|
||||
type.append( "_Complex" );
|
||||
type.append( "_Complex" ); //$NON-NLS-1$
|
||||
else if( isImaginary() )
|
||||
type.append( "_Imaginary" );
|
||||
type.append( "_Imaginary" ); //$NON-NLS-1$
|
||||
}
|
||||
else if( this.kind == Type.CLASS_OR_TYPENAME || this.kind == Type.TEMPLATE )
|
||||
{
|
||||
if (isTypename() )
|
||||
type.append("typename ");
|
||||
type.append("typename "); //$NON-NLS-1$
|
||||
type.append(typeName.toString());
|
||||
}
|
||||
else if( this.kind == Type.UNSPECIFIED )
|
||||
{
|
||||
if (isUnsigned())
|
||||
type.append("unsigned ");
|
||||
type.append("unsigned "); //$NON-NLS-1$
|
||||
if (isShort())
|
||||
type.append("short ");
|
||||
type.append("short "); //$NON-NLS-1$
|
||||
if (isLong())
|
||||
type.append("long ");
|
||||
type.append("long "); //$NON-NLS-1$
|
||||
if (isSigned())
|
||||
type.append("signed ");
|
||||
type.append("signed "); //$NON-NLS-1$
|
||||
}
|
||||
this.typeName = type.toString();
|
||||
}
|
||||
|
|
|
@ -129,7 +129,7 @@ public class QuickParseASTFactory extends BaseASTFactory implements IASTFactory
|
|||
* @see org.eclipse.cdt.core.parser.ast.IASTFactory#createClassSpecifier(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, org.eclipse.cdt.core.parser.ast.ClassKind, org.eclipse.cdt.core.parser.ast.ClassNameType, org.eclipse.cdt.core.parser.ast.AccessVisibility, org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration)
|
||||
*/
|
||||
public IASTClassSpecifier createClassSpecifier(IASTScope scope, ITokenDuple name, ASTClassKind kind, ClassNameType type, ASTAccessVisibility access, int startingOffset, int startingLine, int nameOffset, int nameEndOffset, int nameLine ) {
|
||||
return new ASTClassSpecifier( scope, name == null ? "" : name.toString() , kind, type, startingOffset, startingLine, nameOffset, nameEndOffset, nameLine, access );
|
||||
return new ASTClassSpecifier( scope, name == null ? "" : name.toString() , kind, type, startingOffset, startingLine, nameOffset, nameEndOffset, nameLine, access ); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
@ -164,9 +164,9 @@ public class QuickParseASTFactory extends BaseASTFactory implements IASTFactory
|
|||
if( CREATE_EXCESS_CONSTRUCTS )
|
||||
{
|
||||
try {
|
||||
return new ASTExpression( kind, lhs, rhs, thirdExpression, typeId, idExpression == null ? "" : idExpression.toString(), literal, newDescriptor, extensionFactory.createExpressionExtension() );
|
||||
return new ASTExpression( kind, lhs, rhs, thirdExpression, typeId, idExpression == null ? "" : idExpression.toString(), literal, newDescriptor, extensionFactory.createExpressionExtension() ); //$NON-NLS-1$
|
||||
} catch (ASTNotImplementedException e) {
|
||||
return new ASTExpression( kind, lhs, rhs, thirdExpression, typeId, idExpression == null ? "" : idExpression.toString(), literal, newDescriptor, new IASTExpressionExtension() {
|
||||
return new ASTExpression( kind, lhs, rhs, thirdExpression, typeId, idExpression == null ? "" : idExpression.toString(), literal, newDescriptor, new IASTExpressionExtension() { //$NON-NLS-1$
|
||||
|
||||
public void setExpression(IASTExpression expression) {
|
||||
}
|
||||
|
@ -331,7 +331,7 @@ public class QuickParseASTFactory extends BaseASTFactory implements IASTFactory
|
|||
public IASTTypeId createTypeId(IASTScope scope, Type kind, boolean isConst, boolean isVolatile, boolean isShort,
|
||||
boolean isLong, boolean isSigned, boolean isUnsigned, boolean isTypename, ITokenDuple name, List pointerOps, List arrayMods)
|
||||
{
|
||||
return new ASTTypeId( kind, name == null ? "" : name.toString(), pointerOps, arrayMods, isConst,
|
||||
return new ASTTypeId( kind, name == null ? "" : name.toString(), pointerOps, arrayMods, isConst, //$NON-NLS-1$
|
||||
isVolatile, isUnsigned, isSigned, isShort, isLong, isTypename );
|
||||
}
|
||||
|
||||
|
|
|
@ -1017,7 +1017,7 @@ public class ParserSymbolTable {
|
|||
//the only way we get here and have no parameters, is if we are looking
|
||||
//for a function that takes void parameters ie f( void )
|
||||
parameterList = new LinkedList();
|
||||
parameterList.add( currFn.getSymbolTable().newSymbol( "", TypeInfo.t_void ) );
|
||||
parameterList.add( currFn.getSymbolTable().newSymbol( "", TypeInfo.t_void ) ); //$NON-NLS-1$
|
||||
} else {
|
||||
parameterList = currFn.getParameterList();
|
||||
}
|
||||
|
|
|
@ -785,7 +785,7 @@ public final class TemplateEngine {
|
|||
ISymbol param = (ISymbol) iterator.next();
|
||||
//template type parameter
|
||||
if( param.getTypeInfo().getTemplateParameterType() == TypeInfo.t_typeName ){
|
||||
val = new TypeInfo( TypeInfo.t_type, 0, template.getSymbolTable().newSymbol( "", TypeInfo.t_class ) );
|
||||
val = new TypeInfo( TypeInfo.t_type, 0, template.getSymbolTable().newSymbol( "", TypeInfo.t_class ) ); //$NON-NLS-1$
|
||||
}
|
||||
//template parameter
|
||||
else if ( param.getTypeInfo().getTemplateParameterType() == TypeInfo.t_template ) {
|
||||
|
@ -823,7 +823,7 @@ public final class TemplateEngine {
|
|||
} catch ( ParserSymbolTableException e ){
|
||||
//we shouldn't get this because there aren't any other symbols in the template
|
||||
}
|
||||
ISymbol param = specialization.getSymbolTable().newSymbol( "", TypeInfo.t_type );
|
||||
ISymbol param = specialization.getSymbolTable().newSymbol( "", TypeInfo.t_type ); //$NON-NLS-1$
|
||||
LinkedList args = new LinkedList( specialization.getArgumentList() );
|
||||
|
||||
param.setTypeSymbol( specialization.instantiate( args ) );
|
||||
|
|
|
@ -72,7 +72,7 @@ public class ContextStack {
|
|||
if( !inclusions.add( context.getFilename() ) )
|
||||
throw new ContextException( IProblem.PREPROCESSOR_CIRCULAR_INCLUSION );
|
||||
|
||||
log.traceLog( "Scanner::ContextStack: entering inclusion " +context.getFilename());
|
||||
log.traceLog( "Scanner::ContextStack: entering inclusion " +context.getFilename()); //$NON-NLS-1$
|
||||
context.getExtension().enterScope( requestor );
|
||||
|
||||
} else if( context.getKind() == IScannerContext.ContextKind.MACROEXPANSION )
|
||||
|
@ -92,12 +92,12 @@ public class ContextStack {
|
|||
try {
|
||||
currentContext.getReader().close();
|
||||
} catch (IOException ie) {
|
||||
log.traceLog("ContextStack : Error closing reader ");
|
||||
log.traceLog("ContextStack : Error closing reader "); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
if( currentContext.getKind() == IScannerContext.ContextKind.INCLUSION )
|
||||
{
|
||||
log.traceLog( "Scanner::ContextStack: ending inclusion " +currentContext.getFilename());
|
||||
log.traceLog( "Scanner::ContextStack: ending inclusion " +currentContext.getFilename()); //$NON-NLS-1$
|
||||
inclusions.remove( currentContext.getFilename() );
|
||||
currentContext.getExtension().exitScope( requestor );
|
||||
} else if( currentContext.getKind() == IScannerContext.ContextKind.MACROEXPANSION )
|
||||
|
|
|
@ -64,7 +64,7 @@ public class DynamicMacroDescriptor implements IMacroDescriptor {
|
|||
* @see org.eclipse.cdt.core.parser.IMacroDescriptor#getCompleteSignature()
|
||||
*/
|
||||
public String getCompleteSignature() {
|
||||
return "";
|
||||
return ""; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
|
@ -74,23 +74,23 @@ public class FunctionMacroDescriptor implements IMacroDescriptor {
|
|||
StringBuffer buffer = new StringBuffer( 128 );
|
||||
int count = getParameters().size();
|
||||
|
||||
buffer.append( "MacroDescriptor with name=" + getName() + "\n" );
|
||||
buffer.append( "Number of parameters = " + count + "\n" );
|
||||
buffer.append( "MacroDescriptor with name=" + getName() + "\n" ); //$NON-NLS-2$
|
||||
buffer.append( "Number of parameters = " + count + "\n" ); //$NON-NLS-2$
|
||||
Iterator iter = getParameters().iterator();
|
||||
int current = 0;
|
||||
while( iter.hasNext() )
|
||||
{
|
||||
buffer.append( "Parameter #" + current++ + " with name=" + (String) iter.next() + "\n" );
|
||||
buffer.append( "Parameter #" + current++ + " with name=" + (String) iter.next() + "\n" ); //$NON-NLS-3$
|
||||
}
|
||||
|
||||
count = getTokenizedExpansion().size();
|
||||
iter = getTokenizedExpansion().iterator();
|
||||
|
||||
buffer.append( "Number of tokens = " + count + "\n" );
|
||||
buffer.append( "Number of tokens = " + count + "\n" ); //$NON-NLS-2$
|
||||
current = 0;
|
||||
while( iter.hasNext() )
|
||||
{
|
||||
buffer.append( "Token #" + current++ + " is " + ((IToken)iter.next()).toString() + "\n" );
|
||||
buffer.append( "Token #" + current++ + " is " + ((IToken)iter.next()).toString() + "\n" ); //$NON-NLS-3$
|
||||
}
|
||||
|
||||
return buffer.toString();
|
||||
|
|
|
@ -26,8 +26,8 @@ public class GCCScannerExtension implements IScannerExtension {
|
|||
* @see org.eclipse.cdt.core.parser.IScannerExtension#initializeMacroValue(java.lang.String)
|
||||
*/
|
||||
public String initializeMacroValue(String original) {
|
||||
if( original == null || original.trim().equals( "") )
|
||||
return "1";
|
||||
if( original == null || original.trim().equals( "") ) //$NON-NLS-1$
|
||||
return "1"; //$NON-NLS-1$
|
||||
return original;
|
||||
}
|
||||
|
||||
|
@ -37,11 +37,11 @@ public class GCCScannerExtension implements IScannerExtension {
|
|||
public void setupBuiltInMacros(ParserLanguage language) {
|
||||
if( language == ParserLanguage.CPP )
|
||||
if( scannerData.getScanner().getDefinition( IScanner.__CPLUSPLUS ) == null )
|
||||
scannerData.getScanner().addDefinition( IScanner.__CPLUSPLUS, new ObjectMacroDescriptor( IScanner.__CPLUSPLUS, "1"));
|
||||
scannerData.getScanner().addDefinition( IScanner.__CPLUSPLUS, new ObjectMacroDescriptor( IScanner.__CPLUSPLUS, "1")); //$NON-NLS-1$
|
||||
if( scannerData.getScanner().getDefinition(IScanner.__STDC_HOSTED__) == null )
|
||||
scannerData.getScanner().addDefinition(IScanner.__STDC_HOSTED__, new ObjectMacroDescriptor( IScanner.__STDC_HOSTED__, "0"));
|
||||
scannerData.getScanner().addDefinition(IScanner.__STDC_HOSTED__, new ObjectMacroDescriptor( IScanner.__STDC_HOSTED__, "0")); //$NON-NLS-1$
|
||||
if( scannerData.getScanner().getDefinition( IScanner.__STDC_VERSION__) == null )
|
||||
scannerData.getScanner().addDefinition( IScanner.__STDC_VERSION__, new ObjectMacroDescriptor( IScanner.__STDC_VERSION__, "199001L"));
|
||||
scannerData.getScanner().addDefinition( IScanner.__STDC_VERSION__, new ObjectMacroDescriptor( IScanner.__STDC_VERSION__, "199001L")); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public void setScannerData(IScannerData scannerData) {
|
||||
|
@ -60,7 +60,7 @@ public class GCCScannerExtension implements IScannerExtension {
|
|||
* @see org.eclipse.cdt.core.parser.extension.IScannerExtension#canHandlePreprocessorDirective(java.lang.String)
|
||||
*/
|
||||
public boolean canHandlePreprocessorDirective(String directive) {
|
||||
if( directive.equals("#include_next")) return true;
|
||||
if( directive.equals("#include_next")) return true; //$NON-NLS-1$
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ public class GCCScannerExtension implements IScannerExtension {
|
|||
* @see org.eclipse.cdt.core.parser.extension.IScannerExtension#handlePreprocessorDirective(java.lang.String, java.lang.String)
|
||||
*/
|
||||
public void handlePreprocessorDirective(String directive, String restOfLine) {
|
||||
if( directive.equals("#include_next") )
|
||||
if( directive.equals("#include_next") ) //$NON-NLS-1$
|
||||
{
|
||||
// figure out the name of the current file and its path
|
||||
// search through include paths
|
||||
|
|
|
@ -29,7 +29,7 @@ public class ObjectMacroDescriptor implements IMacroDescriptor {
|
|||
{
|
||||
this.name = name;
|
||||
this.expansionSignature = expansionSignature;
|
||||
fullSignature = "#define " + name + " " + expansionSignature;
|
||||
fullSignature = "#define " + name + " " + expansionSignature; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
tokenizedExpansion = EMPTY_LIST;
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ import org.eclipse.cdt.internal.core.parser.token.Token;
|
|||
|
||||
public class Scanner implements IScanner {
|
||||
|
||||
private final static String SCRATCH = "<scratch>";
|
||||
private final static String SCRATCH = "<scratch>"; //$NON-NLS-1$
|
||||
protected final IScannerData scannerData;
|
||||
|
||||
private boolean initialContextInitialized = false;
|
||||
|
@ -94,7 +94,7 @@ public class Scanner implements IScanner {
|
|||
IProblem problem = scannerData.getProblemFactory().createProblem( problemID, beginningOffset, getCurrentOffset(), scannerData.getContextStack().getCurrentLineNumber(), getCurrentFile().toCharArray(), arguments, warning, error );
|
||||
|
||||
// trace log
|
||||
StringBuffer logMessage = new StringBuffer( "Scanner problem encountered: ");
|
||||
StringBuffer logMessage = new StringBuffer( "Scanner problem encountered: "); //$NON-NLS-1$
|
||||
logMessage.append( problem.getMessage() );
|
||||
scannerData.getLogService().traceLog( logMessage.toString() );
|
||||
|
||||
|
@ -115,7 +115,7 @@ public class Scanner implements IScanner {
|
|||
//this is a hack to get around a sudden EOF experience
|
||||
scannerData.getContextStack().push(
|
||||
new ScannerContext(
|
||||
new StringReader("\n"),
|
||||
new StringReader("\n"), //$NON-NLS-1$
|
||||
START,
|
||||
ScannerContext.ContextKind.SENTINEL, null), requestor);
|
||||
|
||||
|
@ -124,8 +124,8 @@ public class Scanner implements IScanner {
|
|||
}
|
||||
|
||||
|
||||
log.traceLog( "Scanner constructed with the following configuration:");
|
||||
log.traceLog( "\tPreprocessor definitions from IScannerInfo: ");
|
||||
log.traceLog( "Scanner constructed with the following configuration:"); //$NON-NLS-1$
|
||||
log.traceLog( "\tPreprocessor definitions from IScannerInfo: "); //$NON-NLS-1$
|
||||
|
||||
if( info.getDefinedSymbols() != null )
|
||||
{
|
||||
|
@ -139,7 +139,7 @@ public class Scanner implements IScanner {
|
|||
if( value instanceof String )
|
||||
{
|
||||
addDefinition( symbolName, scannerExtension.initializeMacroValue((String) value));
|
||||
log.traceLog( "\t\tNAME = " + symbolName + " VALUE = " + value.toString() );
|
||||
log.traceLog( "\t\tNAME = " + symbolName + " VALUE = " + value.toString() ); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
++numberOfSymbolsLogged;
|
||||
|
||||
}
|
||||
|
@ -147,22 +147,22 @@ public class Scanner implements IScanner {
|
|||
addDefinition( symbolName, (IMacroDescriptor)value);
|
||||
}
|
||||
if( numberOfSymbolsLogged == 0 )
|
||||
log.traceLog( "\t\tNo definitions specified.");
|
||||
log.traceLog( "\t\tNo definitions specified."); //$NON-NLS-1$
|
||||
|
||||
}
|
||||
else
|
||||
log.traceLog( "\t\tNo definitions specified.");
|
||||
log.traceLog( "\t\tNo definitions specified."); //$NON-NLS-1$
|
||||
|
||||
|
||||
log.traceLog( "\tInclude paths from IScannerInfo: ");
|
||||
log.traceLog( "\tInclude paths from IScannerInfo: "); //$NON-NLS-1$
|
||||
if( info.getIncludePaths() != null )
|
||||
{
|
||||
overwriteIncludePath( info.getIncludePaths() );
|
||||
for( int i = 0; i < info.getIncludePaths().length; ++i )
|
||||
log.traceLog( "\t\tPATH: " + info.getIncludePaths()[i]);
|
||||
log.traceLog( "\t\tPATH: " + info.getIncludePaths()[i]); //$NON-NLS-1$
|
||||
}
|
||||
else
|
||||
log.traceLog("\t\tNo include paths specified.");
|
||||
log.traceLog("\t\tNo include paths specified."); //$NON-NLS-1$
|
||||
|
||||
setupBuiltInMacros();
|
||||
}
|
||||
|
@ -174,18 +174,18 @@ public class Scanner implements IScanner {
|
|||
|
||||
scannerExtension.setupBuiltInMacros(scannerData.getLanguage());
|
||||
if( getDefinition(__STDC__) == null )
|
||||
addDefinition( __STDC__, new ObjectMacroDescriptor( __STDC__, "1") );
|
||||
addDefinition( __STDC__, new ObjectMacroDescriptor( __STDC__, "1") ); //$NON-NLS-1$
|
||||
|
||||
if( scannerData.getLanguage() == ParserLanguage.C )
|
||||
{
|
||||
if( getDefinition(__STDC_HOSTED__) == null )
|
||||
addDefinition( __STDC_HOSTED__, new ObjectMacroDescriptor( __STDC_HOSTED__, "0"));
|
||||
addDefinition( __STDC_HOSTED__, new ObjectMacroDescriptor( __STDC_HOSTED__, "0")); //$NON-NLS-1$
|
||||
if( getDefinition( __STDC_VERSION__) == null )
|
||||
addDefinition( __STDC_VERSION__, new ObjectMacroDescriptor( __STDC_VERSION__, "199001L"));
|
||||
addDefinition( __STDC_VERSION__, new ObjectMacroDescriptor( __STDC_VERSION__, "199001L")); //$NON-NLS-1$
|
||||
}
|
||||
else
|
||||
if( getDefinition( __CPLUSPLUS ) == null )
|
||||
addDefinition( __CPLUSPLUS, new ObjectMacroDescriptor( __CPLUSPLUS, "199711L"));
|
||||
addDefinition( __CPLUSPLUS, new ObjectMacroDescriptor( __CPLUSPLUS, "199711L")); //$NON-NLS-1$
|
||||
|
||||
if( getDefinition(__FILE__) == null )
|
||||
addDefinition( __FILE__,
|
||||
|
@ -222,17 +222,17 @@ public class Scanner implements IScanner {
|
|||
if( Calendar.MONTH == Calendar.OCTOBER) return "Oct";
|
||||
if( Calendar.MONTH == Calendar.NOVEMBER) return "Nov";
|
||||
if( Calendar.MONTH == Calendar.DECEMBER) return "Dec";
|
||||
return "";
|
||||
return ""; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public String execute() {
|
||||
StringBuffer result = new StringBuffer();
|
||||
result.append( getMonth() );
|
||||
result.append(" ");
|
||||
result.append(" "); //$NON-NLS-1$
|
||||
if( Calendar.DAY_OF_MONTH < 10 )
|
||||
result.append(" ");
|
||||
result.append(" "); //$NON-NLS-1$
|
||||
result.append(Calendar.DAY_OF_MONTH);
|
||||
result.append(" ");
|
||||
result.append(" "); //$NON-NLS-1$
|
||||
result.append( Calendar.YEAR );
|
||||
return result.toString();
|
||||
}
|
||||
|
@ -559,14 +559,14 @@ public class Scanner implements IScanner {
|
|||
// constants
|
||||
private static final int NOCHAR = -1;
|
||||
|
||||
private static final String TEXT = "<text>";
|
||||
private static final String START = "<initial reader>";
|
||||
private static final String EXPRESSION = "<expression>";
|
||||
private static final String PASTING = "<pasting>";
|
||||
private static final String TEXT = "<text>"; //$NON-NLS-1$
|
||||
private static final String START = "<initial reader>"; //$NON-NLS-1$
|
||||
private static final String EXPRESSION = "<expression>"; //$NON-NLS-1$
|
||||
private static final String PASTING = "<pasting>"; //$NON-NLS-1$
|
||||
|
||||
private static final String DEFINED = "defined";
|
||||
private static final String _PRAGMA = "_Pragma";
|
||||
private static final String POUND_DEFINE = "#define ";
|
||||
private static final String DEFINED = "defined"; //$NON-NLS-1$
|
||||
private static final String _PRAGMA = "_Pragma"; //$NON-NLS-1$
|
||||
private static final String POUND_DEFINE = "#define "; //$NON-NLS-1$
|
||||
|
||||
private IScannerContext lastContext = null;
|
||||
|
||||
|
@ -634,39 +634,39 @@ public class Scanner implements IScanner {
|
|||
c = getChar(insideString);
|
||||
switch (c) {
|
||||
case '(':
|
||||
expandDefinition("??(", "[", baseOffset);
|
||||
expandDefinition("??(", "[", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
c = getChar(insideString);
|
||||
break;
|
||||
case ')':
|
||||
expandDefinition("??)", "]", baseOffset);
|
||||
expandDefinition("??)", "]", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
c = getChar(insideString);
|
||||
break;
|
||||
case '<':
|
||||
expandDefinition("??<", "{", baseOffset);
|
||||
expandDefinition("??<", "{", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
c = getChar(insideString);
|
||||
break;
|
||||
case '>':
|
||||
expandDefinition("??>", "}", baseOffset);
|
||||
expandDefinition("??>", "}", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
c = getChar(insideString);
|
||||
break;
|
||||
case '=':
|
||||
expandDefinition("??=", "#", baseOffset);
|
||||
expandDefinition("??=", "#", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
c = getChar(insideString);
|
||||
break;
|
||||
case '/':
|
||||
expandDefinition("??/", "\\", baseOffset);
|
||||
expandDefinition("??/", "\\", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
c = getChar(insideString);
|
||||
break;
|
||||
case '\'':
|
||||
expandDefinition("??\'", "^", baseOffset);
|
||||
expandDefinition("??\'", "^", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
c = getChar(insideString);
|
||||
break;
|
||||
case '!':
|
||||
expandDefinition("??!", "|", baseOffset);
|
||||
expandDefinition("??!", "|", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
c = getChar(insideString);
|
||||
break;
|
||||
case '-':
|
||||
expandDefinition("??-", "~", baseOffset);
|
||||
expandDefinition("??-", "~", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
c = getChar(insideString);
|
||||
break;
|
||||
default:
|
||||
|
@ -709,10 +709,10 @@ public class Scanner implements IScanner {
|
|||
if (c == '<') {
|
||||
c = getChar(false);
|
||||
if (c == '%') {
|
||||
expandDefinition("<%", "{", baseOffset);
|
||||
expandDefinition("<%", "{", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
c = getChar(false);
|
||||
} else if (c == ':') {
|
||||
expandDefinition("<:", "[", baseOffset);
|
||||
expandDefinition("<:", "[", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
c = getChar(false);
|
||||
} else {
|
||||
// Not a digraph
|
||||
|
@ -722,7 +722,7 @@ public class Scanner implements IScanner {
|
|||
} else if (c == ':') {
|
||||
c = getChar(false);
|
||||
if (c == '>') {
|
||||
expandDefinition(":>", "]", baseOffset);
|
||||
expandDefinition(":>", "]", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
c = getChar(false);
|
||||
} else {
|
||||
// Not a digraph
|
||||
|
@ -732,10 +732,10 @@ public class Scanner implements IScanner {
|
|||
} else if (c == '%') {
|
||||
c = getChar(false);
|
||||
if (c == '>') {
|
||||
expandDefinition("%>", "}", baseOffset);
|
||||
expandDefinition("%>", "}", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
c = getChar(false);
|
||||
} else if (c == ':') {
|
||||
expandDefinition("%:", "#", baseOffset);
|
||||
expandDefinition("%:", "#", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
c = getChar(false);
|
||||
} else {
|
||||
// Not a digraph
|
||||
|
@ -1081,17 +1081,17 @@ public class Scanner implements IScanner {
|
|||
|
||||
if( ! firstCharZero && floatingPoint && !(c >= '0' && c <= '9') ){
|
||||
//if pasting, there could actually be a float here instead of just a .
|
||||
if( buff.toString().equals( "." ) ){
|
||||
if( buff.toString().equals( "." ) ){ //$NON-NLS-1$
|
||||
if( c == '*' ){
|
||||
return newToken( IToken.tDOTSTAR, ".*", scannerData.getContextStack().getCurrentContext() );
|
||||
return newToken( IToken.tDOTSTAR, ".*", scannerData.getContextStack().getCurrentContext() ); //$NON-NLS-1$
|
||||
} else if( c == '.' ){
|
||||
if( getChar() == '.' )
|
||||
return newToken( IToken.tELLIPSIS, "...", scannerData.getContextStack().getCurrentContext() );
|
||||
return newToken( IToken.tELLIPSIS, "...", scannerData.getContextStack().getCurrentContext() ); //$NON-NLS-1$
|
||||
else
|
||||
handleProblem( IProblem.SCANNER_BAD_FLOATING_POINT, null, beginOffset, false, true );
|
||||
} else {
|
||||
ungetChar( c );
|
||||
return newToken( IToken.tDOT, ".", scannerData.getContextStack().getCurrentContext() );
|
||||
return newToken( IToken.tDOT, ".", scannerData.getContextStack().getCurrentContext() ); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
} else if (c == 'x') {
|
||||
|
@ -1212,7 +1212,7 @@ public class Scanner implements IScanner {
|
|||
int tokenType;
|
||||
String result = buff.toString();
|
||||
|
||||
if( floatingPoint && result.equals(".") )
|
||||
if( floatingPoint && result.equals(".") ) //$NON-NLS-1$
|
||||
tokenType = IToken.tDOT;
|
||||
else
|
||||
tokenType = floatingPoint ? IToken.tFLOATINGPT : IToken.tINTEGER;
|
||||
|
@ -1238,12 +1238,12 @@ public class Scanner implements IScanner {
|
|||
if( c == '#' )
|
||||
{
|
||||
if( skipped )
|
||||
handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, "# #", beginningOffset, false, true );
|
||||
handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, "# #", beginningOffset, false, true ); //$NON-NLS-1$
|
||||
else
|
||||
return newToken( tPOUNDPOUND, "##" );
|
||||
return newToken( tPOUNDPOUND, "##" ); //$NON-NLS-1$
|
||||
} else if( tokenizingMacroReplacementList ) {
|
||||
ungetChar( c );
|
||||
return newToken( tPOUND, "#" );
|
||||
return newToken( tPOUND, "#" ); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
while (((c >= 'a') && (c <= 'z'))
|
||||
|
@ -1263,7 +1263,7 @@ public class Scanner implements IScanner {
|
|||
if (directive == null) {
|
||||
if( scannerExtension.canHandlePreprocessorDirective( token ) )
|
||||
scannerExtension.handlePreprocessorDirective( token, getRestOfPreprocessorLine() );
|
||||
StringBuffer buffer = new StringBuffer( "#");
|
||||
StringBuffer buffer = new StringBuffer( "#"); //$NON-NLS-1$
|
||||
buffer.append( token );
|
||||
handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, buffer.toString(), beginningOffset, false, true );
|
||||
} else {
|
||||
|
@ -1320,8 +1320,8 @@ public class Scanner implements IScanner {
|
|||
if( isLimitReached() )
|
||||
handleCompletionOnExpression( expression );
|
||||
|
||||
if (expression.trim().equals(""))
|
||||
handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, "#if", beginningOffset, false, true );
|
||||
if (expression.trim().equals("")) //$NON-NLS-1$
|
||||
handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, "#if", beginningOffset, false, true ); //$NON-NLS-1$
|
||||
|
||||
boolean expressionEvalResult = false;
|
||||
|
||||
|
@ -1355,9 +1355,9 @@ public class Scanner implements IScanner {
|
|||
if( isLimitReached() )
|
||||
handleInvalidCompletion();
|
||||
|
||||
if( ! restOfLine.equals( "" ) )
|
||||
if( ! restOfLine.equals( "" ) ) //$NON-NLS-1$
|
||||
{
|
||||
StringBuffer buffer = new StringBuffer("#endif ");
|
||||
StringBuffer buffer = new StringBuffer("#endif "); //$NON-NLS-1$
|
||||
buffer.append( restOfLine );
|
||||
handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, buffer.toString(), beginningOffset, false, true );
|
||||
}
|
||||
|
@ -1415,8 +1415,8 @@ public class Scanner implements IScanner {
|
|||
handleCompletionOnExpression( elifExpression );
|
||||
|
||||
|
||||
if (elifExpression.equals(""))
|
||||
handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, "#elif", beginningOffset, false, true );
|
||||
if (elifExpression.equals("")) //$NON-NLS-1$
|
||||
handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, "#elif", beginningOffset, false, true ); //$NON-NLS-1$
|
||||
|
||||
boolean elsifResult = false;
|
||||
if( scannerData.getBranchTracker().queryCurrentBranchForElif() )
|
||||
|
@ -1467,15 +1467,15 @@ public class Scanner implements IScanner {
|
|||
case PreprocessorDirectives.BLANK :
|
||||
String remainderOfLine =
|
||||
getRestOfPreprocessorLine().trim();
|
||||
if (!remainderOfLine.equals("")) {
|
||||
StringBuffer buffer = new StringBuffer( "# ");
|
||||
if (!remainderOfLine.equals("")) { //$NON-NLS-1$
|
||||
StringBuffer buffer = new StringBuffer( "# "); //$NON-NLS-1$
|
||||
buffer.append( remainderOfLine );
|
||||
handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, buffer.toString(), beginningOffset, false, true);
|
||||
}
|
||||
c = getChar();
|
||||
continue;
|
||||
default :
|
||||
StringBuffer buffer = new StringBuffer( "# ");
|
||||
StringBuffer buffer = new StringBuffer( "# "); //$NON-NLS-1$
|
||||
buffer.append( token );
|
||||
handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, buffer.toString(), beginningOffset, false, true );
|
||||
}
|
||||
|
@ -1490,51 +1490,51 @@ public class Scanner implements IScanner {
|
|||
case ':' :
|
||||
return newToken(
|
||||
IToken.tCOLONCOLON,
|
||||
"::",
|
||||
"::", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
default :
|
||||
ungetChar(c);
|
||||
return newToken(
|
||||
IToken.tCOLON,
|
||||
":",
|
||||
":", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
}
|
||||
case ';' :
|
||||
return newToken(IToken.tSEMI, ";", scannerData.getContextStack().getCurrentContext());
|
||||
return newToken(IToken.tSEMI, ";", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
|
||||
case ',' :
|
||||
return newToken(IToken.tCOMMA, ",", scannerData.getContextStack().getCurrentContext());
|
||||
return newToken(IToken.tCOMMA, ",", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
|
||||
case '?' :
|
||||
return newToken(IToken.tQUESTION, "?", scannerData.getContextStack().getCurrentContext());
|
||||
return newToken(IToken.tQUESTION, "?", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
|
||||
case '(' :
|
||||
return newToken(IToken.tLPAREN, "(", scannerData.getContextStack().getCurrentContext());
|
||||
return newToken(IToken.tLPAREN, "(", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
|
||||
case ')' :
|
||||
return newToken(IToken.tRPAREN, ")", scannerData.getContextStack().getCurrentContext());
|
||||
return newToken(IToken.tRPAREN, ")", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
|
||||
case '[' :
|
||||
return newToken(IToken.tLBRACKET, "[", scannerData.getContextStack().getCurrentContext());
|
||||
return newToken(IToken.tLBRACKET, "[", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
|
||||
case ']' :
|
||||
return newToken(IToken.tRBRACKET, "]", scannerData.getContextStack().getCurrentContext());
|
||||
return newToken(IToken.tRBRACKET, "]", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
|
||||
case '{' :
|
||||
return newToken(IToken.tLBRACE, "{", scannerData.getContextStack().getCurrentContext());
|
||||
return newToken(IToken.tLBRACE, "{", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
|
||||
case '}' :
|
||||
return newToken(IToken.tRBRACE, "}", scannerData.getContextStack().getCurrentContext());
|
||||
return newToken(IToken.tRBRACE, "}", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
|
||||
case '+' :
|
||||
c = getChar();
|
||||
switch (c) {
|
||||
case '=' :
|
||||
return newToken(
|
||||
IToken.tPLUSASSIGN,
|
||||
"+=",
|
||||
"+=", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
case '+' :
|
||||
return newToken(
|
||||
IToken.tINCR,
|
||||
"++",
|
||||
"++", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
default :
|
||||
ungetChar(c);
|
||||
return newToken(
|
||||
IToken.tPLUS,
|
||||
"+",
|
||||
"+", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
}
|
||||
case '-' :
|
||||
|
@ -1543,12 +1543,12 @@ public class Scanner implements IScanner {
|
|||
case '=' :
|
||||
return newToken(
|
||||
IToken.tMINUSASSIGN,
|
||||
"-=",
|
||||
"-=", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
case '-' :
|
||||
return newToken(
|
||||
IToken.tDECR,
|
||||
"--",
|
||||
"--", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
case '>' :
|
||||
c = getChar();
|
||||
|
@ -1556,20 +1556,20 @@ public class Scanner implements IScanner {
|
|||
case '*' :
|
||||
return newToken(
|
||||
IToken.tARROWSTAR,
|
||||
"->*",
|
||||
"->*", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
default :
|
||||
ungetChar(c);
|
||||
return newToken(
|
||||
IToken.tARROW,
|
||||
"->",
|
||||
"->", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
}
|
||||
default :
|
||||
ungetChar(c);
|
||||
return newToken(
|
||||
IToken.tMINUS,
|
||||
"-",
|
||||
"-", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
}
|
||||
case '*' :
|
||||
|
@ -1578,13 +1578,13 @@ public class Scanner implements IScanner {
|
|||
case '=' :
|
||||
return newToken(
|
||||
IToken.tSTARASSIGN,
|
||||
"*=",
|
||||
"*=", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
default :
|
||||
ungetChar(c);
|
||||
return newToken(
|
||||
IToken.tSTAR,
|
||||
"*",
|
||||
"*", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
}
|
||||
case '%' :
|
||||
|
@ -1593,13 +1593,13 @@ public class Scanner implements IScanner {
|
|||
case '=' :
|
||||
return newToken(
|
||||
IToken.tMODASSIGN,
|
||||
"%=",
|
||||
"%=", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
default :
|
||||
ungetChar(c);
|
||||
return newToken(
|
||||
IToken.tMOD,
|
||||
"%",
|
||||
"%", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
}
|
||||
case '^' :
|
||||
|
@ -1608,13 +1608,13 @@ public class Scanner implements IScanner {
|
|||
case '=' :
|
||||
return newToken(
|
||||
IToken.tXORASSIGN,
|
||||
"^=",
|
||||
"^=", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
default :
|
||||
ungetChar(c);
|
||||
return newToken(
|
||||
IToken.tXOR,
|
||||
"^",
|
||||
"^", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
}
|
||||
case '&' :
|
||||
|
@ -1623,18 +1623,18 @@ public class Scanner implements IScanner {
|
|||
case '=' :
|
||||
return newToken(
|
||||
IToken.tAMPERASSIGN,
|
||||
"&=",
|
||||
"&=", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
case '&' :
|
||||
return newToken(
|
||||
IToken.tAND,
|
||||
"&&",
|
||||
"&&", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
default :
|
||||
ungetChar(c);
|
||||
return newToken(
|
||||
IToken.tAMPER,
|
||||
"&",
|
||||
"&", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
}
|
||||
case '|' :
|
||||
|
@ -1643,35 +1643,35 @@ public class Scanner implements IScanner {
|
|||
case '=' :
|
||||
return newToken(
|
||||
IToken.tBITORASSIGN,
|
||||
"|=",
|
||||
"|=", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
case '|' :
|
||||
return newToken(
|
||||
IToken.tOR,
|
||||
"||",
|
||||
"||", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
default :
|
||||
ungetChar(c);
|
||||
return newToken(
|
||||
IToken.tBITOR,
|
||||
"|",
|
||||
"|", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
}
|
||||
case '~' :
|
||||
return newToken(IToken.tCOMPL, "~", scannerData.getContextStack().getCurrentContext());
|
||||
return newToken(IToken.tCOMPL, "~", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
|
||||
case '!' :
|
||||
c = getChar();
|
||||
switch (c) {
|
||||
case '=' :
|
||||
return newToken(
|
||||
IToken.tNOTEQUAL,
|
||||
"!=",
|
||||
"!=", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
default :
|
||||
ungetChar(c);
|
||||
return newToken(
|
||||
IToken.tNOT,
|
||||
"!",
|
||||
"!", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
}
|
||||
case '=' :
|
||||
|
@ -1680,13 +1680,13 @@ public class Scanner implements IScanner {
|
|||
case '=' :
|
||||
return newToken(
|
||||
IToken.tEQUAL,
|
||||
"==",
|
||||
"==", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
default :
|
||||
ungetChar(c);
|
||||
return newToken(
|
||||
IToken.tASSIGN,
|
||||
"=",
|
||||
"=", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
}
|
||||
case '<' :
|
||||
|
@ -1698,25 +1698,25 @@ public class Scanner implements IScanner {
|
|||
case '=' :
|
||||
return newToken(
|
||||
IToken.tSHIFTLASSIGN,
|
||||
"<<=",
|
||||
"<<=", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
default :
|
||||
ungetChar(c);
|
||||
return newToken(
|
||||
IToken.tSHIFTL,
|
||||
"<<",
|
||||
"<<", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
}
|
||||
case '=' :
|
||||
return newToken(
|
||||
IToken.tLTEQUAL,
|
||||
"<=",
|
||||
"<=", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
default :
|
||||
ungetChar(c);
|
||||
if( forInclusion )
|
||||
temporarilyReplaceDefinitionsMap();
|
||||
return newToken(IToken.tLT, "<", scannerData.getContextStack().getCurrentContext());
|
||||
return newToken(IToken.tLT, "<", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
|
||||
}
|
||||
case '>' :
|
||||
c = getChar();
|
||||
|
@ -1727,25 +1727,25 @@ public class Scanner implements IScanner {
|
|||
case '=' :
|
||||
return newToken(
|
||||
IToken.tSHIFTRASSIGN,
|
||||
">>=",
|
||||
">>=", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
default :
|
||||
ungetChar(c);
|
||||
return newToken(
|
||||
IToken.tSHIFTR,
|
||||
">>",
|
||||
">>", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
}
|
||||
case '=' :
|
||||
return newToken(
|
||||
IToken.tGTEQUAL,
|
||||
">=",
|
||||
">=", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
default :
|
||||
ungetChar(c);
|
||||
if( forInclusion )
|
||||
restoreDefinitionsMap();
|
||||
return newToken(IToken.tGT, ">", scannerData.getContextStack().getCurrentContext());
|
||||
return newToken(IToken.tGT, ">", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
|
||||
}
|
||||
case '.' :
|
||||
c = getChar();
|
||||
|
@ -1756,7 +1756,7 @@ public class Scanner implements IScanner {
|
|||
case '.' :
|
||||
return newToken(
|
||||
IToken.tELLIPSIS,
|
||||
"...",
|
||||
"...", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
default :
|
||||
break;
|
||||
|
@ -1765,13 +1765,13 @@ public class Scanner implements IScanner {
|
|||
case '*' :
|
||||
return newToken(
|
||||
IToken.tDOTSTAR,
|
||||
".*",
|
||||
".*", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
default :
|
||||
ungetChar(c);
|
||||
return newToken(
|
||||
IToken.tDOT,
|
||||
".",
|
||||
".", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
}
|
||||
break;
|
||||
|
@ -1789,13 +1789,13 @@ public class Scanner implements IScanner {
|
|||
case '=' :
|
||||
return newToken(
|
||||
IToken.tDIVASSIGN,
|
||||
"/=",
|
||||
"/=", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
default :
|
||||
ungetChar(c);
|
||||
return newToken(
|
||||
IToken.tDIV,
|
||||
"/",
|
||||
"/", //$NON-NLS-1$
|
||||
scannerData.getContextStack().getCurrentContext());
|
||||
}
|
||||
default :
|
||||
|
@ -1838,9 +1838,9 @@ public class Scanner implements IScanner {
|
|||
int completionPoint = expression.length() + 2;
|
||||
IASTCompletionNode.CompletionKind kind = IASTCompletionNode.CompletionKind.MACRO_REFERENCE;
|
||||
|
||||
String prefix = "";
|
||||
String prefix = ""; //$NON-NLS-1$
|
||||
|
||||
if( ! expression.trim().equals(""))
|
||||
if( ! expression.trim().equals("")) //$NON-NLS-1$
|
||||
{
|
||||
IScanner subScanner = ParserFactory.createScanner( new StringReader(expression), SCRATCH, EMPTY_INFO, ParserMode.QUICK_PARSE, scannerData.getLanguage(), new NullSourceElementRequestor(), new NullLogService());
|
||||
IToken lastToken = null;
|
||||
|
@ -1883,7 +1883,7 @@ public class Scanner implements IScanner {
|
|||
|
||||
protected void handleInvalidCompletion() throws EndOfFileException
|
||||
{
|
||||
throwEOF( new ASTCompletionNode( IASTCompletionNode.CompletionKind.UNREACHABLE_CODE, null, null, "", KeywordSets.getKeywords(KeywordSets.Key.EMPTY, scannerData.getLanguage()) ));
|
||||
throwEOF( new ASTCompletionNode( IASTCompletionNode.CompletionKind.UNREACHABLE_CODE, null, null, "", KeywordSets.getKeywords(KeywordSets.Key.EMPTY, scannerData.getLanguage()) )); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
protected void handleCompletionOnPreprocessorDirective( String prefix ) throws EndOfFileException
|
||||
|
@ -1948,7 +1948,7 @@ public class Scanner implements IScanner {
|
|||
|
||||
protected String getCurrentFile()
|
||||
{
|
||||
return scannerData.getContextStack().getMostRelevantFileContext() != null ? scannerData.getContextStack().getMostRelevantFileContext().getFilename() : "";
|
||||
return scannerData.getContextStack().getMostRelevantFileContext() != null ? scannerData.getContextStack().getMostRelevantFileContext().getFilename() : ""; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
|
||||
|
@ -2009,13 +2009,13 @@ public class Scanner implements IScanner {
|
|||
return processCharacterLiteral( c, false );
|
||||
case ',' :
|
||||
if (tokenImage.length() > 0) throw endOfMacroToken;
|
||||
return newToken(IToken.tCOMMA, ",", scannerData.getContextStack().getCurrentContext());
|
||||
return newToken(IToken.tCOMMA, ",", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
|
||||
case '(' :
|
||||
if (tokenImage.length() > 0) throw endOfMacroToken;
|
||||
return newToken(IToken.tLPAREN, "(", scannerData.getContextStack().getCurrentContext());
|
||||
return newToken(IToken.tLPAREN, "(", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
|
||||
case ')' :
|
||||
if (tokenImage.length() > 0) throw endOfMacroToken;
|
||||
return newToken(IToken.tRPAREN, ")", scannerData.getContextStack().getCurrentContext());
|
||||
return newToken(IToken.tRPAREN, ")", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
|
||||
case '/' :
|
||||
if (tokenImage.length() > 0) throw endOfMacroToken;
|
||||
c = getChar();
|
||||
|
@ -2231,7 +2231,7 @@ public class Scanner implements IScanner {
|
|||
|
||||
if( scannerData.getParserMode() == ParserMode.QUICK_PARSE )
|
||||
{
|
||||
if( expression.trim().equals( "0" ) )
|
||||
if( expression.trim().equals( "0" ) ) //$NON-NLS-1$
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
@ -2275,7 +2275,7 @@ public class Scanner implements IScanner {
|
|||
|
||||
protected void skipOverSinglelineComment() throws ScannerException, EndOfFileException {
|
||||
|
||||
StringBuffer comment = new StringBuffer("//");
|
||||
StringBuffer comment = new StringBuffer("//"); //$NON-NLS-1$
|
||||
int c;
|
||||
|
||||
loop:
|
||||
|
@ -2298,7 +2298,7 @@ public class Scanner implements IScanner {
|
|||
protected boolean skipOverMultilineComment() throws ScannerException, EndOfFileException {
|
||||
int state = 0;
|
||||
boolean encounteredNewline = false;
|
||||
StringBuffer comment = new StringBuffer("/*");
|
||||
StringBuffer comment = new StringBuffer("/*"); //$NON-NLS-1$
|
||||
// simple state machine to handle multi-line comments
|
||||
// state 0 == no end of comment in site
|
||||
// state 1 == encountered *, expecting /
|
||||
|
@ -2337,7 +2337,7 @@ public class Scanner implements IScanner {
|
|||
}
|
||||
|
||||
protected void poundInclude( int beginningOffset, int startLine ) throws ScannerException, EndOfFileException {
|
||||
StringBuffer potentialErrorLine = new StringBuffer( "#include ");
|
||||
StringBuffer potentialErrorLine = new StringBuffer( "#include "); //$NON-NLS-1$
|
||||
skipOverWhitespace();
|
||||
int baseOffset = lastContext.getOffset() - lastContext.undoStackSize();
|
||||
int nameLine = scannerData.getContextStack().getCurrentLineNumber();
|
||||
|
@ -2348,7 +2348,7 @@ public class Scanner implements IScanner {
|
|||
int startOffset = baseOffset;
|
||||
int endOffset = baseOffset;
|
||||
|
||||
if (! includeLine.equals("")) {
|
||||
if (! includeLine.equals("")) { //$NON-NLS-1$
|
||||
Scanner helperScanner = new Scanner(
|
||||
new StringReader(includeLine),
|
||||
null,
|
||||
|
@ -2429,7 +2429,7 @@ public class Scanner implements IScanner {
|
|||
i =
|
||||
scannerData.getASTFactory().createInclusion(
|
||||
f,
|
||||
"",
|
||||
"", //$NON-NLS-1$
|
||||
!useIncludePath,
|
||||
beginningOffset,
|
||||
startLine,
|
||||
|
@ -2481,7 +2481,7 @@ public class Scanner implements IScanner {
|
|||
protected List tokenizeReplacementString( int beginning, String key, String replacementString, List parameterIdentifiers )
|
||||
{
|
||||
List macroReplacementTokens = new ArrayList();
|
||||
if( replacementString.trim().equals( "" ) )
|
||||
if( replacementString.trim().equals( "" ) ) //$NON-NLS-1$
|
||||
return macroReplacementTokens;
|
||||
IScanner helperScanner=null;
|
||||
try {
|
||||
|
@ -2602,7 +2602,7 @@ public class Scanner implements IScanner {
|
|||
String parameters = buffer.toString();
|
||||
|
||||
// replace StringTokenizer later -- not performant
|
||||
StringTokenizer tokenizer = new StringTokenizer(parameters, ",");
|
||||
StringTokenizer tokenizer = new StringTokenizer(parameters, ","); //$NON-NLS-1$
|
||||
ArrayList parameterIdentifiers =
|
||||
new ArrayList(tokenizer.countTokens());
|
||||
while (tokenizer.hasMoreTokens()) {
|
||||
|
@ -2615,7 +2615,7 @@ public class Scanner implements IScanner {
|
|||
String replacementString = getRestOfPreprocessorLine();
|
||||
|
||||
|
||||
macroReplacementTokens = ( ! replacementString.equals( "" ) ) ?
|
||||
macroReplacementTokens = ( ! replacementString.equals( "" ) ) ? //$NON-NLS-1$
|
||||
tokenizeReplacementString( beginning, key, replacementString, parameterIdentifiers ) :
|
||||
EMPTY_LIST;
|
||||
|
||||
|
@ -2623,7 +2623,7 @@ public class Scanner implements IScanner {
|
|||
fullSignature.append( key );
|
||||
fullSignature.append( '(');
|
||||
fullSignature.append( parameters );
|
||||
fullSignature.append( ") ");
|
||||
fullSignature.append( ") "); //$NON-NLS-1$
|
||||
fullSignature.append( replacementString );
|
||||
descriptor = new FunctionMacroDescriptor(
|
||||
key,
|
||||
|
@ -2638,8 +2638,8 @@ public class Scanner implements IScanner {
|
|||
}
|
||||
else if ((c == '\n') || (c == '\r'))
|
||||
{
|
||||
checkValidMacroRedefinition(key, previousDefinition, "", beginning);
|
||||
addDefinition( key, "" );
|
||||
checkValidMacroRedefinition(key, previousDefinition, "", beginning); //$NON-NLS-1$
|
||||
addDefinition( key, "" ); //$NON-NLS-1$
|
||||
}
|
||||
else if ((c == ' ') || (c == '\t') ) {
|
||||
// this is a simple definition
|
||||
|
@ -2657,33 +2657,33 @@ public class Scanner implements IScanner {
|
|||
if (c == '/') // one line comment
|
||||
{
|
||||
skipOverSinglelineComment();
|
||||
checkValidMacroRedefinition(key, previousDefinition, "", beginning);
|
||||
addDefinition(key, "");
|
||||
checkValidMacroRedefinition(key, previousDefinition, "", beginning); //$NON-NLS-1$
|
||||
addDefinition(key, ""); //$NON-NLS-1$
|
||||
} else if (c == '*') // multi-line comment
|
||||
{
|
||||
if (skipOverMultilineComment()) {
|
||||
// we have gone over a newline
|
||||
// therefore, this symbol was defined to an empty string
|
||||
checkValidMacroRedefinition(key, previousDefinition, "", beginning);
|
||||
addDefinition(key, "");
|
||||
checkValidMacroRedefinition(key, previousDefinition, "", beginning); //$NON-NLS-1$
|
||||
addDefinition(key, ""); //$NON-NLS-1$
|
||||
} else {
|
||||
String value = getRestOfPreprocessorLine();
|
||||
|
||||
checkValidMacroRedefinition(key, previousDefinition, "", beginning);
|
||||
checkValidMacroRedefinition(key, previousDefinition, "", beginning); //$NON-NLS-1$
|
||||
addDefinition(key, value);
|
||||
}
|
||||
} else {
|
||||
// this is not a comment
|
||||
// it is a bad statement
|
||||
potentialErrorMessage.append( key );
|
||||
potentialErrorMessage.append( " /");
|
||||
potentialErrorMessage.append( " /"); //$NON-NLS-1$
|
||||
potentialErrorMessage.append( getRestOfPreprocessorLine() );
|
||||
handleProblem( IProblem.PREPROCESSOR_INVALID_MACRO_DEFN, potentialErrorMessage.toString(), beginning, false, true );
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
potentialErrorMessage = new StringBuffer();
|
||||
potentialErrorMessage.append( "#define");
|
||||
potentialErrorMessage.append( "#define"); //$NON-NLS-1$
|
||||
potentialErrorMessage.append( key );
|
||||
potentialErrorMessage.append( (char)c );
|
||||
potentialErrorMessage.append( getRestOfPreprocessorLine() );
|
||||
|
@ -2798,7 +2798,7 @@ public class Scanner implements IScanner {
|
|||
buffer.append('\"');
|
||||
break;
|
||||
case IToken.tLSTRING :
|
||||
buffer.append( "L\"");
|
||||
buffer.append( "L\""); //$NON-NLS-1$
|
||||
buffer.append(t.getImage());
|
||||
buffer.append('\"');
|
||||
break;
|
||||
|
@ -2958,7 +2958,7 @@ public class Scanner implements IScanner {
|
|||
buffer.append('\"');
|
||||
break;
|
||||
case IToken.tLSTRING:
|
||||
buffer.append("L\"");
|
||||
buffer.append("L\""); //$NON-NLS-1$
|
||||
buffer.append(t.getImage());
|
||||
buffer.append('\"');
|
||||
break;
|
||||
|
@ -2987,7 +2987,7 @@ public class Scanner implements IScanner {
|
|||
|
||||
if( t.getType() != tPOUNDPOUND && ! pastingNext )
|
||||
if (i < (numberOfTokens-1)) // Do not append to the last one
|
||||
buffer.append( " " );
|
||||
buffer.append( " " ); //$NON-NLS-1$
|
||||
}
|
||||
String finalString = buffer.toString();
|
||||
try
|
||||
|
@ -3013,7 +3013,7 @@ public class Scanner implements IScanner {
|
|||
|
||||
}
|
||||
else {
|
||||
StringBuffer logMessage = new StringBuffer( "Unexpected type of MacroDescriptor stored in definitions table: " );
|
||||
StringBuffer logMessage = new StringBuffer( "Unexpected type of MacroDescriptor stored in definitions table: " ); //$NON-NLS-1$
|
||||
logMessage.append( expansion.getMacroType() );
|
||||
scannerData.getLogService().traceLog( logMessage.toString() );
|
||||
}
|
||||
|
@ -3034,8 +3034,8 @@ public class Scanner implements IScanner {
|
|||
c = getChar();
|
||||
if (c != ')')
|
||||
{
|
||||
handleProblem( IProblem.PREPROCESSOR_MACRO_USAGE_ERROR, "defined()", o, false, true );
|
||||
return "0";
|
||||
handleProblem( IProblem.PREPROCESSOR_MACRO_USAGE_ERROR, "defined()", o, false, true ); //$NON-NLS-1$
|
||||
return "0"; //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -3045,9 +3045,9 @@ public class Scanner implements IScanner {
|
|||
}
|
||||
|
||||
if (getDefinition(definitionIdentifier) != null)
|
||||
return "1";
|
||||
return "1"; //$NON-NLS-1$
|
||||
|
||||
return "0";
|
||||
return "0"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public void setThrowExceptionOnBadCharacterRead( boolean throwOnBad ){
|
||||
|
@ -3117,14 +3117,14 @@ public class Scanner implements IScanner {
|
|||
*/
|
||||
private String reconcilePath(String originalPath ) {
|
||||
if( originalPath == null ) return null;
|
||||
String [] segments = originalPath.split( "[/\\\\]" );
|
||||
String [] segments = originalPath.split( "[/\\\\]" ); //$NON-NLS-1$
|
||||
if( segments.length == 1 ) return originalPath;
|
||||
Vector results = new Vector();
|
||||
for( int i = 0; i < segments.length; ++i )
|
||||
{
|
||||
String segment = segments[i];
|
||||
if( segment.equals( ".") ) continue;
|
||||
if( segment.equals("..") )
|
||||
if( segment.equals( ".") ) continue; //$NON-NLS-1$
|
||||
if( segment.equals("..") ) //$NON-NLS-1$
|
||||
{
|
||||
if( results.size() > 0 )
|
||||
results.removeElementAt( results.size() - 1 );
|
||||
|
@ -3140,7 +3140,7 @@ public class Scanner implements IScanner {
|
|||
if( i.hasNext() )
|
||||
buffer.append( File.separatorChar );
|
||||
}
|
||||
scannerData.getLogService().traceLog( "Path has been reduced to " + buffer.toString());
|
||||
scannerData.getLogService().traceLog( "Path has been reduced to " + buffer.toString()); //$NON-NLS-1$
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ public class KeywordSets {
|
|||
static
|
||||
{
|
||||
MACRO_ONLY = new HashSet();
|
||||
MACRO_ONLY.add("defined()" );
|
||||
MACRO_ONLY.add("defined()" ); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ public class Token implements IToken {
|
|||
|
||||
public String toString()
|
||||
{
|
||||
return "Token type=" + type + " image =" + image + " offset=" + offset;
|
||||
return "Token type=" + type + " image =" + image + " offset=" + offset; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
}
|
||||
|
||||
public int type;
|
||||
|
|
|
@ -50,22 +50,22 @@ public class ASTUtil {
|
|||
{
|
||||
IASTTemplateParameter.ParamKind kind = parameter.getTemplateParameterKind();
|
||||
if(kind == IASTTemplateParameter.ParamKind.CLASS){
|
||||
paramType.append("class");
|
||||
paramType.append("class"); //$NON-NLS-1$
|
||||
}
|
||||
if(kind == IASTTemplateParameter.ParamKind.TYPENAME){
|
||||
paramType.append("typename");
|
||||
paramType.append("typename"); //$NON-NLS-1$
|
||||
}
|
||||
if(kind == IASTTemplateParameter.ParamKind.TEMPLATE_LIST){
|
||||
paramType.append("template<");
|
||||
paramType.append("template<"); //$NON-NLS-1$
|
||||
String[] subParams = getTemplateParameters(parameter.getTemplateParameters());
|
||||
int p = 0;
|
||||
if ( subParams.length > 0)
|
||||
paramType.append(subParams[p++]);
|
||||
while( p < subParams.length){
|
||||
paramType.append(", ");
|
||||
paramType.append(", "); //$NON-NLS-1$
|
||||
paramType.append(subParams[p++]);
|
||||
}
|
||||
paramType.append(">");
|
||||
paramType.append(">"); //$NON-NLS-1$
|
||||
}
|
||||
if(kind == IASTTemplateParameter.ParamKind.PARAMETER){
|
||||
paramType.append(getType(parameter.getParameterDeclaration()));
|
||||
|
@ -107,7 +107,7 @@ public class ASTUtil {
|
|||
? expression.getLiteralString()
|
||||
: expression.getIdExpression() );
|
||||
if(literal.length() > 0){
|
||||
initializer.append("=");
|
||||
initializer.append("="); //$NON-NLS-1$
|
||||
initializer.append(literal);
|
||||
}
|
||||
}
|
||||
|
@ -119,9 +119,9 @@ public class ASTUtil {
|
|||
StringBuffer type = new StringBuffer();
|
||||
ASTPointerOperator po = declaration.getPointerToFunctionOperator();
|
||||
if(po != null){
|
||||
type.append("(");
|
||||
type.append("("); //$NON-NLS-1$
|
||||
type.append(getPointerOperator(po));
|
||||
type.append(")");
|
||||
type.append(")"); //$NON-NLS-1$
|
||||
String[] parameters =getParameterTypes(declaration.getParameters(), false /* replace with takeVarArgs() later*/);
|
||||
type.append(getParametersString(parameters));
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ public class ASTUtil {
|
|||
StringBuffer type = new StringBuffer();
|
||||
|
||||
if(declaration.isConst())
|
||||
type.append("const ");
|
||||
type.append("const "); //$NON-NLS-1$
|
||||
IASTTypeSpecifier typeSpecifier = declaration.getTypeSpecifier();
|
||||
if(typeSpecifier instanceof IASTElaboratedTypeSpecifier){
|
||||
IASTElaboratedTypeSpecifier elab = (IASTElaboratedTypeSpecifier) typeSpecifier;
|
||||
|
@ -147,18 +147,18 @@ public class ASTUtil {
|
|||
StringBuffer type = new StringBuffer();
|
||||
ASTClassKind t = elab.getClassKind();
|
||||
if( t == ASTClassKind.CLASS){
|
||||
type.append("class");
|
||||
type.append("class"); //$NON-NLS-1$
|
||||
}
|
||||
else if( t == ASTClassKind.STRUCT){
|
||||
type.append("struct");
|
||||
type.append("struct"); //$NON-NLS-1$
|
||||
}
|
||||
else if( t == ASTClassKind.UNION){
|
||||
type.append("union");
|
||||
type.append("union"); //$NON-NLS-1$
|
||||
}
|
||||
else if( t == ASTClassKind.STRUCT){
|
||||
type.append("enum");
|
||||
type.append("enum"); //$NON-NLS-1$
|
||||
}
|
||||
type.append(" ");
|
||||
type.append(" "); //$NON-NLS-1$
|
||||
type.append(elab.getName().toString());
|
||||
return type.toString();
|
||||
}
|
||||
|
@ -174,18 +174,18 @@ public class ASTUtil {
|
|||
}
|
||||
|
||||
public static String getPointerOperator(ASTPointerOperator po){
|
||||
String pointerString ="";
|
||||
String pointerString =""; //$NON-NLS-1$
|
||||
if(po == ASTPointerOperator.POINTER)
|
||||
pointerString = ("*");
|
||||
pointerString = ("*"); //$NON-NLS-1$
|
||||
|
||||
if(po == ASTPointerOperator.REFERENCE)
|
||||
pointerString =("&");
|
||||
pointerString =("&"); //$NON-NLS-1$
|
||||
|
||||
if(po == ASTPointerOperator.CONST_POINTER)
|
||||
pointerString =("* const");
|
||||
pointerString =("* const"); //$NON-NLS-1$
|
||||
|
||||
if(po == ASTPointerOperator.VOLATILE_POINTER)
|
||||
pointerString =("* volatile");
|
||||
pointerString =("* volatile"); //$NON-NLS-1$
|
||||
|
||||
return pointerString;
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ public class ASTUtil {
|
|||
Iterator i = declaration.getArrayModifiers();
|
||||
while (i.hasNext()){
|
||||
i.next();
|
||||
arrayString.append("[]");
|
||||
arrayString.append("[]"); //$NON-NLS-1$
|
||||
}
|
||||
return arrayString.toString();
|
||||
}
|
||||
|
@ -221,24 +221,24 @@ public class ASTUtil {
|
|||
}
|
||||
// add the ellipse to the parameter type list
|
||||
if(takesVarArgs)
|
||||
parameterTypes[paramListSize-1] = "...";
|
||||
parameterTypes[paramListSize-1] = "..."; //$NON-NLS-1$
|
||||
return parameterTypes;
|
||||
}
|
||||
public static String getParametersString(String[] parameterTypes)
|
||||
{
|
||||
StringBuffer parameters = new StringBuffer("");
|
||||
StringBuffer parameters = new StringBuffer(""); //$NON-NLS-1$
|
||||
|
||||
if ((parameterTypes != null) && (parameterTypes.length > 0)) {
|
||||
parameters.append("(");
|
||||
parameters.append("("); //$NON-NLS-1$
|
||||
int i = 0;
|
||||
parameters.append(parameterTypes[i++]);
|
||||
while (i < parameterTypes.length) {
|
||||
parameters.append(", ");
|
||||
parameters.append(", "); //$NON-NLS-1$
|
||||
parameters.append(parameterTypes[i++]);
|
||||
}
|
||||
parameters.append(")");
|
||||
parameters.append(")"); //$NON-NLS-1$
|
||||
} else {
|
||||
if (parameterTypes != null) parameters.append("()");
|
||||
if (parameterTypes != null) parameters.append("()"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
return parameters.toString();
|
||||
|
|
|
@ -38,17 +38,17 @@ public class BasicSearchMatch implements IMatch, Comparable {
|
|||
}
|
||||
|
||||
public int hashCode(){
|
||||
String hashString = "";
|
||||
String hashString = ""; //$NON-NLS-1$
|
||||
|
||||
hashString += name;
|
||||
hashString += ":" + parentName;
|
||||
hashString += ":" + returnType;
|
||||
hashString += ":" + parentName; //$NON-NLS-1$
|
||||
hashString += ":" + returnType; //$NON-NLS-1$
|
||||
|
||||
if( getLocation() != null)
|
||||
hashString += ":" + getLocation().toString();
|
||||
hashString += ":" + getLocation().toString(); //$NON-NLS-1$
|
||||
|
||||
hashString += ":" + startOffset + ":" + endOffset;
|
||||
hashString += ":" + type + ":" + visibility;
|
||||
hashString += ":" + startOffset + ":" + endOffset; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
hashString += ":" + type + ":" + visibility; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
return hashString.hashCode();
|
||||
}
|
||||
|
@ -108,11 +108,11 @@ public class BasicSearchMatch implements IMatch, Comparable {
|
|||
String str1 = getLocation().toString();
|
||||
String str2 = match.getLocation().toString();
|
||||
|
||||
str1 += " " + getStartOffset()+ " ";
|
||||
str2 += " " + match.getStartOffset()+ " ";
|
||||
str1 += " " + getStartOffset()+ " "; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
str2 += " " + match.getStartOffset()+ " "; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
str1 += getName() + " " + getParentName()+ " " + getReturnType();
|
||||
str2 += match.getName() + " " + match.getParentName()+ " " + getReturnType();
|
||||
str1 += getName() + " " + getParentName()+ " " + getReturnType(); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
str2 += match.getName() + " " + match.getParentName()+ " " + getReturnType(); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
return str1.compareTo( str2 );
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ public class BasicSearchResultCollector implements ICSearchResultCollector {
|
|||
|
||||
result.startOffset = start;
|
||||
result.endOffset = end;
|
||||
result.parentName = "";
|
||||
result.parentName = ""; //$NON-NLS-1$
|
||||
|
||||
IASTOffsetableNamedElement offsetable = null;
|
||||
|
||||
|
@ -99,7 +99,7 @@ public class BasicSearchResultCollector implements ICSearchResultCollector {
|
|||
result.name = offsetable.getName();
|
||||
}
|
||||
|
||||
result.parentName = "";
|
||||
result.parentName = ""; //$NON-NLS-1$
|
||||
String [] names = null;
|
||||
if( offsetable instanceof IASTEnumerator ){
|
||||
IASTEnumerator enumerator = (IASTEnumerator) offsetable;
|
||||
|
@ -111,7 +111,7 @@ public class BasicSearchResultCollector implements ICSearchResultCollector {
|
|||
if( names != null ){
|
||||
for( int i = 0; i < names.length - 1; i++ ){
|
||||
if( i > 0 )
|
||||
result.parentName += "::";
|
||||
result.parentName += "::"; //$NON-NLS-1$
|
||||
|
||||
result.parentName += names[ i ];
|
||||
}
|
||||
|
@ -136,9 +136,9 @@ public class BasicSearchResultCollector implements ICSearchResultCollector {
|
|||
*/
|
||||
private String getParameterString(IASTFunction function) {
|
||||
if( function == null )
|
||||
return "";
|
||||
return ""; //$NON-NLS-1$
|
||||
|
||||
String paramString = "(";
|
||||
String paramString = "("; //$NON-NLS-1$
|
||||
|
||||
Iterator iter = function.getParameters();
|
||||
|
||||
|
@ -146,11 +146,11 @@ public class BasicSearchResultCollector implements ICSearchResultCollector {
|
|||
while( iter.hasNext() ){
|
||||
IASTParameterDeclaration param = (IASTParameterDeclaration) iter.next();
|
||||
|
||||
if( !first ) paramString += ", ";
|
||||
if( !first ) paramString += ", "; //$NON-NLS-1$
|
||||
|
||||
IASTTypeSpecifier typeSpec = param.getTypeSpecifier();
|
||||
if( param.isConst() )
|
||||
paramString += "const ";
|
||||
paramString += "const "; //$NON-NLS-1$
|
||||
|
||||
if( typeSpec instanceof IASTSimpleTypeSpecifier ){
|
||||
paramString += ((IASTSimpleTypeSpecifier)typeSpec).getTypename();
|
||||
|
@ -159,30 +159,30 @@ public class BasicSearchResultCollector implements ICSearchResultCollector {
|
|||
} else if( typeSpec instanceof IASTElaboratedTypeSpecifier ){
|
||||
ASTClassKind kind = ((IASTElaboratedTypeSpecifier)typeSpec).getClassKind();
|
||||
if( kind == ASTClassKind.CLASS ){
|
||||
paramString += "class ";
|
||||
paramString += "class "; //$NON-NLS-1$
|
||||
} else if( kind == ASTClassKind.STRUCT ){
|
||||
paramString += "struct ";
|
||||
paramString += "struct "; //$NON-NLS-1$
|
||||
} else if( kind == ASTClassKind.ENUM ){
|
||||
paramString += "enum ";
|
||||
paramString += "enum "; //$NON-NLS-1$
|
||||
} else if( kind == ASTClassKind.UNION ){
|
||||
paramString += "union ";
|
||||
paramString += "union "; //$NON-NLS-1$
|
||||
}
|
||||
paramString += ((IASTElaboratedTypeSpecifier)typeSpec).getName();
|
||||
}
|
||||
|
||||
Iterator ptrs = param.getPointerOperators();
|
||||
if( ptrs.hasNext() ) paramString += " ";
|
||||
if( ptrs.hasNext() ) paramString += " "; //$NON-NLS-1$
|
||||
|
||||
while( ptrs.hasNext() ){
|
||||
ASTPointerOperator ptr = (ASTPointerOperator)ptrs.next();
|
||||
if( ptr == ASTPointerOperator.POINTER )
|
||||
paramString += "*";
|
||||
paramString += "*"; //$NON-NLS-1$
|
||||
else if( ptr == ASTPointerOperator.REFERENCE )
|
||||
paramString += "&";
|
||||
paramString += "&"; //$NON-NLS-1$
|
||||
else if( ptr == ASTPointerOperator.CONST_POINTER )
|
||||
paramString += " const * ";
|
||||
paramString += " const * "; //$NON-NLS-1$
|
||||
else if( ptr == ASTPointerOperator.VOLATILE_POINTER )
|
||||
paramString += " volatile * ";
|
||||
paramString += " volatile * "; //$NON-NLS-1$
|
||||
|
||||
ptr = ASTPointerOperator.POINTER;
|
||||
}
|
||||
|
@ -190,7 +190,7 @@ public class BasicSearchResultCollector implements ICSearchResultCollector {
|
|||
first = false;
|
||||
}
|
||||
|
||||
paramString += ")";
|
||||
paramString += ")"; //$NON-NLS-1$
|
||||
return paramString;
|
||||
}
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ public class SearchEngine implements ICSearchConstants{
|
|||
//initialize progress monitor
|
||||
IProgressMonitor progressMonitor = collector.getProgressMonitor();
|
||||
if( progressMonitor != null ){
|
||||
progressMonitor.beginTask( Util.bind("engine.searching"), 100 ); //$NON_NLS-1$
|
||||
progressMonitor.beginTask( Util.bind("engine.searching"), 100 ); //$NON_NLS-1$ //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/* index search */
|
||||
|
|
|
@ -181,7 +181,7 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
|
|||
scanner =
|
||||
ParserFactory.createScanner(
|
||||
new StringReader(patternString),
|
||||
"TEXT",
|
||||
"TEXT", //$NON-NLS-1$
|
||||
new ScannerInfo(),
|
||||
ParserMode.QUICK_PARSE,
|
||||
ParserLanguage.CPP,
|
||||
|
@ -252,7 +252,7 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
|
|||
scanner =
|
||||
ParserFactory.createScanner(
|
||||
new StringReader(patternString),
|
||||
"TEXT",
|
||||
"TEXT", //$NON-NLS-1$
|
||||
new ScannerInfo(),
|
||||
ParserMode.QUICK_PARSE,
|
||||
ParserLanguage.CPP,
|
||||
|
@ -286,7 +286,7 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
|
|||
}
|
||||
|
||||
int index = patternString.indexOf( '(' );
|
||||
String paramString = ( index == -1 ) ? "" : patternString.substring( index );
|
||||
String paramString = ( index == -1 ) ? "" : patternString.substring( index ); //$NON-NLS-1$
|
||||
String nameString = ( index == -1 ) ? patternString : patternString.substring( 0, index );
|
||||
|
||||
IScanner scanner=null;
|
||||
|
@ -294,7 +294,7 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
|
|||
scanner =
|
||||
ParserFactory.createScanner(
|
||||
new StringReader(nameString),
|
||||
"TEXT",
|
||||
"TEXT", //$NON-NLS-1$
|
||||
new ScannerInfo(),
|
||||
ParserMode.QUICK_PARSE,
|
||||
ParserLanguage.CPP,
|
||||
|
@ -353,7 +353,7 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
|
|||
scanner =
|
||||
ParserFactory.createScanner(
|
||||
new StringReader(patternString),
|
||||
"TEXT",
|
||||
"TEXT", //$NON-NLS-1$
|
||||
new ScannerInfo(),
|
||||
ParserMode.QUICK_PARSE,
|
||||
ParserLanguage.CPP,
|
||||
|
@ -406,17 +406,17 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
|
|||
private static LinkedList scanForParameters( String paramString ) {
|
||||
LinkedList list = new LinkedList();
|
||||
|
||||
if( paramString == null || paramString.equals("") )
|
||||
if( paramString == null || paramString.equals("") ) //$NON-NLS-1$
|
||||
return list;
|
||||
|
||||
String functionString = "void f " + paramString + ";";
|
||||
String functionString = "void f " + paramString + ";"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|
||||
IScanner scanner=null;
|
||||
try {
|
||||
scanner =
|
||||
ParserFactory.createScanner(
|
||||
new StringReader(functionString),
|
||||
"TEXT",
|
||||
"TEXT", //$NON-NLS-1$
|
||||
new ScannerInfo(),
|
||||
ParserMode.QUICK_PARSE,
|
||||
ParserLanguage.CPP,
|
||||
|
@ -456,7 +456,7 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
|
|||
|
||||
if (param == null){
|
||||
//This means that no params have been added (i.e. empty brackets - void case)
|
||||
param = "void ".toCharArray();
|
||||
param = "void ".toCharArray(); //$NON-NLS-1$
|
||||
list.add (param);
|
||||
}
|
||||
}
|
||||
|
@ -467,7 +467,7 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
|
|||
static public char [] getParamString( IASTParameterDeclaration param ){
|
||||
if( param == null ) return null;
|
||||
|
||||
String signature = "";
|
||||
String signature = ""; //$NON-NLS-1$
|
||||
|
||||
IASTTypeSpecifier typeSpec = param.getTypeSpecifier();
|
||||
if( typeSpec instanceof IASTSimpleTypeSpecifier ){
|
||||
|
@ -476,13 +476,13 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
|
|||
} else if( typeSpec instanceof IASTElaboratedTypeSpecifier ){
|
||||
IASTElaboratedTypeSpecifier elaborated = (IASTElaboratedTypeSpecifier)typeSpec;
|
||||
if( elaborated.getClassKind() == ASTClassKind.CLASS ){
|
||||
signature += "class ";
|
||||
signature += "class "; //$NON-NLS-1$
|
||||
} else if( elaborated.getClassKind() == ASTClassKind.ENUM ) {
|
||||
signature += "enum ";
|
||||
signature += "enum "; //$NON-NLS-1$
|
||||
} else if( elaborated.getClassKind() == ASTClassKind.STRUCT ) {
|
||||
signature += "struct ";
|
||||
signature += "struct "; //$NON-NLS-1$
|
||||
} else if( elaborated.getClassKind() == ASTClassKind.UNION ) {
|
||||
signature += "union";
|
||||
signature += "union"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
signature += elaborated.getName();
|
||||
|
@ -494,29 +494,29 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
|
|||
signature += enumSpec.getName();
|
||||
}
|
||||
|
||||
signature += " ";
|
||||
signature += " "; //$NON-NLS-1$
|
||||
|
||||
if( param.isConst() ) signature += "const ";
|
||||
if( param.isVolatile() ) signature += "volatile ";
|
||||
if( param.isConst() ) signature += "const "; //$NON-NLS-1$
|
||||
if( param.isVolatile() ) signature += "volatile "; //$NON-NLS-1$
|
||||
|
||||
Iterator ptrs = param.getPointerOperators();
|
||||
while( ptrs.hasNext() ){
|
||||
ASTPointerOperator ptrOp = (ASTPointerOperator) ptrs.next();
|
||||
if( ptrOp == ASTPointerOperator.POINTER ){
|
||||
signature += " * ";
|
||||
signature += " * "; //$NON-NLS-1$
|
||||
} else if( ptrOp == ASTPointerOperator.REFERENCE ){
|
||||
signature += " & ";
|
||||
signature += " & "; //$NON-NLS-1$
|
||||
} else if( ptrOp == ASTPointerOperator.CONST_POINTER ){
|
||||
signature += " const * ";
|
||||
signature += " const * "; //$NON-NLS-1$
|
||||
} else if( ptrOp == ASTPointerOperator.VOLATILE_POINTER ){
|
||||
signature += " volatile * ";
|
||||
signature += " volatile * "; //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
Iterator arrayModifiers = param.getArrayModifiers();
|
||||
while( arrayModifiers.hasNext() ){
|
||||
arrayModifiers.next();
|
||||
signature += " [] ";
|
||||
signature += " [] "; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
return signature.toCharArray();
|
||||
|
@ -525,7 +525,7 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
|
|||
static private LinkedList scanForNames( IScanner scanner, IToken unusedToken ){
|
||||
LinkedList list = new LinkedList();
|
||||
|
||||
String name = new String("");
|
||||
String name = new String(""); //$NON-NLS-1$
|
||||
|
||||
try {
|
||||
IToken token = ( unusedToken != null ) ? unusedToken : scanner.nextToken();
|
||||
|
@ -540,12 +540,12 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
|
|||
switch( token.getType() ){
|
||||
case IToken.tCOLONCOLON :
|
||||
list.addLast( name.toCharArray() );
|
||||
name = new String("");
|
||||
name = new String(""); //$NON-NLS-1$
|
||||
lastTokenWasOperator = false;
|
||||
break;
|
||||
|
||||
case IToken.t_operator :
|
||||
name += token.getImage() + " ";
|
||||
name += token.getImage() + " "; //$NON-NLS-1$
|
||||
lastTokenWasOperator = true;
|
||||
break;
|
||||
|
||||
|
@ -562,7 +562,7 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
|
|||
token.getType() != IToken.tRBRACKET &&
|
||||
token.getType()!= IToken.tGT
|
||||
){
|
||||
name += " ";
|
||||
name += " "; //$NON-NLS-1$
|
||||
} else {
|
||||
encounteredWild = false;
|
||||
}
|
||||
|
@ -581,8 +581,8 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
|
|||
} catch ( ScannerException e ){
|
||||
if( e.getProblem().getID() == IProblem.SCANNER_BAD_CHARACTER ){
|
||||
//TODO : This may not be \\, it could be another bad character
|
||||
if( !encounteredWild && !lastTokenWasOperator ) name += " ";
|
||||
name += "\\";
|
||||
if( !encounteredWild && !lastTokenWasOperator ) name += " "; //$NON-NLS-1$
|
||||
name += "\\"; //$NON-NLS-1$
|
||||
encounteredWild = true;
|
||||
lastTokenWasOperator = false;
|
||||
prev = null;
|
||||
|
|
|
@ -361,7 +361,7 @@ public class MatchLocator implements ISourceElementRequestor, ICSearchConstants
|
|||
|
||||
int length = paths.length;
|
||||
if( progressMonitor != null ){
|
||||
progressMonitor.beginTask( "", length );
|
||||
progressMonitor.beginTask( "", length ); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
for( int i = 0; i < length; i++ ){
|
||||
|
@ -448,7 +448,7 @@ public class MatchLocator implements ISourceElementRequestor, ICSearchConstants
|
|||
}
|
||||
|
||||
if (VERBOSE)
|
||||
MatchLocator.verbose("*** New Search for path: " + pathString);
|
||||
MatchLocator.verbose("*** New Search for path: " + pathString); //$NON-NLS-1$
|
||||
|
||||
|
||||
try{
|
||||
|
@ -461,7 +461,7 @@ public class MatchLocator implements ISourceElementRequestor, ICSearchConstants
|
|||
}
|
||||
catch(VirtualMachineError vmErr){
|
||||
if (VERBOSE){
|
||||
MatchLocator.verbose("MatchLocator VM Error: ");
|
||||
MatchLocator.verbose("MatchLocator VM Error: "); //$NON-NLS-1$
|
||||
vmErr.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
@ -483,7 +483,7 @@ public class MatchLocator implements ISourceElementRequestor, ICSearchConstants
|
|||
offset = reference.getOffset();
|
||||
end = offset + reference.getName().length();
|
||||
if (VERBOSE)
|
||||
MatchLocator.verbose("Report Match: " + reference.getName());
|
||||
MatchLocator.verbose("Report Match: " + reference.getName()); //$NON-NLS-1$
|
||||
} else if( node instanceof IASTOffsetableNamedElement ){
|
||||
IASTOffsetableNamedElement offsetableElement = (IASTOffsetableNamedElement) node;
|
||||
offset = offsetableElement.getNameOffset() != 0 ? offsetableElement.getNameOffset()
|
||||
|
@ -494,7 +494,7 @@ public class MatchLocator implements ISourceElementRequestor, ICSearchConstants
|
|||
}
|
||||
|
||||
if (VERBOSE)
|
||||
MatchLocator.verbose("Report Match: " + offsetableElement.getName());
|
||||
MatchLocator.verbose("Report Match: " + offsetableElement.getName()); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
IMatch match = null;
|
||||
|
@ -591,7 +591,7 @@ public class MatchLocator implements ISourceElementRequestor, ICSearchConstants
|
|||
}
|
||||
|
||||
public static void verbose(String log) {
|
||||
System.out.println("(" + Thread.currentThread() + ") " + log);
|
||||
System.out.println("(" + Thread.currentThread() + ") " + log); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
|
@ -102,7 +102,7 @@ public class MethodDeclarationPattern extends CSearchPattern {
|
|||
|
||||
Iterator params = function.getParameters();
|
||||
|
||||
if (!params.hasNext() && CharOperation.equals(parameterNames[0], "void ".toCharArray())){
|
||||
if (!params.hasNext() && CharOperation.equals(parameterNames[0], "void ".toCharArray())){ //$NON-NLS-1$
|
||||
//All empty lists have transformed to void, this function has no parms
|
||||
return ACCURATE_MATCH;
|
||||
}
|
||||
|
|
|
@ -20,19 +20,19 @@ public class Addr2line {
|
|||
private String lastaddr, lastsymbol, lastline;
|
||||
|
||||
public Addr2line(String command, String file) throws IOException {
|
||||
String[] args = {command, "-C", "-f", "-e", file};
|
||||
String[] args = {command, "-C", "-f", "-e", file}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
addr2line = ProcessFactory.getFactory().exec(args);
|
||||
stdin = new BufferedWriter(new OutputStreamWriter(addr2line.getOutputStream()));
|
||||
stdout = new BufferedReader(new InputStreamReader(addr2line.getInputStream()));
|
||||
}
|
||||
|
||||
public Addr2line(String file) throws IOException {
|
||||
this("addr2line", file);
|
||||
this("addr2line", file); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
private void getOutput(String address) throws IOException {
|
||||
if ( address.equals(lastaddr) == false ) {
|
||||
stdin.write(address + "\n");
|
||||
stdin.write(address + "\n"); //$NON-NLS-1$
|
||||
stdin.flush();
|
||||
lastsymbol = stdout.readLine();
|
||||
lastline = stdout.readLine();
|
||||
|
@ -92,7 +92,7 @@ public class Addr2line {
|
|||
if (line != null) {
|
||||
int colon = line.lastIndexOf(':');
|
||||
String number = line.substring(colon + 1);
|
||||
if (!number.startsWith("0")) {
|
||||
if (!number.startsWith("0")) { //$NON-NLS-1$
|
||||
return Integer.parseInt(number);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,11 +27,11 @@ public class CPPFilt {
|
|||
}
|
||||
|
||||
public CPPFilt() throws IOException {
|
||||
this("c++filt");
|
||||
this("c++filt"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public String getFunction(String symbol) throws IOException {
|
||||
stdin.write(symbol + "\n");
|
||||
stdin.write(symbol + "\n"); //$NON-NLS-1$
|
||||
stdin.flush();
|
||||
String str = stdout.readLine();
|
||||
if ( str != null ) {
|
||||
|
|
|
@ -19,7 +19,7 @@ public class CygPath {
|
|||
private BufferedWriter stdin;
|
||||
|
||||
public CygPath(String command) throws IOException {
|
||||
String[] args = {command, "--windows", "--file", "-"};
|
||||
String[] args = {command, "--windows", "--file", "-"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
cygpath = ProcessFactory.getFactory().exec(args);
|
||||
//cppfilt = new Spawner(args);
|
||||
stdin = new BufferedWriter(new OutputStreamWriter(cygpath.getOutputStream()));
|
||||
|
@ -27,11 +27,11 @@ public class CygPath {
|
|||
}
|
||||
|
||||
public CygPath() throws IOException {
|
||||
this("cygpath");
|
||||
this("cygpath"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public String getFileName(String name) throws IOException {
|
||||
stdin.write(name + "\n");
|
||||
stdin.write(name + "\n"); //$NON-NLS-1$
|
||||
stdin.flush();
|
||||
String str = stdout.readLine();
|
||||
if ( str != null ) {
|
||||
|
|
|
@ -43,9 +43,9 @@ public class CygwinToolsProvider extends ToolsProvider implements ICygwinToolsPr
|
|||
|
||||
public IPath getCygPathPath() {
|
||||
ICExtensionReference ref = getExtensionReference();
|
||||
String value = ref.getExtensionData("cygpath"); //$NON-NLS-1
|
||||
String value = ref.getExtensionData("cygpath"); //$NON-NLS-1$
|
||||
if (value == null || value.length() == 0) {
|
||||
value = "cygpath"; //$NON-NLS-1
|
||||
value = "cygpath"; //$NON-NLS-1$
|
||||
}
|
||||
return new Path(value);
|
||||
}
|
||||
|
|
|
@ -47,12 +47,12 @@ public class Objdump {
|
|||
}
|
||||
|
||||
public Objdump(String file) throws IOException {
|
||||
this("objdump", new String[0], file);
|
||||
this("objdump", new String[0], file); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
void init(String command, String[] params, String file) throws IOException {
|
||||
if (params == null || params.length == 0) {
|
||||
args = new String[] { command, "-C", "-x", "-S", file };
|
||||
args = new String[] { command, "-C", "-x", "-S", file }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
} else {
|
||||
args = new String[params.length + 1];
|
||||
args[0] = command;
|
||||
|
|
|
@ -80,36 +80,36 @@ public class ToolsProvider implements IToolsProvider {
|
|||
|
||||
IPath getAddr2LinePath() {
|
||||
ICExtensionReference ref = getExtensionReference();
|
||||
String value = ref.getExtensionData("addr2line"); //$NON-NLS-1
|
||||
String value = ref.getExtensionData("addr2line"); //$NON-NLS-1$
|
||||
if (value == null || value.length() == 0) {
|
||||
value = "addr2line"; //$NON-NLS-1
|
||||
value = "addr2line"; //$NON-NLS-1$
|
||||
}
|
||||
return new Path(value);
|
||||
}
|
||||
|
||||
IPath getObjdumpPath() {
|
||||
ICExtensionReference ref = getExtensionReference();
|
||||
String value = ref.getExtensionData("objdump"); //$NON-NLS-1
|
||||
String value = ref.getExtensionData("objdump"); //$NON-NLS-1$
|
||||
if (value == null || value.length() == 0) {
|
||||
value = "objdump"; //$NON-NLS-1
|
||||
value = "objdump"; //$NON-NLS-1$
|
||||
}
|
||||
return new Path(value);
|
||||
}
|
||||
|
||||
String getObjdumpArgs() {
|
||||
ICExtensionReference ref = getExtensionReference();
|
||||
String value = ref.getExtensionData("objdumpArgs"); //$NON-NLS-1
|
||||
String value = ref.getExtensionData("objdumpArgs"); //$NON-NLS-1$
|
||||
if (value == null || value.length() == 0) {
|
||||
value = ""; //$NON-NLS-1
|
||||
value = ""; //$NON-NLS-1$
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
IPath getCPPFiltPath() {
|
||||
ICExtensionReference ref = getExtensionReference();
|
||||
String value = ref.getExtensionData("c++filt"); //$NON-NLS-1
|
||||
String value = ref.getExtensionData("c++filt"); //$NON-NLS-1$
|
||||
if (value == null || value.length() == 0) {
|
||||
value = "c++filt"; //$NON-NLS-1
|
||||
value = "c++filt"; //$NON-NLS-1$
|
||||
}
|
||||
return new Path(value);
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ import java.util.List;
|
|||
|
||||
public class Coff {
|
||||
|
||||
public static final String NL = System.getProperty("line.separator", "\n");
|
||||
public static final String NL = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
FileHeader filehdr;
|
||||
OptionalHeader opthdr;
|
||||
RandomAccessFile rfile;
|
||||
|
@ -78,19 +78,19 @@ public class Coff {
|
|||
|
||||
public String toString() {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
buffer.append("FILE HEADER VALUES").append(NL);
|
||||
buffer.append("FILE HEADER VALUES").append(NL); //$NON-NLS-1$
|
||||
|
||||
buffer.append("f_magic = ").append(f_magic).append(NL);
|
||||
buffer.append("f_nscns = ").append(f_nscns).append(NL);
|
||||
buffer.append("f_magic = ").append(f_magic).append(NL); //$NON-NLS-1$
|
||||
buffer.append("f_nscns = ").append(f_nscns).append(NL); //$NON-NLS-1$
|
||||
|
||||
buffer.append("f_timdat = ");
|
||||
buffer.append("f_timdat = "); //$NON-NLS-1$
|
||||
buffer.append(DateFormat.getDateInstance().format(new Date(f_timdat)));
|
||||
buffer.append(NL);
|
||||
|
||||
buffer.append("f_symptr = ").append(f_symptr).append(NL);
|
||||
buffer.append("f_nsyms = ").append(f_nsyms).append(NL);
|
||||
buffer.append("f_opthdr = ").append(f_opthdr).append(NL);
|
||||
buffer.append("f_flags = ").append(f_flags).append(NL);
|
||||
buffer.append("f_symptr = ").append(f_symptr).append(NL); //$NON-NLS-1$
|
||||
buffer.append("f_nsyms = ").append(f_nsyms).append(NL); //$NON-NLS-1$
|
||||
buffer.append("f_opthdr = ").append(f_opthdr).append(NL); //$NON-NLS-1$
|
||||
buffer.append("f_flags = ").append(f_flags).append(NL); //$NON-NLS-1$
|
||||
return buffer.toString();
|
||||
}
|
||||
}
|
||||
|
@ -128,15 +128,15 @@ public class Coff {
|
|||
|
||||
public String toString() {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
buffer.append("OPTIONAL HEADER VALUES").append(NL);
|
||||
buffer.append("magic = ").append(magic).append(NL);
|
||||
buffer.append("vstamp = ").append(vstamp).append(NL);
|
||||
buffer.append("tsize = ").append(tsize).append(NL);
|
||||
buffer.append("dsize = ").append(dsize).append(NL);
|
||||
buffer.append("bsize = ").append(bsize).append(NL);
|
||||
buffer.append("entry = ").append(entry).append(NL);
|
||||
buffer.append("text_start = ").append(text_start).append(NL);
|
||||
buffer.append("data_start = ").append(data_start).append(NL);
|
||||
buffer.append("OPTIONAL HEADER VALUES").append(NL); //$NON-NLS-1$
|
||||
buffer.append("magic = ").append(magic).append(NL); //$NON-NLS-1$
|
||||
buffer.append("vstamp = ").append(vstamp).append(NL); //$NON-NLS-1$
|
||||
buffer.append("tsize = ").append(tsize).append(NL); //$NON-NLS-1$
|
||||
buffer.append("dsize = ").append(dsize).append(NL); //$NON-NLS-1$
|
||||
buffer.append("bsize = ").append(bsize).append(NL); //$NON-NLS-1$
|
||||
buffer.append("entry = ").append(entry).append(NL); //$NON-NLS-1$
|
||||
buffer.append("text_start = ").append(text_start).append(NL); //$NON-NLS-1$
|
||||
buffer.append("data_start = ").append(data_start).append(NL); //$NON-NLS-1$
|
||||
return buffer.toString();
|
||||
}
|
||||
}
|
||||
|
@ -146,11 +146,11 @@ public class Coff {
|
|||
public final static int SCNHSZ = 40;
|
||||
|
||||
/* names of "special" sections */
|
||||
public final static String _TEXT = ".text";
|
||||
public final static String _DATA = ".data";
|
||||
public final static String _BSS = ".bss";
|
||||
public final static String _COMMENT = ".comment";
|
||||
public final static String _LIB = ".lib";
|
||||
public final static String _TEXT = ".text"; //$NON-NLS-1$
|
||||
public final static String _DATA = ".data"; //$NON-NLS-1$
|
||||
public final static String _BSS = ".bss"; //$NON-NLS-1$
|
||||
public final static String _COMMENT = ".comment"; //$NON-NLS-1$
|
||||
public final static String _LIB = ".lib"; //$NON-NLS-1$
|
||||
|
||||
/* s_flags "type". */
|
||||
public final static int STYP_REG = 0x0000; /* "regular": allocated, relocated,
|
||||
|
@ -256,17 +256,17 @@ public class Coff {
|
|||
|
||||
public String toString() {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
buffer.append("SECTION HEADER VALUES").append(NL);
|
||||
buffer.append("SECTION HEADER VALUES").append(NL); //$NON-NLS-1$
|
||||
buffer.append(new String(s_name)).append(NL);
|
||||
buffer.append("s_paddr = ").append(s_paddr).append(NL);
|
||||
buffer.append("s_vaddr = ").append(s_vaddr).append(NL);
|
||||
buffer.append("s_size = ").append(s_size).append(NL);
|
||||
buffer.append("s_scnptr = ").append(s_scnptr).append(NL);
|
||||
buffer.append("s_relptr = ").append(s_relptr).append(NL);
|
||||
buffer.append("s_lnnoptr = ").append(s_lnnoptr).append(NL);
|
||||
buffer.append("s_nreloc = ").append(s_nreloc).append(NL);
|
||||
buffer.append("s_nlnno = ").append(s_nlnno).append(NL);
|
||||
buffer.append("s_flags = ").append(s_flags).append(NL);
|
||||
buffer.append("s_paddr = ").append(s_paddr).append(NL); //$NON-NLS-1$
|
||||
buffer.append("s_vaddr = ").append(s_vaddr).append(NL); //$NON-NLS-1$
|
||||
buffer.append("s_size = ").append(s_size).append(NL); //$NON-NLS-1$
|
||||
buffer.append("s_scnptr = ").append(s_scnptr).append(NL); //$NON-NLS-1$
|
||||
buffer.append("s_relptr = ").append(s_relptr).append(NL); //$NON-NLS-1$
|
||||
buffer.append("s_lnnoptr = ").append(s_lnnoptr).append(NL); //$NON-NLS-1$
|
||||
buffer.append("s_nreloc = ").append(s_nreloc).append(NL); //$NON-NLS-1$
|
||||
buffer.append("s_nlnno = ").append(s_nlnno).append(NL); //$NON-NLS-1$
|
||||
buffer.append("s_flags = ").append(s_flags).append(NL); //$NON-NLS-1$
|
||||
///*
|
||||
try {
|
||||
Reloc[] rcs = getRelocs();
|
||||
|
@ -310,9 +310,9 @@ public class Coff {
|
|||
|
||||
public String toString() {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
buffer.append("RELOC VALUES").append(NL);
|
||||
buffer.append("r_vaddr = ").append(r_vaddr);
|
||||
buffer.append(" r_symndx = ").append(r_symndx).append(NL);
|
||||
buffer.append("RELOC VALUES").append(NL); //$NON-NLS-1$
|
||||
buffer.append("r_vaddr = ").append(r_vaddr); //$NON-NLS-1$
|
||||
buffer.append(" r_symndx = ").append(r_symndx).append(NL); //$NON-NLS-1$
|
||||
return buffer.toString();
|
||||
}
|
||||
}
|
||||
|
@ -339,10 +339,10 @@ public class Coff {
|
|||
public String toString() {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
if (l_lnno == 0) {
|
||||
buffer.append("Function address = ").append(l_addr).append(NL);
|
||||
buffer.append("Function address = ").append(l_addr).append(NL); //$NON-NLS-1$
|
||||
} else {
|
||||
buffer.append("line# ").append(l_lnno);
|
||||
buffer.append(" at address = ").append(l_addr).append(NL);
|
||||
buffer.append("line# ").append(l_lnno); //$NON-NLS-1$
|
||||
buffer.append(" at address = ").append(l_addr).append(NL); //$NON-NLS-1$
|
||||
}
|
||||
return buffer.toString();
|
||||
}
|
||||
|
@ -400,7 +400,7 @@ public class Coff {
|
|||
return new String(_n_name, 0, i);
|
||||
}
|
||||
}
|
||||
return "";
|
||||
return ""; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public String getName(byte[] table) {
|
||||
|
@ -550,7 +550,7 @@ public class Coff {
|
|||
}
|
||||
|
||||
public Coff(String filename) throws IOException {
|
||||
this(new RandomAccessFile(filename, "r"), 0);
|
||||
this(new RandomAccessFile(filename, "r"), 0); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public Coff(RandomAccessFile file, long offset) throws IOException {
|
||||
|
|
|
@ -9,7 +9,7 @@ import java.io.RandomAccessFile;
|
|||
|
||||
public class Exe {
|
||||
|
||||
public static final String NL = System.getProperty("line.separator", "\n");
|
||||
public static final String NL = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
protected RandomAccessFile rfile;
|
||||
ExeHeader ehdr;
|
||||
|
||||
|
@ -66,59 +66,59 @@ public class Exe {
|
|||
public String toString() {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
|
||||
buffer.append("EXE HEADER VALUES").append(NL);
|
||||
buffer.append("signature ");
|
||||
buffer.append((char)e_signature[0] + " " + (char)e_signature[1]);
|
||||
buffer.append("EXE HEADER VALUES").append(NL); //$NON-NLS-1$
|
||||
buffer.append("signature "); //$NON-NLS-1$
|
||||
buffer.append((char)e_signature[0] + " " + (char)e_signature[1]); //$NON-NLS-1$
|
||||
buffer.append(NL);
|
||||
|
||||
buffer.append("lastsize: 0x");
|
||||
buffer.append("lastsize: 0x"); //$NON-NLS-1$
|
||||
buffer.append(Long.toHexString(new Short(e_lastsize).longValue()));
|
||||
buffer.append(NL);
|
||||
|
||||
buffer.append("nblocks: 0x");
|
||||
buffer.append("nblocks: 0x"); //$NON-NLS-1$
|
||||
buffer.append(Long.toHexString(new Short(e_nblocks).longValue()));
|
||||
buffer.append(NL);
|
||||
|
||||
buffer.append("nreloc: 0x");
|
||||
buffer.append("nreloc: 0x"); //$NON-NLS-1$
|
||||
buffer.append(Long.toHexString(new Short(e_nreloc).longValue()));
|
||||
buffer.append(NL);
|
||||
|
||||
buffer.append("hdrsize: 0x");
|
||||
buffer.append("hdrsize: 0x"); //$NON-NLS-1$
|
||||
buffer.append(Long.toHexString(new Short(e_hdrsize).longValue()));
|
||||
buffer.append(NL);
|
||||
|
||||
buffer.append("minalloc: 0x");
|
||||
buffer.append("minalloc: 0x"); //$NON-NLS-1$
|
||||
buffer.append(Long.toHexString(new Short(e_minalloc).longValue()));
|
||||
buffer.append(NL);
|
||||
|
||||
buffer.append("maxalloc: 0x");
|
||||
buffer.append("maxalloc: 0x"); //$NON-NLS-1$
|
||||
buffer.append(Long.toHexString(new Short(e_maxalloc).longValue()));
|
||||
buffer.append(NL);
|
||||
buffer.append("ss: 0x");
|
||||
buffer.append("ss: 0x"); //$NON-NLS-1$
|
||||
buffer.append(Long.toHexString(new Short(e_ss).longValue()));
|
||||
buffer.append(NL);
|
||||
|
||||
buffer.append("sp: 0x");
|
||||
buffer.append("sp: 0x"); //$NON-NLS-1$
|
||||
buffer.append(Long.toHexString(new Short(e_sp).longValue()));
|
||||
buffer.append(NL);
|
||||
|
||||
buffer.append("checksum: 0x");
|
||||
buffer.append("checksum: 0x"); //$NON-NLS-1$
|
||||
buffer.append(Long.toHexString(new Short(e_checksum).longValue()));
|
||||
buffer.append(NL);
|
||||
|
||||
buffer.append("ip: 0x");
|
||||
buffer.append("ip: 0x"); //$NON-NLS-1$
|
||||
buffer.append(Long.toHexString(new Short(e_ip).longValue()));
|
||||
buffer.append(NL);
|
||||
|
||||
buffer.append("cs: 0x");
|
||||
buffer.append("cs: 0x"); //$NON-NLS-1$
|
||||
buffer.append(Long.toHexString(new Short(e_cs).longValue()));
|
||||
buffer.append(NL);
|
||||
|
||||
buffer.append("relocoffs: 0x");
|
||||
buffer.append("relocoffs: 0x"); //$NON-NLS-1$
|
||||
buffer.append(Long.toHexString(new Short(e_relocoffs).longValue()));
|
||||
buffer.append(NL);
|
||||
|
||||
buffer.append("overlay: 0x");
|
||||
buffer.append("overlay: 0x"); //$NON-NLS-1$
|
||||
buffer.append(Long.toHexString(new Short(e_noverlay).longValue()));
|
||||
buffer.append(NL);
|
||||
return buffer.toString();
|
||||
|
@ -137,7 +137,7 @@ public class Exe {
|
|||
}
|
||||
|
||||
public Exe(String file) throws IOException {
|
||||
rfile = new RandomAccessFile(file, "r");
|
||||
rfile = new RandomAccessFile(file, "r"); //$NON-NLS-1$
|
||||
try {
|
||||
ehdr = new ExeHeader(rfile);
|
||||
} finally {
|
||||
|
|
|
@ -53,7 +53,7 @@ import org.eclipse.cdt.utils.coff.Exe.ExeHeader;
|
|||
*/
|
||||
public class PE {
|
||||
|
||||
public static final String NL = System.getProperty("line.separator", "\n");
|
||||
public static final String NL = System.getProperty("line.separator", "\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
RandomAccessFile rfile;
|
||||
String filename;
|
||||
ExeHeader exeHeader;
|
||||
|
@ -129,8 +129,8 @@ public class PE {
|
|||
|
||||
public String toString() {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
buffer.append("DOS STUB VALUES").append(NL);
|
||||
buffer.append("e_lfanew = ").append(e_lfanew).append(NL);
|
||||
buffer.append("DOS STUB VALUES").append(NL); //$NON-NLS-1$
|
||||
buffer.append("e_lfanew = ").append(e_lfanew).append(NL); //$NON-NLS-1$
|
||||
buffer.append(new String(dos_message)).append(NL);
|
||||
return buffer.toString();
|
||||
}
|
||||
|
@ -195,28 +195,28 @@ public class PE {
|
|||
|
||||
public String toString() {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
buffer.append("NT OPTIONAL HEADER VALUES").append(NL);
|
||||
buffer.append("ImageBase = ").append(ImageBase).append(NL);
|
||||
buffer.append("SexctionAlignement = ").append(SectionAlignment).append(NL);
|
||||
buffer.append("FileAlignment = ").append(FileAlignment).append(NL);
|
||||
buffer.append("MajorOSVersion = ").append(MajorOperatingSystemVersion).append(NL);
|
||||
buffer.append("MinorOSVersion = ").append(MinorOperatingSystemVersion).append(NL);
|
||||
buffer.append("MajorImageVersion = ").append(MajorImageVersion).append(NL);
|
||||
buffer.append("MinorImageVersion = ").append(MinorImageVersion).append(NL);
|
||||
buffer.append("MajorSubVersion = ").append(MajorSubsystemVersion).append(NL);
|
||||
buffer.append("MinorSubVersion = ").append(MinorSubsystemVersion).append(NL);
|
||||
buffer.append("Reserved = ").append(Reserved).append(NL);
|
||||
buffer.append("SizeOfImage = ").append(SizeOfImage).append(NL);
|
||||
buffer.append("SizeOfHeaders = ").append(SizeOfHeaders).append(NL);
|
||||
buffer.append("CheckSum = ").append(CheckSum).append(NL);
|
||||
buffer.append("Subsystem = ").append(Subsystem).append(NL);
|
||||
buffer.append("DLL = ").append(DLLCharacteristics).append(NL);
|
||||
buffer.append("StackReserve = ").append(SizeOfStackReserve).append(NL);
|
||||
buffer.append("StackCommit = ").append(SizeOfStackCommit).append(NL);
|
||||
buffer.append("HeapReserve = ").append(SizeOfHeapReserve).append(NL);
|
||||
buffer.append("HeapCommit = ").append(SizeOfHeapCommit).append(NL);
|
||||
buffer.append("LoaderFlags = ").append(LoaderFlags).append(NL);;
|
||||
buffer.append("#Rva size = ").append(NumberOfRvaAndSizes).append(NL);
|
||||
buffer.append("NT OPTIONAL HEADER VALUES").append(NL); //$NON-NLS-1$
|
||||
buffer.append("ImageBase = ").append(ImageBase).append(NL); //$NON-NLS-1$
|
||||
buffer.append("SexctionAlignement = ").append(SectionAlignment).append(NL); //$NON-NLS-1$
|
||||
buffer.append("FileAlignment = ").append(FileAlignment).append(NL); //$NON-NLS-1$
|
||||
buffer.append("MajorOSVersion = ").append(MajorOperatingSystemVersion).append(NL); //$NON-NLS-1$
|
||||
buffer.append("MinorOSVersion = ").append(MinorOperatingSystemVersion).append(NL); //$NON-NLS-1$
|
||||
buffer.append("MajorImageVersion = ").append(MajorImageVersion).append(NL); //$NON-NLS-1$
|
||||
buffer.append("MinorImageVersion = ").append(MinorImageVersion).append(NL); //$NON-NLS-1$
|
||||
buffer.append("MajorSubVersion = ").append(MajorSubsystemVersion).append(NL); //$NON-NLS-1$
|
||||
buffer.append("MinorSubVersion = ").append(MinorSubsystemVersion).append(NL); //$NON-NLS-1$
|
||||
buffer.append("Reserved = ").append(Reserved).append(NL); //$NON-NLS-1$
|
||||
buffer.append("SizeOfImage = ").append(SizeOfImage).append(NL); //$NON-NLS-1$
|
||||
buffer.append("SizeOfHeaders = ").append(SizeOfHeaders).append(NL); //$NON-NLS-1$
|
||||
buffer.append("CheckSum = ").append(CheckSum).append(NL); //$NON-NLS-1$
|
||||
buffer.append("Subsystem = ").append(Subsystem).append(NL); //$NON-NLS-1$
|
||||
buffer.append("DLL = ").append(DLLCharacteristics).append(NL); //$NON-NLS-1$
|
||||
buffer.append("StackReserve = ").append(SizeOfStackReserve).append(NL); //$NON-NLS-1$
|
||||
buffer.append("StackCommit = ").append(SizeOfStackCommit).append(NL); //$NON-NLS-1$
|
||||
buffer.append("HeapReserve = ").append(SizeOfHeapReserve).append(NL); //$NON-NLS-1$
|
||||
buffer.append("HeapCommit = ").append(SizeOfHeapCommit).append(NL); //$NON-NLS-1$
|
||||
buffer.append("LoaderFlags = ").append(LoaderFlags).append(NL);; //$NON-NLS-1$
|
||||
buffer.append("#Rva size = ").append(NumberOfRvaAndSizes).append(NL); //$NON-NLS-1$
|
||||
return buffer.toString();
|
||||
}
|
||||
}
|
||||
|
@ -232,8 +232,8 @@ public class PE {
|
|||
|
||||
public String toString() {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
buffer.append("rva = ").append(rva).append(" ");
|
||||
buffer.append("size = ").append(size).append(NL);
|
||||
buffer.append("rva = ").append(rva).append(" "); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
buffer.append("size = ").append(size).append(NL); //$NON-NLS-1$
|
||||
return buffer.toString();
|
||||
}
|
||||
}
|
||||
|
@ -264,11 +264,11 @@ public class PE {
|
|||
|
||||
public String toString() {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
buffer.append("rva = ").append(rva);
|
||||
buffer.append(" timestamp = ").append(timestamp);
|
||||
buffer.append(" forwarder = ").append(forwarder);
|
||||
buffer.append(" name = ").append(name);
|
||||
buffer.append(" thunk = ").append(thunk).append(NL);
|
||||
buffer.append("rva = ").append(rva); //$NON-NLS-1$
|
||||
buffer.append(" timestamp = ").append(timestamp); //$NON-NLS-1$
|
||||
buffer.append(" forwarder = ").append(forwarder); //$NON-NLS-1$
|
||||
buffer.append(" name = ").append(name); //$NON-NLS-1$
|
||||
buffer.append(" thunk = ").append(thunk).append(NL); //$NON-NLS-1$
|
||||
return buffer.toString();
|
||||
}
|
||||
}
|
||||
|
@ -283,7 +283,7 @@ public class PE {
|
|||
|
||||
public PE (String filename, long pos, boolean filter) throws IOException {
|
||||
try {
|
||||
rfile = new RandomAccessFile(filename, "r");
|
||||
rfile = new RandomAccessFile(filename, "r"); //$NON-NLS-1$
|
||||
this.filename = filename;
|
||||
rfile.seek(pos);
|
||||
|
||||
|
@ -349,55 +349,55 @@ public class PE {
|
|||
// Machine type.
|
||||
switch (filhdr.f_magic) {
|
||||
case PEConstants.IMAGE_FILE_MACHINE_UNKNOWN:
|
||||
attrib.cpu = "none";
|
||||
attrib.cpu = "none"; //$NON-NLS-1$
|
||||
break;
|
||||
case PEConstants.IMAGE_FILE_MACHINE_ALPHA:
|
||||
attrib.cpu = "alpha";
|
||||
attrib.cpu = "alpha"; //$NON-NLS-1$
|
||||
break;
|
||||
case PEConstants.IMAGE_FILE_MACHINE_ARM:
|
||||
attrib.cpu = "arm";
|
||||
attrib.cpu = "arm"; //$NON-NLS-1$
|
||||
break;
|
||||
case PEConstants.IMAGE_FILE_MACHINE_ALPHA64:
|
||||
attrib.cpu = "arm64";
|
||||
attrib.cpu = "arm64"; //$NON-NLS-1$
|
||||
break;
|
||||
case PEConstants.IMAGE_FILE_MACHINE_I386:
|
||||
attrib.cpu = "x86";
|
||||
attrib.cpu = "x86"; //$NON-NLS-1$
|
||||
break;
|
||||
case PEConstants.IMAGE_FILE_MACHINE_IA64:
|
||||
attrib.cpu = "ia64";
|
||||
attrib.cpu = "ia64"; //$NON-NLS-1$
|
||||
break;
|
||||
case PEConstants.IMAGE_FILE_MACHINE_M68K:
|
||||
attrib.cpu = "m68k";
|
||||
attrib.cpu = "m68k"; //$NON-NLS-1$
|
||||
break;
|
||||
case PEConstants.IMAGE_FILE_MACHINE_MIPS16:
|
||||
attrib.cpu = "mips16";
|
||||
attrib.cpu = "mips16"; //$NON-NLS-1$
|
||||
break;
|
||||
case PEConstants.IMAGE_FILE_MACHINE_MIPSFPU:
|
||||
attrib.cpu = "mipsfpu";
|
||||
attrib.cpu = "mipsfpu"; //$NON-NLS-1$
|
||||
break;
|
||||
case PEConstants.IMAGE_FILE_MACHINE_MIPSFPU16:
|
||||
attrib.cpu = "mipsfpu16";
|
||||
attrib.cpu = "mipsfpu16"; //$NON-NLS-1$
|
||||
break;
|
||||
case PEConstants.IMAGE_FILE_MACHINE_POWERPC:
|
||||
attrib.cpu = "powerpc";
|
||||
attrib.cpu = "powerpc"; //$NON-NLS-1$
|
||||
break;
|
||||
case PEConstants.IMAGE_FILE_MACHINE_R3000:
|
||||
attrib.cpu = "r3000";
|
||||
attrib.cpu = "r3000"; //$NON-NLS-1$
|
||||
break;
|
||||
case PEConstants.IMAGE_FILE_MACHINE_R4000:
|
||||
attrib.cpu = "r4000";
|
||||
attrib.cpu = "r4000"; //$NON-NLS-1$
|
||||
break;
|
||||
case PEConstants.IMAGE_FILE_MACHINE_R10000:
|
||||
attrib.cpu = "r10000";
|
||||
attrib.cpu = "r10000"; //$NON-NLS-1$
|
||||
break;
|
||||
case PEConstants.IMAGE_FILE_MACHINE_SH3:
|
||||
attrib.cpu = "sh3";
|
||||
attrib.cpu = "sh3"; //$NON-NLS-1$
|
||||
break;
|
||||
case PEConstants.IMAGE_FILE_MACHINE_SH4:
|
||||
attrib.cpu = "sh4";
|
||||
attrib.cpu = "sh4"; //$NON-NLS-1$
|
||||
break;
|
||||
case PEConstants.IMAGE_FILE_MACHINE_THUMB:
|
||||
attrib.cpu = "thumb";
|
||||
attrib.cpu = "thumb"; //$NON-NLS-1$
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -583,8 +583,8 @@ public class PE {
|
|||
try {
|
||||
ImageDataDirectory[] dirs = getImageDataDirectories();
|
||||
for (int i = 0; i < dirs.length; i++) {
|
||||
buffer.append("Entry ").append(i);
|
||||
buffer.append(" ").append(dirs[i]);
|
||||
buffer.append("Entry ").append(i); //$NON-NLS-1$
|
||||
buffer.append(" ").append(dirs[i]); //$NON-NLS-1$
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
|
@ -622,7 +622,7 @@ public class PE {
|
|||
|
||||
RandomAccessFile getRandomAccessFile () throws IOException {
|
||||
if (rfile == null) {
|
||||
rfile = new RandomAccessFile(filename, "r");
|
||||
rfile = new RandomAccessFile(filename, "r"); //$NON-NLS-1$
|
||||
}
|
||||
return rfile;
|
||||
}
|
||||
|
|
|
@ -222,9 +222,9 @@ public class PEArchive {
|
|||
*/
|
||||
public PEArchive(String filename) throws IOException {
|
||||
this.filename = filename;
|
||||
rfile = new RandomAccessFile(filename, "r");
|
||||
rfile = new RandomAccessFile(filename, "r"); //$NON-NLS-1$
|
||||
String hdr = rfile.readLine();
|
||||
if (hdr == null || hdr.compareTo("!<arch>") != 0) {
|
||||
if (hdr == null || hdr.compareTo("!<arch>") != 0) { //$NON-NLS-1$
|
||||
rfile.close();
|
||||
throw new IOException("Not a valid archive file.");
|
||||
}
|
||||
|
@ -255,7 +255,7 @@ public class PEArchive {
|
|||
//
|
||||
// If the name is "//" then this is the string table section.
|
||||
//
|
||||
if (name.compareTo("//") == 0)
|
||||
if (name.compareTo("//") == 0) //$NON-NLS-1$
|
||||
strtbl_pos = pos;
|
||||
|
||||
//
|
||||
|
@ -306,14 +306,14 @@ public class PEArchive {
|
|||
if (names != null && !stringInStrings(object_name, names))
|
||||
continue;
|
||||
|
||||
object_name = "" + count + "_" + object_name;
|
||||
object_name = "" + count + "_" + object_name; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
count++;
|
||||
|
||||
byte[] data = headers[i].getObjectData();
|
||||
File output = new File(outdir, object_name);
|
||||
names_used.add(object_name);
|
||||
|
||||
RandomAccessFile rfile = new RandomAccessFile(output, "rw");
|
||||
RandomAccessFile rfile = new RandomAccessFile(output, "rw"); //$NON-NLS-1$
|
||||
rfile.write(data);
|
||||
rfile.close();
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ public class ARMember extends BinaryObject {
|
|||
if (header != null) {
|
||||
return header.getObjectName();
|
||||
}
|
||||
return "";
|
||||
return ""; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
protected PE getPE() throws IOException {
|
||||
|
|
|
@ -96,7 +96,7 @@ public class BinaryObject extends BinaryFile implements IBinaryObject {
|
|||
if (attr != null) {
|
||||
return attribute.getCPU();
|
||||
}
|
||||
return "";
|
||||
return ""; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -169,7 +169,7 @@ public class BinaryObject extends BinaryFile implements IBinaryObject {
|
|||
* @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryShared#getSoName()
|
||||
*/
|
||||
public String getSoName() {
|
||||
return "";
|
||||
return ""; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
protected PE getPE() throws IOException {
|
||||
|
@ -262,7 +262,7 @@ public class BinaryObject extends BinaryFile implements IBinaryObject {
|
|||
try {
|
||||
String filename = addr2line.getFileName(sym.addr);
|
||||
// Addr2line returns the funny "??" when it can not find the file.
|
||||
if (filename != null && filename.equals("??")) {
|
||||
if (filename != null && filename.equals("??")) { //$NON-NLS-1$
|
||||
filename = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ public class BinaryShared extends BinaryExecutable implements IBinaryShared {
|
|||
if (soname != null) {
|
||||
return soname;
|
||||
}
|
||||
return "";
|
||||
return ""; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -40,7 +40,7 @@ public class CygwinPEParser extends PEParser implements IBinaryParser, ICygwinTo
|
|||
* @see org.eclipse.cdt.core.model.IBinaryParser#getFormat()
|
||||
*/
|
||||
public String getFormat() {
|
||||
return "Cygwin PE";
|
||||
return "Cygwin PE"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
|
@ -69,7 +69,7 @@ public class PEParser extends AbstractCExtension implements IBinaryParser {
|
|||
* @see org.eclipse.cdt.core.model.IBinaryParser#getFormat()
|
||||
*/
|
||||
public String getFormat() {
|
||||
return "PE";
|
||||
return "PE"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
|
@ -135,7 +135,7 @@ public class Symbol implements ISymbol {
|
|||
stopAddr2Line();
|
||||
}
|
||||
};
|
||||
new Thread(worker, "Addr2line Reaper").start();
|
||||
new Thread(worker, "Addr2line Reaper").start(); //$NON-NLS-1$
|
||||
}
|
||||
} else {
|
||||
timestamp = System.currentTimeMillis();
|
||||
|
|
|
@ -31,7 +31,7 @@ public class DebugType {
|
|||
int size = arrayType.getSize();
|
||||
DebugType type = arrayType.getComponentType();
|
||||
sb.append(type.toString());
|
||||
sb.append(" [").append(size).append(']');
|
||||
sb.append(" [").append(size).append(']'); //$NON-NLS-1$
|
||||
} else if (this instanceof DebugDerivedType) {
|
||||
DebugDerivedType derived = (DebugDerivedType)this;
|
||||
DebugType component = derived.getComponentType();
|
||||
|
@ -42,9 +42,9 @@ public class DebugType {
|
|||
sb.append(component.toString());
|
||||
}
|
||||
if (this instanceof DebugPointerType) {
|
||||
sb.append(" *");
|
||||
sb.append(" *"); //$NON-NLS-1$
|
||||
} else if (this instanceof DebugReferenceType) {
|
||||
sb.append(" &");
|
||||
sb.append(" &"); //$NON-NLS-1$
|
||||
} else if (this instanceof DebugCrossRefType && component == null) {
|
||||
DebugCrossRefType crossRef = (DebugCrossRefType)this;
|
||||
sb.append(crossRef.getCrossRefName());
|
||||
|
@ -58,27 +58,27 @@ public class DebugType {
|
|||
DebugFunctionType function = (DebugFunctionType)this;
|
||||
DebugType type = function.getReturnType();
|
||||
sb.append(type.toString());
|
||||
sb.append(" (*())");
|
||||
sb.append(" (*())"); //$NON-NLS-1$
|
||||
} else if (this instanceof DebugEnumType) {
|
||||
DebugEnumType enum = (DebugEnumType)this;
|
||||
DebugEnumField[] fields = enum.getDebugEnumFields();
|
||||
sb.append("enum ").append(enum.getName()).append(" {");
|
||||
sb.append("enum ").append(enum.getName()).append(" {"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
for (int i = 0; i < fields.length; i++) {
|
||||
if (i > 0) {
|
||||
sb.append(',');
|
||||
}
|
||||
sb.append(' ').append(fields[i].getName());
|
||||
sb.append(" = ").append(fields[i].getValue());
|
||||
sb.append(" = ").append(fields[i].getValue()); //$NON-NLS-1$
|
||||
}
|
||||
sb.append(" }");
|
||||
sb.append(" }"); //$NON-NLS-1$
|
||||
} else if (this instanceof DebugStructType) {
|
||||
DebugStructType struct = (DebugStructType)this;
|
||||
if (struct.isUnion()) {
|
||||
sb.append("union ");
|
||||
sb.append("union "); //$NON-NLS-1$
|
||||
} else {
|
||||
sb.append("struct ");
|
||||
sb.append("struct "); //$NON-NLS-1$
|
||||
}
|
||||
sb.append(struct.getName()).append(" {");
|
||||
sb.append(struct.getName()).append(" {"); //$NON-NLS-1$
|
||||
DebugField[] fields = struct.getDebugFields();
|
||||
for (int i = 0; i < fields.length; i++) {
|
||||
if (i > 0) {
|
||||
|
@ -87,7 +87,7 @@ public class DebugType {
|
|||
sb.append(' ').append(fields[i].getDebugType());
|
||||
sb.append(' ').append(fields[i].getName());
|
||||
}
|
||||
sb.append(" }");
|
||||
sb.append(" }"); //$NON-NLS-1$
|
||||
} else if (this instanceof DebugUnknownType) {
|
||||
DebugUnknownType unknown = (DebugUnknownType)this;
|
||||
sb.append(unknown.getName());
|
||||
|
|
|
@ -30,20 +30,20 @@ import org.eclipse.cdt.utils.elf.Elf;
|
|||
public class Dwarf {
|
||||
|
||||
/* Section names. */
|
||||
final static String DWARF_DEBUG_INFO = ".debug_info";
|
||||
final static String DWARF_DEBUG_ABBREV = ".debug_abbrev";
|
||||
final static String DWARF_DEBUG_ARANGES = ".debug_aranges";
|
||||
final static String DWARF_DEBUG_LINE = ".debug_line";
|
||||
final static String DWARF_DEBUG_FRAME = ".debug_frame";
|
||||
final static String DWARF_EH_FRAME = ".eh_frame";
|
||||
final static String DWARF_DEBUG_LOC = ".debug_loc";
|
||||
final static String DWARF_DEBUG_PUBNAMES = ".debug_pubnames";
|
||||
final static String DWARF_DEBUG_STR = ".debug_str";
|
||||
final static String DWARF_DEBUG_FUNCNAMES = ".debug_funcnames";
|
||||
final static String DWARF_DEBUG_TYPENAMES = ".debug_typenames";
|
||||
final static String DWARF_DEBUG_VARNAMES = ".debug_varnames";
|
||||
final static String DWARF_DEBUG_WEAKNAMES = ".debug_weaknames";
|
||||
final static String DWARF_DEBUG_MACINFO = ".debug_macinfo";
|
||||
final static String DWARF_DEBUG_INFO = ".debug_info"; //$NON-NLS-1$
|
||||
final static String DWARF_DEBUG_ABBREV = ".debug_abbrev"; //$NON-NLS-1$
|
||||
final static String DWARF_DEBUG_ARANGES = ".debug_aranges"; //$NON-NLS-1$
|
||||
final static String DWARF_DEBUG_LINE = ".debug_line"; //$NON-NLS-1$
|
||||
final static String DWARF_DEBUG_FRAME = ".debug_frame"; //$NON-NLS-1$
|
||||
final static String DWARF_EH_FRAME = ".eh_frame"; //$NON-NLS-1$
|
||||
final static String DWARF_DEBUG_LOC = ".debug_loc"; //$NON-NLS-1$
|
||||
final static String DWARF_DEBUG_PUBNAMES = ".debug_pubnames"; //$NON-NLS-1$
|
||||
final static String DWARF_DEBUG_STR = ".debug_str"; //$NON-NLS-1$
|
||||
final static String DWARF_DEBUG_FUNCNAMES = ".debug_funcnames"; //$NON-NLS-1$
|
||||
final static String DWARF_DEBUG_TYPENAMES = ".debug_typenames"; //$NON-NLS-1$
|
||||
final static String DWARF_DEBUG_VARNAMES = ".debug_varnames"; //$NON-NLS-1$
|
||||
final static String DWARF_DEBUG_WEAKNAMES = ".debug_weaknames"; //$NON-NLS-1$
|
||||
final static String DWARF_DEBUG_MACINFO = ".debug_macinfo"; //$NON-NLS-1$
|
||||
final static String[] DWARF_SCNNAMES =
|
||||
{
|
||||
DWARF_DEBUG_INFO,
|
||||
|
@ -68,10 +68,10 @@ public class Dwarf {
|
|||
byte addressSize;
|
||||
public String toString() {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append("Length: " + length).append("\n");
|
||||
sb.append("Version: " + version).append("\n");
|
||||
sb.append("Abbreviation: " + abbreviationOffset).append("\n");
|
||||
sb.append("Address size: " + addressSize).append("\n");
|
||||
sb.append("Length: " + length).append("\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
sb.append("Version: " + version).append("\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
sb.append("Abbreviation: " + abbreviationOffset).append("\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
sb.append("Address size: " + addressSize).append("\n"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
@ -102,8 +102,8 @@ public class Dwarf {
|
|||
}
|
||||
public String toString() {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append("name: " + Long.toHexString(name));
|
||||
sb.append(" value: " + Long.toHexString(form));
|
||||
sb.append("name: " + Long.toHexString(name)); //$NON-NLS-1$
|
||||
sb.append(" value: " + Long.toHexString(form)); //$NON-NLS-1$
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
@ -340,7 +340,7 @@ public class Dwarf {
|
|||
header.abbreviationOffset = read_4_bytes(data, offset + 6);
|
||||
header.addressSize = data[offset + 10];
|
||||
|
||||
System.out.println("Compilation Unit @ " + Long.toHexString(offset));
|
||||
System.out.println("Compilation Unit @ " + Long.toHexString(offset)); //$NON-NLS-1$
|
||||
System.out.println(header);
|
||||
|
||||
// read the abbrev section.
|
||||
|
@ -562,7 +562,7 @@ public class Dwarf {
|
|||
void processDebugInfoEntry(IDebugEntryRequestor requestor, AbbreviationEntry entry, List list) {
|
||||
int len = list.size();
|
||||
int tag = (int) entry.tag;
|
||||
System.out.println("Abbrev Number " + entry.code);
|
||||
System.out.println("Abbrev Number " + entry.code); //$NON-NLS-1$
|
||||
for (int i = 0; i < len; i++) {
|
||||
AttributeValue av = (AttributeValue) list.get(i);
|
||||
System.out.println(av);
|
||||
|
@ -656,7 +656,7 @@ public class Dwarf {
|
|||
void processSubProgram(IDebugEntryRequestor requestor, List list) {
|
||||
long lowPC = 0;
|
||||
long highPC = 0;
|
||||
String funcName = "";
|
||||
String funcName = ""; //$NON-NLS-1$
|
||||
boolean isExtern = false;
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
|
@ -683,7 +683,7 @@ public class Dwarf {
|
|||
} catch (ClassCastException e) {
|
||||
}
|
||||
}
|
||||
requestor.enterFunction(funcName, new DebugUnknownType(""), isExtern, lowPC);
|
||||
requestor.enterFunction(funcName, new DebugUnknownType(""), isExtern, lowPC); //$NON-NLS-1$
|
||||
requestor.exitFunction(highPC);
|
||||
}
|
||||
|
||||
|
|
|
@ -64,94 +64,94 @@ public final class StabConstant {
|
|||
public static String type2String(int t) {
|
||||
switch (t) {
|
||||
case N_UNDF :
|
||||
return "UNDF";
|
||||
return "UNDF"; //$NON-NLS-1$
|
||||
case N_GSYM :
|
||||
return "GSYM";
|
||||
return "GSYM"; //$NON-NLS-1$
|
||||
case N_FNAME :
|
||||
return "FNAME";
|
||||
return "FNAME"; //$NON-NLS-1$
|
||||
case N_FUN :
|
||||
return "FUN";
|
||||
return "FUN"; //$NON-NLS-1$
|
||||
case N_STSYM :
|
||||
return "STSYM";
|
||||
return "STSYM"; //$NON-NLS-1$
|
||||
case N_LCSYM :
|
||||
return "LCSYM";
|
||||
return "LCSYM"; //$NON-NLS-1$
|
||||
case N_MAIN :
|
||||
return "MAIN";
|
||||
return "MAIN"; //$NON-NLS-1$
|
||||
case N_ROSYM :
|
||||
return "ROSYM";
|
||||
return "ROSYM"; //$NON-NLS-1$
|
||||
case N_PC :
|
||||
return "PC";
|
||||
return "PC"; //$NON-NLS-1$
|
||||
case N_NSYMS :
|
||||
return "SSYMS";
|
||||
return "SSYMS"; //$NON-NLS-1$
|
||||
case N_NOMAP :
|
||||
return "NOMAP";
|
||||
return "NOMAP"; //$NON-NLS-1$
|
||||
case N_OBJ :
|
||||
return "OBJ";
|
||||
return "OBJ"; //$NON-NLS-1$
|
||||
case N_OPT :
|
||||
return "OPT";
|
||||
return "OPT"; //$NON-NLS-1$
|
||||
case N_RSYM :
|
||||
return "RSYM";
|
||||
return "RSYM"; //$NON-NLS-1$
|
||||
case N_M2C :
|
||||
return "M2C";
|
||||
return "M2C"; //$NON-NLS-1$
|
||||
case N_SLINE :
|
||||
return "SLINE";
|
||||
return "SLINE"; //$NON-NLS-1$
|
||||
case N_DSLINE :
|
||||
return "DSLINE";
|
||||
return "DSLINE"; //$NON-NLS-1$
|
||||
case N_BSLINE :
|
||||
return "BSLINE";
|
||||
return "BSLINE"; //$NON-NLS-1$
|
||||
case N_DEFD :
|
||||
return "DEFD";
|
||||
return "DEFD"; //$NON-NLS-1$
|
||||
case N_FLINE :
|
||||
return "FLINE";
|
||||
return "FLINE"; //$NON-NLS-1$
|
||||
case N_EHDECL :
|
||||
return "EHDECL";
|
||||
return "EHDECL"; //$NON-NLS-1$
|
||||
case N_CATCH :
|
||||
return "CATCH";
|
||||
return "CATCH"; //$NON-NLS-1$
|
||||
case N_SSYM :
|
||||
return "SSYM";
|
||||
return "SSYM"; //$NON-NLS-1$
|
||||
case N_ENDM :
|
||||
return "ENDM";
|
||||
return "ENDM"; //$NON-NLS-1$
|
||||
case N_SO :
|
||||
return "SO";
|
||||
return "SO"; //$NON-NLS-1$
|
||||
case N_LSYM :
|
||||
return "LSYM";
|
||||
return "LSYM"; //$NON-NLS-1$
|
||||
case N_BINCL :
|
||||
return "BINCL";
|
||||
return "BINCL"; //$NON-NLS-1$
|
||||
case N_SOL :
|
||||
return "SOL";
|
||||
return "SOL"; //$NON-NLS-1$
|
||||
case N_PSYM :
|
||||
return "PSYM";
|
||||
return "PSYM"; //$NON-NLS-1$
|
||||
case N_EINCL :
|
||||
return "EINCL";
|
||||
return "EINCL"; //$NON-NLS-1$
|
||||
case N_ENTRY :
|
||||
return "ENTRY";
|
||||
return "ENTRY"; //$NON-NLS-1$
|
||||
case N_LBRAC :
|
||||
return "LBRAC";
|
||||
return "LBRAC"; //$NON-NLS-1$
|
||||
case N_EXCL :
|
||||
return "EXCL";
|
||||
return "EXCL"; //$NON-NLS-1$
|
||||
case N_SCOPE:
|
||||
return "SCOPE";
|
||||
return "SCOPE"; //$NON-NLS-1$
|
||||
case N_RBRAC :
|
||||
return "RBRAC";
|
||||
return "RBRAC"; //$NON-NLS-1$
|
||||
case N_BCOMM :
|
||||
return "COMM";
|
||||
return "COMM"; //$NON-NLS-1$
|
||||
case N_ECOMM :
|
||||
return "ECOMM";
|
||||
return "ECOMM"; //$NON-NLS-1$
|
||||
case N_ECOML :
|
||||
return "ECOML";
|
||||
return "ECOML"; //$NON-NLS-1$
|
||||
case N_WITH :
|
||||
return "WITH";
|
||||
return "WITH"; //$NON-NLS-1$
|
||||
case N_NBTEXT :
|
||||
return "NBTEXT";
|
||||
return "NBTEXT"; //$NON-NLS-1$
|
||||
case N_NBDATA :
|
||||
return "NBDATA";
|
||||
return "NBDATA"; //$NON-NLS-1$
|
||||
case N_NBBSS :
|
||||
return "NBBSS";
|
||||
return "NBBSS"; //$NON-NLS-1$
|
||||
case N_NBSTS :
|
||||
return "NBSTS";
|
||||
return "NBSTS"; //$NON-NLS-1$
|
||||
case N_NBLCS :
|
||||
return "NBLCS";
|
||||
return "NBLCS"; //$NON-NLS-1$
|
||||
}
|
||||
return "" + t;
|
||||
return "" + t; //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,9 +39,9 @@ import org.eclipse.cdt.utils.elf.Elf;
|
|||
|
||||
public class Stabs {
|
||||
|
||||
final static String LLLOW = "01000000000000000000000";
|
||||
final static String LLHIGH = "0777777777777777777777";
|
||||
final static String ULLHIGH = "01777777777777777777777";
|
||||
final static String LLLOW = "01000000000000000000000"; //$NON-NLS-1$
|
||||
final static String LLHIGH = "0777777777777777777777"; //$NON-NLS-1$
|
||||
final static String ULLHIGH = "01777777777777777777777"; //$NON-NLS-1$
|
||||
|
||||
byte[] stabData;
|
||||
byte[] stabstrData;
|
||||
|
@ -55,7 +55,7 @@ public class Stabs {
|
|||
String currentFile;
|
||||
|
||||
Map mapTypes = new HashMap();
|
||||
DebugType voidType = new DebugBaseType("void", 0, false);
|
||||
DebugType voidType = new DebugBaseType("void", 0, false); //$NON-NLS-1$
|
||||
|
||||
public Stabs(String file) throws IOException {
|
||||
Elf exe = new Elf(file);
|
||||
|
@ -77,9 +77,9 @@ public class Stabs {
|
|||
Elf.Section[] sections = exe.getSections();
|
||||
for (int i = 0; i < sections.length; i++) {
|
||||
String name = sections[i].toString();
|
||||
if (name.equals(".stab")) {
|
||||
if (name.equals(".stab")) { //$NON-NLS-1$
|
||||
data = sections[i].loadSectionData();
|
||||
} else if (name.equals(".stabstr")) {
|
||||
} else if (name.equals(".stabstr")) { //$NON-NLS-1$
|
||||
stabstr = sections[i].loadSectionData();
|
||||
}
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ public class Stabs {
|
|||
// According to the spec all the other fields are duplicated so we
|
||||
// still have the data.
|
||||
// From the spec continuation line on AIX is '?'
|
||||
if (field.endsWith("\\") || field.endsWith("?")) {
|
||||
if (field.endsWith("\\") || field.endsWith("?")) { //$NON-NLS-1$ //$NON-NLS-2$
|
||||
field = field.substring(0, field.length() - 1);
|
||||
if (holder == null) {
|
||||
holder = field;
|
||||
|
@ -215,7 +215,7 @@ public class Stabs {
|
|||
}
|
||||
// Start a new Function
|
||||
if (field.length() == 0) {
|
||||
field = " anon ";
|
||||
field = " anon "; //$NON-NLS-1$
|
||||
}
|
||||
inFunction = true;
|
||||
parseStabString(requestor, field, value);
|
||||
|
@ -278,7 +278,7 @@ public class Stabs {
|
|||
if (field != null && field.length() > 0) {
|
||||
// if it ends with "/" do not call the entering yet
|
||||
// we have to concatenate the next one.
|
||||
if (field.endsWith("/")) {
|
||||
if (field.endsWith("/")) { //$NON-NLS-1$
|
||||
currentFile = field;
|
||||
} else {
|
||||
if (currentFile != null) {
|
||||
|
@ -314,7 +314,7 @@ public class Stabs {
|
|||
String information = sf.getTypeInformation();
|
||||
String paramName = sf.getName();
|
||||
DebugParameterKind paramKind = DebugParameterKind.REGISTER_REFERENCE;
|
||||
DebugType paramType = parseStabType("", information);
|
||||
DebugType paramType = parseStabType("", information); //$NON-NLS-1$
|
||||
requestor.acceptParameter(paramName, paramType, paramKind, value);
|
||||
}
|
||||
break;
|
||||
|
@ -339,7 +339,7 @@ public class Stabs {
|
|||
{
|
||||
String excName = sf.getName();
|
||||
String information = sf.getTypeInformation();
|
||||
DebugType excType = parseStabType("", information);
|
||||
DebugType excType = parseStabType("", information); //$NON-NLS-1$
|
||||
requestor.acceptCaughtException(excName, excType, value);
|
||||
}
|
||||
break;
|
||||
|
@ -351,7 +351,7 @@ public class Stabs {
|
|||
{
|
||||
String funcName = sf.getName();
|
||||
String funcInfo = sf.getTypeInformation();
|
||||
DebugType funcType = parseStabType("", funcInfo);
|
||||
DebugType funcType = parseStabType("", funcInfo); //$NON-NLS-1$
|
||||
boolean funcGlobal = sf.getSymbolDescriptor() == 'F';
|
||||
requestor.enterFunction(funcName, funcType, funcGlobal, value);
|
||||
}
|
||||
|
@ -362,7 +362,7 @@ public class Stabs {
|
|||
String varName = sf.getName();
|
||||
String varInfo = sf.getTypeInformation();
|
||||
DebugVariableKind varKind = DebugVariableKind.GLOBAL;
|
||||
DebugType varType = parseStabType("", varInfo);
|
||||
DebugType varType = parseStabType("", varInfo); //$NON-NLS-1$
|
||||
requestor.acceptVariable(varName, varType, varKind, value);
|
||||
}
|
||||
break;
|
||||
|
@ -389,7 +389,7 @@ public class Stabs {
|
|||
String paramName = sf.getName();
|
||||
String paramInfo = sf.getTypeInformation();
|
||||
DebugParameterKind paramKind = DebugParameterKind.STACK;
|
||||
DebugType paramType = parseStabType("", paramInfo);
|
||||
DebugType paramType = parseStabType("", paramInfo); //$NON-NLS-1$
|
||||
requestor.acceptParameter(paramName, paramType, paramKind, value);
|
||||
}
|
||||
break;
|
||||
|
@ -405,7 +405,7 @@ public class Stabs {
|
|||
String paramName = sf.getName();
|
||||
String paramInfo = sf.getTypeInformation();
|
||||
DebugParameterKind paramKind = DebugParameterKind.REGISTER;
|
||||
DebugType paramType = parseStabType("", paramInfo);
|
||||
DebugType paramType = parseStabType("", paramInfo); //$NON-NLS-1$
|
||||
requestor.acceptParameter(paramName, paramType, paramKind, value);
|
||||
}
|
||||
break;
|
||||
|
@ -423,7 +423,7 @@ public class Stabs {
|
|||
String varName = sf.getName();
|
||||
String varInfo = sf.getTypeInformation();
|
||||
DebugVariableKind varKind = DebugVariableKind.REGISTER;
|
||||
DebugType varType = parseStabType("", varInfo);
|
||||
DebugType varType = parseStabType("", varInfo); //$NON-NLS-1$
|
||||
requestor.acceptVariable(varName, varType, varKind, value);
|
||||
}
|
||||
break;
|
||||
|
@ -434,7 +434,7 @@ public class Stabs {
|
|||
String varName = sf.getName();
|
||||
String varInfo = sf.getTypeInformation();
|
||||
DebugVariableKind varKind = DebugVariableKind.STATIC;
|
||||
DebugType varType = parseStabType("", varInfo);
|
||||
DebugType varType = parseStabType("", varInfo); //$NON-NLS-1$
|
||||
requestor.acceptVariable(varName, varType, varKind, value);
|
||||
}
|
||||
break;
|
||||
|
@ -471,7 +471,7 @@ public class Stabs {
|
|||
String paramName = sf.getName();
|
||||
String paramInfo = sf.getTypeInformation();
|
||||
DebugParameterKind paramKind = DebugParameterKind.REFERENCE;
|
||||
DebugType paramType = parseStabType("", paramInfo);
|
||||
DebugType paramType = parseStabType("", paramInfo); //$NON-NLS-1$
|
||||
requestor.acceptParameter(paramName, paramType, paramKind, value);
|
||||
}
|
||||
break;
|
||||
|
@ -482,7 +482,7 @@ public class Stabs {
|
|||
String varName = sf.getName();
|
||||
String varInfo = sf.getTypeInformation();
|
||||
DebugVariableKind varKind = DebugVariableKind.LOCAL_STATIC;
|
||||
DebugType varType = parseStabType("", varInfo);
|
||||
DebugType varType = parseStabType("", varInfo); //$NON-NLS-1$
|
||||
requestor.acceptVariable(varName, varType, varKind, value);
|
||||
}
|
||||
break;
|
||||
|
@ -502,7 +502,7 @@ public class Stabs {
|
|||
String varName = sf.getName();
|
||||
String varInfo = sf.getTypeInformation();
|
||||
DebugVariableKind varKind = DebugVariableKind.LOCAL;
|
||||
DebugType varType = parseStabType("", varInfo);
|
||||
DebugType varType = parseStabType("", varInfo); //$NON-NLS-1$
|
||||
requestor.acceptVariable(varName, varType, varKind, value);
|
||||
}
|
||||
break;
|
||||
|
@ -535,7 +535,7 @@ public class Stabs {
|
|||
// Reference (C++)
|
||||
case '&' :
|
||||
{
|
||||
DebugType subType = parseStabType("", reader);
|
||||
DebugType subType = parseStabType("", reader); //$NON-NLS-1$
|
||||
type = new DebugReferenceType(subType);
|
||||
}
|
||||
break;
|
||||
|
@ -547,7 +547,7 @@ public class Stabs {
|
|||
// pointer type.
|
||||
case '*' :
|
||||
{
|
||||
DebugType subType = parseStabType("", reader);
|
||||
DebugType subType = parseStabType("", reader); //$NON-NLS-1$
|
||||
type = new DebugPointerType(subType);
|
||||
}
|
||||
break;
|
||||
|
@ -603,7 +603,7 @@ public class Stabs {
|
|||
// Function type
|
||||
case 'f' :
|
||||
{
|
||||
DebugType subType = parseStabType("", reader);
|
||||
DebugType subType = parseStabType("", reader); //$NON-NLS-1$
|
||||
type = new DebugFunctionType(subType);
|
||||
}
|
||||
break;
|
||||
|
@ -723,11 +723,11 @@ public class Stabs {
|
|||
StringBuffer sb = new StringBuffer();
|
||||
int c = reader.read();
|
||||
if (c == 's') {
|
||||
sb.append("struct ");
|
||||
sb.append("struct "); //$NON-NLS-1$
|
||||
} else if (c == 'u') {
|
||||
sb.append("union ");
|
||||
sb.append("union "); //$NON-NLS-1$
|
||||
} else if (c == 'e') {
|
||||
sb.append("enum ");
|
||||
sb.append("enum "); //$NON-NLS-1$
|
||||
} else {
|
||||
sb.append((char) c);
|
||||
}
|
||||
|
@ -885,7 +885,7 @@ public class Stabs {
|
|||
// we only understand range for an array.
|
||||
int c = reader.read();
|
||||
if (c == 'r') {
|
||||
DebugType index_type = parseStabType("", reader);
|
||||
DebugType index_type = parseStabType("", reader); //$NON-NLS-1$
|
||||
|
||||
c = reader.read();
|
||||
// Check ';'
|
||||
|
@ -944,7 +944,7 @@ public class Stabs {
|
|||
}
|
||||
|
||||
// The array_content_type
|
||||
DebugType subType = parseStabType("", reader);
|
||||
DebugType subType = parseStabType("", reader); //$NON-NLS-1$
|
||||
|
||||
return new DebugArrayType(subType, upper - lower + 1);
|
||||
}
|
||||
|
@ -1044,7 +1044,7 @@ public class Stabs {
|
|||
String name = sb.toString();
|
||||
|
||||
// get the type of the field
|
||||
DebugType fieldType = parseStabType("", reader);
|
||||
DebugType fieldType = parseStabType("", reader); //$NON-NLS-1$
|
||||
|
||||
c = reader.read();
|
||||
// Sanity check: we should have ',' here.
|
||||
|
@ -1173,9 +1173,9 @@ public class Stabs {
|
|||
if (lowerBound == 0 && upperBound == -1) {
|
||||
// if the lower bound is 0 and the upper bound is -1,
|
||||
// it means unsigned int
|
||||
if (name.equals("long long int")) {
|
||||
if (name.equals("long long int")) { //$NON-NLS-1$
|
||||
rangeType = new DebugBaseType(name, 8, true);
|
||||
} else if (name.equals("long long unsigned int")) {
|
||||
} else if (name.equals("long long unsigned int")) { //$NON-NLS-1$
|
||||
rangeType = new DebugBaseType(name, 8, true);
|
||||
} else {
|
||||
rangeType = new DebugBaseType(name, 4, true);
|
||||
|
@ -1242,7 +1242,7 @@ public class Stabs {
|
|||
case 'e' :
|
||||
{
|
||||
int val = 0;
|
||||
DebugType type = parseStabType("", reader);
|
||||
DebugType type = parseStabType("", reader); //$NON-NLS-1$
|
||||
c = reader.read();
|
||||
if (c == ',') {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
|
@ -1293,13 +1293,13 @@ public class Stabs {
|
|||
}
|
||||
try {
|
||||
String s = sb.toString();
|
||||
if (s.equals("-INF")) {
|
||||
if (s.equals("-INF")) { //$NON-NLS-1$
|
||||
val = Double.NEGATIVE_INFINITY;
|
||||
} else if (s.equals("INF")) {
|
||||
} else if (s.equals("INF")) { //$NON-NLS-1$
|
||||
val = Double.POSITIVE_INFINITY;
|
||||
} else if (s.equals("QNAN")) {
|
||||
} else if (s.equals("QNAN")) { //$NON-NLS-1$
|
||||
val = Double.NaN;
|
||||
} else if (s.equals("SNAN")) {
|
||||
} else if (s.equals("SNAN")) { //$NON-NLS-1$
|
||||
val = Double.NaN;
|
||||
} else {
|
||||
val = Double.parseDouble(s);
|
||||
|
|
|
@ -63,13 +63,13 @@ public class StringField {
|
|||
if (name.length() > 1 && name.charAt(0) == '$') {
|
||||
switch (name.charAt(1)) {
|
||||
case 't' :
|
||||
name = "this";
|
||||
name = "this"; //$NON-NLS-1$
|
||||
break;
|
||||
case 'v' :
|
||||
/* Was: name = "vptr"; */
|
||||
break;
|
||||
case 'e' :
|
||||
name = "eh_throw";
|
||||
name = "eh_throw"; //$NON-NLS-1$
|
||||
break;
|
||||
case '_' :
|
||||
/* This was an anonymous type that was never fixed up. */
|
||||
|
|
|
@ -120,7 +120,7 @@ public class DebugAddr2line {
|
|||
String function = addr2line.getFunction(address);
|
||||
String filename = addr2line.getFileName(address);
|
||||
System.out.println(Long.toHexString(address));
|
||||
System.out.println(filename + ":" + function + ":" + startLine + ":" + endLine);
|
||||
System.out.println(filename + ":" + function + ":" + startLine + ":" + endLine); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ public class DebugSymsRequestor implements IDebugEntryRequestor {
|
|||
DebugSym sym = new DebugSym();
|
||||
sym.name = name;
|
||||
sym.addr = address;
|
||||
sym.type = "CU";
|
||||
sym.type = "CU"; //$NON-NLS-1$
|
||||
sym.filename = name;
|
||||
currentCU = sym;
|
||||
list.add(sym);
|
||||
|
@ -110,7 +110,7 @@ public class DebugSymsRequestor implements IDebugEntryRequestor {
|
|||
DebugSym sym = new DebugSym();
|
||||
sym.name = name;
|
||||
sym.addr = address;
|
||||
sym.type = "Func";
|
||||
sym.type = "Func"; //$NON-NLS-1$
|
||||
if (currentCU != null) {
|
||||
sym.filename = currentCU.filename;
|
||||
}
|
||||
|
@ -145,10 +145,10 @@ public class DebugSymsRequestor implements IDebugEntryRequestor {
|
|||
*/
|
||||
public void acceptStatement(int line, long address) {
|
||||
DebugSym sym = new DebugSym();
|
||||
sym.name = "";
|
||||
sym.name = ""; //$NON-NLS-1$
|
||||
sym.addr = address;
|
||||
sym.startLine = line;
|
||||
sym.type = "SLINE";
|
||||
sym.type = "SLINE"; //$NON-NLS-1$
|
||||
if (currentFunction != null) {
|
||||
if (currentFunction.startLine == 0) {
|
||||
currentFunction.startLine = line;
|
||||
|
@ -186,7 +186,7 @@ public class DebugSymsRequestor implements IDebugEntryRequestor {
|
|||
DebugSym sym = new DebugSym();
|
||||
sym.name = name;
|
||||
sym.addr = offset;
|
||||
sym.type = "PARAM";
|
||||
sym.type = "PARAM"; //$NON-NLS-1$
|
||||
if (currentCU != null) {
|
||||
sym.filename = currentCU.filename;
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ public class DebugSymsRequestor implements IDebugEntryRequestor {
|
|||
DebugSym sym = new DebugSym();
|
||||
sym.name = name;
|
||||
sym.addr = address;
|
||||
sym.type = "VAR";
|
||||
sym.type = "VAR"; //$NON-NLS-1$
|
||||
if (currentCU != null) {
|
||||
sym.filename = currentCU.filename;
|
||||
}
|
||||
|
|
|
@ -197,7 +197,7 @@ public class AR {
|
|||
efile.seek(elf_offset);
|
||||
efile.read(temp);
|
||||
} else {
|
||||
efile = new ERandomAccessFile(filename, "r");
|
||||
efile = new ERandomAccessFile(filename, "r"); //$NON-NLS-1$
|
||||
efile.seek(elf_offset);
|
||||
efile.read(temp);
|
||||
efile.close();
|
||||
|
@ -229,9 +229,9 @@ public class AR {
|
|||
*/
|
||||
public AR(String filename) throws IOException {
|
||||
this.filename = filename;
|
||||
efile = new ERandomAccessFile(filename, "r");
|
||||
efile = new ERandomAccessFile(filename, "r"); //$NON-NLS-1$
|
||||
String hdr = efile.readLine();
|
||||
if (hdr == null || hdr.compareTo("!<arch>") != 0) {
|
||||
if (hdr == null || hdr.compareTo("!<arch>") != 0) { //$NON-NLS-1$
|
||||
efile.close();
|
||||
throw new IOException("Not a valid archive file.");
|
||||
}
|
||||
|
@ -262,7 +262,7 @@ public class AR {
|
|||
//
|
||||
// If the name is "//" then this is the string table section.
|
||||
//
|
||||
if (name.compareTo("//") == 0)
|
||||
if (name.compareTo("//") == 0) //$NON-NLS-1$
|
||||
strtbl_pos = pos;
|
||||
|
||||
//
|
||||
|
@ -312,14 +312,14 @@ public class AR {
|
|||
if (names != null && !stringInStrings(object_name, names))
|
||||
continue;
|
||||
|
||||
object_name = "" + count + "_" + object_name;
|
||||
object_name = "" + count + "_" + object_name; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
count++;
|
||||
|
||||
byte[] data = headers[i].getObjectData();
|
||||
File output = new File(outdir, object_name);
|
||||
names_used.add(object_name);
|
||||
|
||||
RandomAccessFile rfile = new RandomAccessFile(output, "rw");
|
||||
RandomAccessFile rfile = new RandomAccessFile(output, "rw"); //$NON-NLS-1$
|
||||
rfile.write(data);
|
||||
rfile.close();
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ public class Elf {
|
|||
private Symbol[] dynsym_symbols;
|
||||
private Section dynsym_sym;
|
||||
|
||||
protected String EMPTY_STRING = "";
|
||||
protected String EMPTY_STRING = ""; //$NON-NLS-1$
|
||||
|
||||
|
||||
public class ELFhdr {
|
||||
|
@ -311,7 +311,7 @@ public class Elf {
|
|||
private String cppFilt(String in) {
|
||||
if (cppFiltEnabled) {
|
||||
try {
|
||||
if (in.indexOf("__") != -1 || in.indexOf("_._") != -1) {
|
||||
if (in.indexOf("__") != -1 || in.indexOf("_._") != -1) { //$NON-NLS-1$ //$NON-NLS-2$
|
||||
if (cppFilt == null) {
|
||||
cppFilt = new CPPFilt();
|
||||
}
|
||||
|
@ -383,7 +383,7 @@ public class Elf {
|
|||
if (line != null) {
|
||||
int colon = line.lastIndexOf(':');
|
||||
String number = line.substring(colon + 1);
|
||||
if (!number.startsWith("0")) {
|
||||
if (!number.startsWith("0")) { //$NON-NLS-1$
|
||||
break; // bail out
|
||||
}
|
||||
}
|
||||
|
@ -628,7 +628,7 @@ public class Elf {
|
|||
this.cppFiltEnabled = filton;
|
||||
|
||||
try {
|
||||
efile = new ERandomAccessFile(file, "r");
|
||||
efile = new ERandomAccessFile(file, "r"); //$NON-NLS-1$
|
||||
efile.setFileOffset( offset );
|
||||
ehdr = new ELFhdr();
|
||||
this.file = file;
|
||||
|
@ -729,69 +729,69 @@ public class Elf {
|
|||
switch (ehdr.e_machine) {
|
||||
case Elf.ELFhdr.EM_386 :
|
||||
case Elf.ELFhdr.EM_486 :
|
||||
attrib.cpu = "x86";
|
||||
attrib.cpu = "x86"; //$NON-NLS-1$
|
||||
break;
|
||||
case Elf.ELFhdr.EM_68K:
|
||||
attrib.cpu = "m68k";
|
||||
attrib.cpu = "m68k"; //$NON-NLS-1$
|
||||
break;
|
||||
case Elf.ELFhdr.EM_PPC :
|
||||
case Elf.ELFhdr.EM_CYGNUS_POWERPC :
|
||||
case Elf.ELFhdr.EM_RS6000 :
|
||||
attrib.cpu = "ppc";
|
||||
attrib.cpu = "ppc"; //$NON-NLS-1$
|
||||
break;
|
||||
case Elf.ELFhdr.EM_PPC64 :
|
||||
attrib.cpu = "ppc64";
|
||||
attrib.cpu = "ppc64"; //$NON-NLS-1$
|
||||
break;
|
||||
case Elf.ELFhdr.EM_SH :
|
||||
attrib.cpu = "sh";
|
||||
attrib.cpu = "sh"; //$NON-NLS-1$
|
||||
break;
|
||||
case Elf.ELFhdr.EM_ARM :
|
||||
attrib.cpu = "arm";
|
||||
attrib.cpu = "arm"; //$NON-NLS-1$
|
||||
break;
|
||||
case Elf.ELFhdr.EM_MIPS_RS3_LE :
|
||||
case Elf.ELFhdr.EM_MIPS :
|
||||
attrib.cpu = "mips";
|
||||
attrib.cpu = "mips"; //$NON-NLS-1$
|
||||
break;
|
||||
case Elf.ELFhdr.EM_SPARC32PLUS:
|
||||
case Elf.ELFhdr.EM_SPARC:
|
||||
case Elf.ELFhdr.EM_SPARCV9:
|
||||
attrib.cpu = "sparc";
|
||||
attrib.cpu = "sparc"; //$NON-NLS-1$
|
||||
break;
|
||||
case Elf.ELFhdr.EM_H8_300:
|
||||
case Elf.ELFhdr.EM_H8_300H:
|
||||
attrib.cpu = "h8300";
|
||||
attrib.cpu = "h8300"; //$NON-NLS-1$
|
||||
break;
|
||||
case Elf.ELFhdr.EM_V850:
|
||||
case Elf.ELFhdr.EM_CYGNUS_V850:
|
||||
attrib.cpu = "v850";
|
||||
attrib.cpu = "v850"; //$NON-NLS-1$
|
||||
break;
|
||||
case Elf.ELFhdr.EM_MN10300:
|
||||
case Elf.ELFhdr.EM_CYGNUS_MN10300:
|
||||
attrib.cpu = "mn10300";
|
||||
attrib.cpu = "mn10300"; //$NON-NLS-1$
|
||||
break;
|
||||
case Elf.ELFhdr.EM_MN10200:
|
||||
case Elf.ELFhdr.EM_CYGNUS_MN10200:
|
||||
attrib.cpu = "mn10200";
|
||||
attrib.cpu = "mn10200"; //$NON-NLS-1$
|
||||
break;
|
||||
case Elf.ELFhdr.EM_M32R:
|
||||
attrib.cpu = "m32r";
|
||||
attrib.cpu = "m32r"; //$NON-NLS-1$
|
||||
break;
|
||||
case Elf.ELFhdr.EM_FR30:
|
||||
case Elf.ELFhdr.EM_CYGNUS_FR30:
|
||||
attrib.cpu = "fr30";
|
||||
attrib.cpu = "fr30"; //$NON-NLS-1$
|
||||
break;
|
||||
case Elf.ELFhdr.EM_XSTORMY16:
|
||||
attrib.cpu = "xstormy16";
|
||||
attrib.cpu = "xstormy16"; //$NON-NLS-1$
|
||||
break;
|
||||
case Elf.ELFhdr.EM_CYGNUS_FRV:
|
||||
attrib.cpu = "frv";
|
||||
attrib.cpu = "frv"; //$NON-NLS-1$
|
||||
break;
|
||||
case Elf.ELFhdr.EM_IQ2000:
|
||||
attrib.cpu = "iq2000";
|
||||
attrib.cpu = "iq2000"; //$NON-NLS-1$
|
||||
break;
|
||||
case Elf.ELFhdr.EM_NONE:
|
||||
default:
|
||||
attrib.cpu = "none";
|
||||
attrib.cpu = "none"; //$NON-NLS-1$
|
||||
}
|
||||
switch (ehdr.e_ident[Elf.ELFhdr.EI_DATA]) {
|
||||
case Elf.ELFhdr.ELFDATA2LSB :
|
||||
|
@ -807,10 +807,10 @@ public class Elf {
|
|||
if(sec != null) {
|
||||
for (int i = 0; i < sec.length; i++) {
|
||||
String s = sec[i].toString();
|
||||
if (s.equals(".debug_info")) {
|
||||
if (s.equals(".debug_info")) { //$NON-NLS-1$
|
||||
attrib.debugType = Attribute.DEBUG_TYPE_DWARF;
|
||||
break;
|
||||
} else if (s.equals(".stab")) {
|
||||
} else if (s.equals(".stab")) { //$NON-NLS-1$
|
||||
attrib.debugType = Attribute.DEBUG_TYPE_STABS;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ public class ElfHelper {
|
|||
private void loadDynamics() throws IOException {
|
||||
if (dynamics == null) {
|
||||
dynamics = new Elf.Dynamic[0];
|
||||
Elf.Section dynSect = elf.getSectionByName(".dynamic");
|
||||
Elf.Section dynSect = elf.getSectionByName(".dynamic"); //$NON-NLS-1$
|
||||
if (dynSect != null) {
|
||||
dynamics = elf.getDynamicSections(dynSect);
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ public class ElfHelper {
|
|||
}
|
||||
|
||||
public String getSoname() throws IOException {
|
||||
String soname = "";
|
||||
String soname = ""; //$NON-NLS-1$
|
||||
|
||||
loadDynamics();
|
||||
|
||||
|
@ -310,7 +310,7 @@ public class ElfHelper {
|
|||
loadSections();
|
||||
|
||||
for (int i = 0; i < sections.length; i++) {
|
||||
if (sections[i].toString().compareTo("QNX_usage") == 0) {
|
||||
if (sections[i].toString().compareTo("QNX_usage") == 0) { //$NON-NLS-1$
|
||||
File file = new File(elf.getFilename());
|
||||
|
||||
String full_usage = new String(sections[i].loadSectionData());
|
||||
|
@ -327,7 +327,7 @@ public class ElfHelper {
|
|||
return buffer.toString();
|
||||
}
|
||||
}
|
||||
return new String("");
|
||||
return new String(""); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
public Sizes getSizes() throws IOException {
|
||||
|
|
|
@ -57,7 +57,7 @@ public class ARMember extends BinaryObject {
|
|||
if (header != null) {
|
||||
return header.getObjectName();
|
||||
}
|
||||
return "";
|
||||
return ""; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
protected ElfHelper getElfHelper() throws IOException {
|
||||
|
|
|
@ -90,7 +90,7 @@ public class BinaryObject extends BinaryFile implements IBinaryObject {
|
|||
if (attr != null) {
|
||||
return attribute.getCPU();
|
||||
}
|
||||
return "";
|
||||
return ""; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -285,7 +285,7 @@ public class BinaryObject extends BinaryFile implements IBinaryObject {
|
|||
try {
|
||||
String filename = addr2line.getFileName(sym.addr);
|
||||
// Addr2line returns the funny "??" when it can not find the file.
|
||||
sym.filename = (filename != null && !filename.equals("??")) ? new Path(filename) : null;
|
||||
sym.filename = (filename != null && !filename.equals("??")) ? new Path(filename) : null; //$NON-NLS-1$
|
||||
sym.startLine = addr2line.getLineNumber(sym.addr);
|
||||
sym.endLine = addr2line.getLineNumber(sym.addr + sym.size - 1);
|
||||
} catch (IOException e) {
|
||||
|
|
|
@ -37,7 +37,7 @@ public class BinaryShared extends BinaryExecutable implements IBinaryShared {
|
|||
if (soname != null) {
|
||||
return soname;
|
||||
}
|
||||
return "";
|
||||
return ""; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -88,7 +88,7 @@ public class ElfParser extends AbstractCExtension implements IBinaryParser {
|
|||
* @see org.eclipse.cdt.core.model.IBinaryParser#getFormat()
|
||||
*/
|
||||
public String getFormat() {
|
||||
return "ELF";
|
||||
return "ELF"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
|
@ -40,7 +40,7 @@ public class GNUElfParser extends ElfParser implements IBinaryParser, IToolsProv
|
|||
* @see org.eclipse.cdt.core.model.IBinaryParser#getFormat()
|
||||
*/
|
||||
public String getFormat() {
|
||||
return "GNU ELF";
|
||||
return "GNU ELF"; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ public class Symbol implements ISymbol, Comparable {
|
|||
stopAddr2Line();
|
||||
}
|
||||
};
|
||||
new Thread(worker, "Addr2line Reaper").start();
|
||||
new Thread(worker, "Addr2line Reaper").start(); //$NON-NLS-1$
|
||||
}
|
||||
} else {
|
||||
timestamp = System.currentTimeMillis();
|
||||
|
|
|
@ -65,7 +65,7 @@ public class PTY {
|
|||
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("pty");
|
||||
System.loadLibrary("pty"); //$NON-NLS-1$
|
||||
hasPTY = true;
|
||||
} catch (SecurityException e) {
|
||||
} catch (UnsatisfiedLinkError e) {
|
||||
|
|
|
@ -74,7 +74,7 @@ class PTYInputStream extends InputStream {
|
|||
private native int close0(int fd) throws IOException;
|
||||
|
||||
static {
|
||||
System.loadLibrary("pty");
|
||||
System.loadLibrary("pty"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -21,22 +21,22 @@ public class EnvironmentReader {
|
|||
if (null != envVars)
|
||||
return (Properties)envVars.clone();
|
||||
|
||||
String OS = System.getProperty("os.name").toLowerCase();
|
||||
String OS = System.getProperty("os.name").toLowerCase(); //$NON-NLS-1$
|
||||
Process p = null;
|
||||
envVars = new Properties();
|
||||
rawVars = new Vector(32);
|
||||
String command = "env";
|
||||
String command = "env"; //$NON-NLS-1$
|
||||
InputStream in = null;
|
||||
boolean check_ready = false;
|
||||
boolean isWin32 = false;
|
||||
if (OS.startsWith("windows 9") || OS.startsWith("windows me")) { // 95, 98, me
|
||||
command = "command.com /c set";
|
||||
if (OS.startsWith("windows 9") || OS.startsWith("windows me")) { // 95, 98, me //$NON-NLS-1$ //$NON-NLS-2$
|
||||
command = "command.com /c set"; //$NON-NLS-1$
|
||||
//The buffered stream doesn't always like windows 98
|
||||
check_ready = true;
|
||||
isWin32 = true;
|
||||
} else
|
||||
if (OS.startsWith("windows ")) {
|
||||
command = "cmd.exe /c set";
|
||||
if (OS.startsWith("windows ")) { //$NON-NLS-1$
|
||||
command = "cmd.exe /c set"; //$NON-NLS-1$
|
||||
isWin32 = true;
|
||||
}
|
||||
try {
|
||||
|
@ -54,7 +54,7 @@ public class EnvironmentReader {
|
|||
String value = line.substring(idx + 1);
|
||||
envVars.setProperty(key, value);
|
||||
} else {
|
||||
envVars.setProperty(line, "");
|
||||
envVars.setProperty(line, ""); //$NON-NLS-1$
|
||||
}
|
||||
if (check_ready && br.ready() == false) {
|
||||
break;
|
||||
|
|
|
@ -16,11 +16,11 @@ public class ProcessFactory {
|
|||
|
||||
private ProcessFactory() {
|
||||
hasSpawner = false;
|
||||
String OS = System.getProperty("os.name").toLowerCase();
|
||||
String OS = System.getProperty("os.name").toLowerCase(); //$NON-NLS-1$
|
||||
runtime = Runtime.getRuntime();
|
||||
try {
|
||||
// Spawner does not work for Windows 98 fallback
|
||||
if (OS != null && OS.equals("windows 98")) {
|
||||
if (OS != null && OS.equals("windows 98")) { //$NON-NLS-1$
|
||||
hasSpawner = false;
|
||||
} else {
|
||||
System.loadLibrary("spawner"); //$NON-NLS-1$
|
||||
|
|
|
@ -74,7 +74,7 @@ class SpawnerInputStream extends InputStream {
|
|||
private native int close0(int fd) throws IOException;
|
||||
|
||||
static {
|
||||
System.loadLibrary("spawner");
|
||||
System.loadLibrary("spawner"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue