1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-01 13:25:45 +02:00

Bug 53213: Externalize Strings

This commit is contained in:
Andrew Niefer 2004-02-26 23:10:24 +00:00
parent 27c1639a5e
commit 95f42aeb9e
84 changed files with 817 additions and 811 deletions

View file

@ -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 2004-02-26 Alain Magloire
To catch with the documentation change to ICElementDelta To catch with the documentation change to ICElementDelta

View file

@ -34,11 +34,11 @@ public class Node {
public String toString() { public String toString() {
StringBuffer tempBuffer = new StringBuffer(); StringBuffer tempBuffer = new StringBuffer();
tempBuffer.append("[FileRef: "); tempBuffer.append("[FileRef: "); //$NON-NLS-1$
tempBuffer.append(fileRef); tempBuffer.append(fileRef);
tempBuffer.append(", Id: "); tempBuffer.append(", Id: "); //$NON-NLS-1$
tempBuffer.append(nodeId); tempBuffer.append(nodeId);
tempBuffer.append("]"); tempBuffer.append("]"); //$NON-NLS-1$
return tempBuffer.toString(); return tempBuffer.toString();
} }

View file

@ -374,14 +374,14 @@ public class Util {
String[] sourceExtensions = CModelManager.sourceExtensions; String[] sourceExtensions = CModelManager.sourceExtensions;
String[] headerExtensions = CModelManager.headerExtensions; String[] headerExtensions = CModelManager.headerExtensions;
int dot =fileName.lastIndexOf("."); int dot =fileName.lastIndexOf("."); //$NON-NLS-1$
//No extension, give benefit of doubt //No extension, give benefit of doubt
if (dot == -1) if (dot == -1)
return true; return true;
//Extract extension //Extract extension
String extension = ""; String extension = ""; //$NON-NLS-1$
if (dot + 1 <= fileName.length()) if (dot + 1 <= fileName.length())
extension = fileName.substring(dot + 1); extension = fileName.substring(dot + 1);

View file

@ -189,17 +189,17 @@ public class IncludeEntry {
public String toString() { public String toString() {
StringBuffer tempBuffer = new StringBuffer(); StringBuffer tempBuffer = new StringBuffer();
tempBuffer.append("<Name: "); tempBuffer.append("<Name: "); //$NON-NLS-1$
tempBuffer.append(fFile); tempBuffer.append(fFile);
tempBuffer.append(", Id: "); tempBuffer.append(", Id: "); //$NON-NLS-1$
tempBuffer.append(fId); tempBuffer.append(fId);
tempBuffer.append(", Refs:{"); tempBuffer.append(", Refs:{"); //$NON-NLS-1$
for (int i = 0; i < fRefs.length; i++){ for (int i = 0; i < fRefs.length; i++){
if (i > 0) tempBuffer.append(','); if (i > 0) tempBuffer.append(',');
tempBuffer.append(' '); tempBuffer.append(' ');
tempBuffer.append(fRefs[i]); tempBuffer.append(fRefs[i]);
} }
tempBuffer.append("}, Parents:{"); tempBuffer.append("}, Parents:{"); //$NON-NLS-1$
Iterator x = fParent.iterator(); Iterator x = fParent.iterator();
while (x.hasNext()) while (x.hasNext())
{ {
@ -210,7 +210,7 @@ public class IncludeEntry {
tempBuffer.append(' '); tempBuffer.append(' ');
} }
} }
tempBuffer.append("}, Children:{"); tempBuffer.append("}, Children:{"); //$NON-NLS-1$
Iterator y = fChild.iterator(); Iterator y = fChild.iterator();
while (y.hasNext()) while (y.hasNext())
{ {
@ -221,7 +221,7 @@ public class IncludeEntry {
tempBuffer.append(' '); tempBuffer.append(' ');
} }
} }
tempBuffer.append("} >"); tempBuffer.append("} >"); //$NON-NLS-1$
return tempBuffer.toString(); return tempBuffer.toString();
} }
} }

View file

@ -38,7 +38,7 @@ public abstract class AddFileToIndex extends IndexRequest {
monitor.enterWrite(); // ask permission to write monitor.enterWrite(); // ask permission to write
if (!indexDocument(index)) return false; if (!indexDocument(index)) return false;
} catch (IOException e) { } 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) { if (IndexManager.VERBOSE) {
JobManager.verbose("-> failed to index " + this.resource + " because of the following exception:"); //$NON-NLS-1$ //$NON-NLS-2$ JobManager.verbose("-> failed to index " + this.resource + " because of the following exception:"); //$NON-NLS-1$ //$NON-NLS-2$
e.printStackTrace(); e.printStackTrace();

View file

@ -60,10 +60,10 @@ public interface IIndexConstants {
char[] TYPEDEF_DECL = "typeDecl/T/".toCharArray(); //$NON-NLS-1$ char[] TYPEDEF_DECL = "typeDecl/T/".toCharArray(); //$NON-NLS-1$
int TYPEDEF_DECL_LENGTH = 11; int TYPEDEF_DECL_LENGTH = 11;
char[] MACRO_DECL = "macroDecl/".toCharArray(); char[] MACRO_DECL = "macroDecl/".toCharArray(); //$NON-NLS-1$
int MACRO_DECL_LENGTH = 10; int MACRO_DECL_LENGTH = 10;
char[] INCLUDE_REF = "includeRef/".toCharArray(); char[] INCLUDE_REF = "includeRef/".toCharArray(); //$NON-NLS-1$
int INCLUDE_REF_LENGTH = 11; int INCLUDE_REF_LENGTH = 11;
//a Var REF will be treated as a typeREF //a Var REF will be treated as a typeREF
//char[] VAR_REF= "varRef/".toCharArray(); //$NON-NLS-1$ //char[] VAR_REF= "varRef/".toCharArray(); //$NON-NLS-1$

View file

@ -101,18 +101,18 @@ public class SourceIndexer extends AbstractIndexer {
boolean retVal = parser.parse(); boolean retVal = parser.parse();
if (!retVal) 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 (AbstractIndexer.VERBOSE){
if (!retVal) if (!retVal)
AbstractIndexer.verbose("PARSE FAILED " + resourceFile.getName().toString()); AbstractIndexer.verbose("PARSE FAILED " + resourceFile.getName().toString()); //$NON-NLS-1$
else else
AbstractIndexer.verbose("PARSE SUCCEEDED " + resourceFile.getName().toString()); AbstractIndexer.verbose("PARSE SUCCEEDED " + resourceFile.getName().toString()); //$NON-NLS-1$
} }
} }
catch ( VirtualMachineError vmErr){ catch ( VirtualMachineError vmErr){
if (vmErr instanceof OutOfMemoryError){ 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 ){ catch ( Exception ex ){

View file

@ -124,7 +124,7 @@ public class CModelBuilder {
new StringReader( code ), new StringReader( code ),
(translationUnit.getUnderlyingResource() != null ? (translationUnit.getUnderlyingResource() != null ?
translationUnit.getUnderlyingResource().getLocation().toOSString() : translationUnit.getUnderlyingResource().getLocation().toOSString() :
""), ""), //$NON-NLS-1$
scanInfo, scanInfo,
mode, mode,
language, language,
@ -171,7 +171,7 @@ public class CModelBuilder {
// For the debuglog to take place, you have to call // For the debuglog to take place, you have to call
// Util.setDebugging(true); // Util.setDebugging(true);
// Or set debug to true in the core plugin preference // 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; return this.newElements;
} }
@ -345,7 +345,7 @@ public class CModelBuilder {
// create element // create element
String type = "namespace"; //$NON-NLS-1$ String type = "namespace"; //$NON-NLS-1$
String nsName = (nsDef.getName() == null ) String nsName = (nsDef.getName() == null )
? "" ? "" //$NON-NLS-1$
: nsDef.getName().toString(); : nsDef.getName().toString();
Namespace element = new Namespace ((ICElement)parent, nsName ); Namespace element = new Namespace ((ICElement)parent, nsName );
// add to parent // add to parent
@ -364,7 +364,7 @@ public class CModelBuilder {
// create element // create element
String type = "enum"; //$NON-NLS-1$ String type = "enum"; //$NON-NLS-1$
String enumName = (enumSpecifier.getName() == null ) String enumName = (enumSpecifier.getName() == null )
? "" ? "" //$NON-NLS-1$
: enumSpecifier.getName().toString(); : enumSpecifier.getName().toString();
Enumeration element = new Enumeration ((ICElement)parent, enumName ); Enumeration element = new Enumeration ((ICElement)parent, enumName );
// add to parent // add to parent
@ -418,7 +418,7 @@ public class CModelBuilder {
kind = ICElement.C_TEMPLATE_CLASS; kind = ICElement.C_TEMPLATE_CLASS;
type = "class"; //$NON-NLS-1$ type = "class"; //$NON-NLS-1$
className = (classSpecifier.getName() == null ) className = (classSpecifier.getName() == null )
? "" ? "" //$NON-NLS-1$
: classSpecifier.getName().toString(); : classSpecifier.getName().toString();
} }
if(classkind == ASTClassKind.STRUCT){ if(classkind == ASTClassKind.STRUCT){
@ -428,7 +428,7 @@ public class CModelBuilder {
kind = ICElement.C_TEMPLATE_STRUCT; kind = ICElement.C_TEMPLATE_STRUCT;
type = "struct"; //$NON-NLS-1$ type = "struct"; //$NON-NLS-1$
className = (classSpecifier.getName() == null ) className = (classSpecifier.getName() == null )
? "" ? "" //$NON-NLS-1$
: classSpecifier.getName().toString(); : classSpecifier.getName().toString();
} }
if(classkind == ASTClassKind.UNION){ if(classkind == ASTClassKind.UNION){
@ -438,7 +438,7 @@ public class CModelBuilder {
kind = ICElement.C_TEMPLATE_UNION; kind = ICElement.C_TEMPLATE_UNION;
type = "union"; //$NON-NLS-1$ type = "union"; //$NON-NLS-1$
className = (classSpecifier.getName() == null ) className = (classSpecifier.getName() == null )
? "" ? "" //$NON-NLS-1$
: classSpecifier.getName().toString(); : classSpecifier.getName().toString();
} }

View file

@ -66,7 +66,7 @@ public class FunctionTemplate extends FunctionDeclaration implements ITemplate{
int i = 0; int i = 0;
sig.append(paramTypes[i++]); sig.append(paramTypes[i++]);
while (i < paramTypes.length){ while (i < paramTypes.length){
sig.append(", "); sig.append(", "); //$NON-NLS-1$
sig.append(paramTypes[i++]); sig.append(paramTypes[i++]);
} }
sig.append(">"); //$NON-NLS-1$ sig.append(">"); //$NON-NLS-1$

View file

@ -171,7 +171,7 @@ public class PathEntryManager {
return; 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 int projectLength = affectedProjects.length;
final ICProject[] modifiedProjects = new ICProject[projectLength]; final ICProject[] modifiedProjects = new ICProject[projectLength];
System.arraycopy(affectedProjects, 0, modifiedProjects, 0, projectLength); System.arraycopy(affectedProjects, 0, modifiedProjects, 0, projectLength);

View file

@ -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 2004-02-25 Bogdan Gheorghe
Added a check to make sure that the parser is in the top context before throwing Added a check to make sure that the parser is in the top context before throwing
an EOF exception in SeletionParser. an EOF exception in SeletionParser.

View file

@ -15,18 +15,18 @@ package org.eclipse.cdt.core.parser;
*/ */
public class Directives { public class Directives {
public static final String POUND_DEFINE = "#define"; public static final String POUND_DEFINE = "#define"; //$NON-NLS-1$
public static final String POUND_UNDEF = "#undef"; public static final String POUND_UNDEF = "#undef"; //$NON-NLS-1$
public static final String POUND_IF = "#if"; public static final String POUND_IF = "#if"; //$NON-NLS-1$
public static final String POUND_IFDEF = "#ifdef"; public static final String POUND_IFDEF = "#ifdef"; //$NON-NLS-1$
public static final String POUND_IFNDEF = "#ifndef"; public static final String POUND_IFNDEF = "#ifndef"; //$NON-NLS-1$
public static final String POUND_ELSE = "#else"; public static final String POUND_ELSE = "#else"; //$NON-NLS-1$
public static final String POUND_ENDIF = "#endif"; public static final String POUND_ENDIF = "#endif"; //$NON-NLS-1$
public static final String POUND_INCLUDE = "#include"; public static final String POUND_INCLUDE = "#include"; //$NON-NLS-1$
public static final String POUND_LINE = "#line"; public static final String POUND_LINE = "#line"; //$NON-NLS-1$
public static final String POUND_ERROR = "#error"; public static final String POUND_ERROR = "#error"; //$NON-NLS-1$
public static final String POUND_PRAGMA = "#pragma"; public static final String POUND_PRAGMA = "#pragma"; //$NON-NLS-1$
public static final String POUND_ELIF = "#elif"; public static final String POUND_ELIF = "#elif"; //$NON-NLS-1$
public static final String POUND_BLANK = "#"; public static final String POUND_BLANK = "#"; //$NON-NLS-1$
} }

View file

@ -10,14 +10,14 @@ import org.eclipse.cdt.core.parser.ast.IASTFactory;
*/ */
public interface IScanner { public interface IScanner {
public static final String __CPLUSPLUS = "__cplusplus"; public static final String __CPLUSPLUS = "__cplusplus"; //$NON-NLS-1$
public static final String __STDC_VERSION__ = "__STDC_VERSION__"; public static final String __STDC_VERSION__ = "__STDC_VERSION__"; //$NON-NLS-1$
public static final String __STDC_HOSTED__ = "__STDC_HOSTED__"; public static final String __STDC_HOSTED__ = "__STDC_HOSTED__"; //$NON-NLS-1$
public static final String __STDC__ = "__STDC__"; public static final String __STDC__ = "__STDC__"; //$NON-NLS-1$
public static final String __FILE__ = "__FILE__"; public static final String __FILE__ = "__FILE__"; //$NON-NLS-1$
public static final String __TIME__ = "__TIME__"; public static final String __TIME__ = "__TIME__"; //$NON-NLS-1$
public static final String __DATE__ = "__DATE__"; public static final String __DATE__ = "__DATE__"; //$NON-NLS-1$
public static final String __LINE__ = "__LINE__"; public static final String __LINE__ = "__LINE__"; //$NON-NLS-1$
public static final int tPOUNDPOUND = -6; public static final int tPOUNDPOUND = -6;
public static final int tPOUND = -7; public static final int tPOUND = -7;

View file

@ -15,83 +15,83 @@ package org.eclipse.cdt.core.parser;
*/ */
public class Keywords { public class Keywords {
public static final String _BOOL = "_Bool"; public static final String _BOOL = "_Bool"; //$NON-NLS-1$
public static final String _COMPLEX = "_Complex"; public static final String _COMPLEX = "_Complex"; //$NON-NLS-1$
public static final String _IMAGINARY = "_Imaginary"; public static final String _IMAGINARY = "_Imaginary"; //$NON-NLS-1$
public static final String AND = "and"; public static final String AND = "and"; //$NON-NLS-1$
public static final String AND_EQ = "and_eq"; public static final String AND_EQ = "and_eq"; //$NON-NLS-1$
public static final String ASM = "asm"; public static final String ASM = "asm"; //$NON-NLS-1$
public static final String AUTO = "auto"; public static final String AUTO = "auto"; //$NON-NLS-1$
public static final String BITAND = "bitand"; public static final String BITAND = "bitand"; //$NON-NLS-1$
public static final String BITOR = "bitor"; public static final String BITOR = "bitor"; //$NON-NLS-1$
public static final String BOOL = "bool"; public static final String BOOL = "bool"; //$NON-NLS-1$
public static final String BREAK = "break"; public static final String BREAK = "break"; //$NON-NLS-1$
public static final String CASE = "case"; public static final String CASE = "case"; //$NON-NLS-1$
public static final String CATCH = "catch"; public static final String CATCH = "catch"; //$NON-NLS-1$
public static final String CHAR = "char"; public static final String CHAR = "char"; //$NON-NLS-1$
public static final String CLASS = "class"; public static final String CLASS = "class"; //$NON-NLS-1$
public static final String COMPL = "compl"; public static final String COMPL = "compl"; //$NON-NLS-1$
public static final String CONST = "const"; public static final String CONST = "const"; //$NON-NLS-1$
public static final String CONST_CAST = "const_cast"; public static final String CONST_CAST = "const_cast"; //$NON-NLS-1$
public static final String CONTINUE = "continue"; public static final String CONTINUE = "continue"; //$NON-NLS-1$
public static final String DEFAULT = "default"; public static final String DEFAULT = "default"; //$NON-NLS-1$
public static final String DELETE = "delete"; public static final String DELETE = "delete"; //$NON-NLS-1$
public static final String DO = "do"; public static final String DO = "do"; //$NON-NLS-1$
public static final String DOUBLE = "double"; public static final String DOUBLE = "double"; //$NON-NLS-1$
public static final String DYNAMIC_CAST = "dynamic_cast"; public static final String DYNAMIC_CAST = "dynamic_cast"; //$NON-NLS-1$
public static final String ELSE = "else"; public static final String ELSE = "else"; //$NON-NLS-1$
public static final String ENUM = "enum"; public static final String ENUM = "enum"; //$NON-NLS-1$
public static final String EXPLICIT = "explicit"; public static final String EXPLICIT = "explicit"; //$NON-NLS-1$
public static final String EXPORT = "export"; public static final String EXPORT = "export"; //$NON-NLS-1$
public static final String EXTERN = "extern"; public static final String EXTERN = "extern"; //$NON-NLS-1$
public static final String FALSE = "false"; public static final String FALSE = "false"; //$NON-NLS-1$
public static final String FLOAT = "float"; public static final String FLOAT = "float"; //$NON-NLS-1$
public static final String FOR = "for"; public static final String FOR = "for"; //$NON-NLS-1$
public static final String FRIEND = "friend"; public static final String FRIEND = "friend"; //$NON-NLS-1$
public static final String GOTO = "goto"; public static final String GOTO = "goto"; //$NON-NLS-1$
public static final String IF = "if"; public static final String IF = "if"; //$NON-NLS-1$
public static final String INLINE = "inline"; public static final String INLINE = "inline"; //$NON-NLS-1$
public static final String INT = "int"; public static final String INT = "int"; //$NON-NLS-1$
public static final String LONG = "long"; public static final String LONG = "long"; //$NON-NLS-1$
public static final String MUTABLE = "mutable"; public static final String MUTABLE = "mutable"; //$NON-NLS-1$
public static final String NAMESPACE = "namespace"; public static final String NAMESPACE = "namespace"; //$NON-NLS-1$
public static final String NEW = "new"; public static final String NEW = "new"; //$NON-NLS-1$
public static final String NOT = "not"; public static final String NOT = "not"; //$NON-NLS-1$
public static final String NOT_EQ = "not_eq"; public static final String NOT_EQ = "not_eq"; //$NON-NLS-1$
public static final String OPERATOR = "operator"; public static final String OPERATOR = "operator"; //$NON-NLS-1$
public static final String OR = "or"; public static final String OR = "or"; //$NON-NLS-1$
public static final String OR_EQ = "or_eq"; public static final String OR_EQ = "or_eq"; //$NON-NLS-1$
public static final String PRIVATE = "private"; public static final String PRIVATE = "private"; //$NON-NLS-1$
public static final String PROTECTED = "protected"; public static final String PROTECTED = "protected"; //$NON-NLS-1$
public static final String PUBLIC = "public"; public static final String PUBLIC = "public"; //$NON-NLS-1$
public static final String REGISTER = "register"; public static final String REGISTER = "register"; //$NON-NLS-1$
public static final String REINTERPRET_CAST = "reinterpret_cast"; public static final String REINTERPRET_CAST = "reinterpret_cast"; //$NON-NLS-1$
public static final String RESTRICT = "restrict"; public static final String RESTRICT = "restrict"; //$NON-NLS-1$
public static final String RETURN = "return"; public static final String RETURN = "return"; //$NON-NLS-1$
public static final String SHORT = "short"; public static final String SHORT = "short"; //$NON-NLS-1$
public static final String SIGNED = "signed"; public static final String SIGNED = "signed"; //$NON-NLS-1$
public static final String SIZEOF = "sizeof"; public static final String SIZEOF = "sizeof"; //$NON-NLS-1$
public static final String STATIC = "static"; public static final String STATIC = "static"; //$NON-NLS-1$
public static final String STATIC_CAST = "static_cast"; public static final String STATIC_CAST = "static_cast"; //$NON-NLS-1$
public static final String STRUCT = "struct"; public static final String STRUCT = "struct"; //$NON-NLS-1$
public static final String SWITCH = "switch"; public static final String SWITCH = "switch"; //$NON-NLS-1$
public static final String TEMPLATE = "template"; public static final String TEMPLATE = "template"; //$NON-NLS-1$
public static final String THIS = "this"; public static final String THIS = "this"; //$NON-NLS-1$
public static final String THROW = "throw"; public static final String THROW = "throw"; //$NON-NLS-1$
public static final String TRUE = "true"; public static final String TRUE = "true"; //$NON-NLS-1$
public static final String TRY = "try"; public static final String TRY = "try"; //$NON-NLS-1$
public static final String TYPEDEF = "typedef"; public static final String TYPEDEF = "typedef"; //$NON-NLS-1$
public static final String TYPEID = "typeid"; public static final String TYPEID = "typeid"; //$NON-NLS-1$
public static final String TYPENAME = "typename"; public static final String TYPENAME = "typename"; //$NON-NLS-1$
public static final String UNION = "union"; public static final String UNION = "union"; //$NON-NLS-1$
public static final String UNSIGNED = "unsigned"; public static final String UNSIGNED = "unsigned"; //$NON-NLS-1$
public static final String USING = "using"; public static final String USING = "using"; //$NON-NLS-1$
public static final String VIRTUAL = "virtual"; public static final String VIRTUAL = "virtual"; //$NON-NLS-1$
public static final String VOID = "void"; public static final String VOID = "void"; //$NON-NLS-1$
public static final String VOLATILE = "volatile"; public static final String VOLATILE = "volatile"; //$NON-NLS-1$
public static final String WCHAR_T = "wchar_t"; public static final String WCHAR_T = "wchar_t"; //$NON-NLS-1$
public static final String WHILE = "while"; public static final String WHILE = "while"; //$NON-NLS-1$
public static final String XOR = "xor"; public static final String XOR = "xor"; //$NON-NLS-1$
public static final String XOR_EQ = "xor_eq"; public static final String XOR_EQ = "xor_eq"; //$NON-NLS-1$
} }

View file

@ -221,8 +221,8 @@ public interface IASTFactory
public boolean queryIsTypeName( IASTScope scope, ITokenDuple nameInQuestion ) ; public boolean queryIsTypeName( IASTScope scope, ITokenDuple nameInQuestion ) ;
static final String DOUBLE_COLON = "::"; static final String DOUBLE_COLON = "::"; //$NON-NLS-1$
static final String TELTA = "~"; static final String TELTA = "~"; //$NON-NLS-1$
/** /**
* @param scope * @param scope
* @return * @return

View file

@ -72,7 +72,7 @@ public class ContextualParser extends CompleteParser {
* @return * @return
*/ */
protected String getCompletionPrefix() { protected String getCompletionPrefix() {
return ( finalToken == null ? "" : finalToken.getImage() ); return ( finalToken == null ? "" : finalToken.getImage() ); //$NON-NLS-1$
} }
/** /**

View file

@ -601,7 +601,7 @@ public class DeclarationWrapper implements IDeclaratorOwner
declarator.getPointerOperators(), declarator.getPointerOperators(),
declarator.getArrayModifiers(), declarator.getArrayModifiers(),
null, null, declarator.getName() == null null, null, declarator.getName() == null
? "" ? "" //$NON-NLS-1$
: declarator.getName(), declarator.getInitializerClause(), wrapper.getStartingOffset(), getStartingLine(), declarator.getNameStartOffset(), declarator.getNameEndOffset(), declarator.getNameLine(), wrapper.getEndOffset(), getEndLine())); : declarator.getName(), declarator.getInitializerClause(), wrapper.getStartingOffset(), getStartingLine(), declarator.getNameStartOffset(), declarator.getNameEndOffset(), declarator.getNameLine(), wrapper.getEndOffset(), getEndLine()));
} }
catch (Exception e) catch (Exception e)

View file

@ -39,7 +39,7 @@ public class Declarator implements IParameterCollection, IDeclaratorOwner, IDecl
private boolean pureVirtual = false; private boolean pureVirtual = false;
private final IDeclaratorOwner owner; private final IDeclaratorOwner owner;
private Declarator ownedDeclarator = null; private Declarator ownedDeclarator = null;
private String name = ""; private String name = ""; //$NON-NLS-1$
private IASTInitializerClause initializerClause = null; private IASTInitializerClause initializerClause = null;
private List ptrOps = new ArrayList(); private List ptrOps = new ArrayList();
private List parameters = new ArrayList(); private List parameters = new ArrayList();

View file

@ -431,7 +431,7 @@ public class ExpressionParser implements IExpressionParser {
secondExpression, secondExpression,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e) catch (ASTSemanticException e)
{ {
@ -541,7 +541,7 @@ public class ExpressionParser implements IExpressionParser {
null, null,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e) catch (ASTSemanticException e)
{ {
@ -574,7 +574,7 @@ public class ExpressionParser implements IExpressionParser {
secondExpression, secondExpression,
thirdExpression, thirdExpression,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e) catch (ASTSemanticException e)
{ {
@ -609,7 +609,7 @@ public class ExpressionParser implements IExpressionParser {
secondExpression, secondExpression,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e) catch (ASTSemanticException e)
{ {
@ -642,7 +642,7 @@ public class ExpressionParser implements IExpressionParser {
secondExpression, secondExpression,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e) catch (ASTSemanticException e)
{ {
@ -676,7 +676,7 @@ public class ExpressionParser implements IExpressionParser {
secondExpression, secondExpression,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e) catch (ASTSemanticException e)
{ {
@ -711,7 +711,7 @@ public class ExpressionParser implements IExpressionParser {
secondExpression, secondExpression,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e) catch (ASTSemanticException e)
{ {
@ -745,7 +745,7 @@ public class ExpressionParser implements IExpressionParser {
secondExpression, secondExpression,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e) catch (ASTSemanticException e)
{ {
@ -786,7 +786,7 @@ public class ExpressionParser implements IExpressionParser {
secondExpression, secondExpression,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e) catch (ASTSemanticException e)
{ {
@ -863,7 +863,7 @@ public class ExpressionParser implements IExpressionParser {
secondExpression, secondExpression,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e) catch (ASTSemanticException e)
{ {
@ -907,7 +907,7 @@ public class ExpressionParser implements IExpressionParser {
secondExpression, secondExpression,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e) catch (ASTSemanticException e)
{ {
@ -950,7 +950,7 @@ public class ExpressionParser implements IExpressionParser {
secondExpression, secondExpression,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e) catch (ASTSemanticException e)
{ {
@ -1004,7 +1004,7 @@ public class ExpressionParser implements IExpressionParser {
secondExpression, secondExpression,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e) catch (ASTSemanticException e)
{ {
@ -1047,7 +1047,7 @@ public class ExpressionParser implements IExpressionParser {
secondExpression, secondExpression,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e) catch (ASTSemanticException e)
{ {
@ -1090,7 +1090,7 @@ public class ExpressionParser implements IExpressionParser {
null, null,
null, null,
typeId, typeId,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e) catch (ASTSemanticException e)
{ {
@ -1331,7 +1331,7 @@ public class ExpressionParser implements IExpressionParser {
null, null,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e) catch (ASTSemanticException e)
{ {
@ -1468,7 +1468,7 @@ public class ExpressionParser implements IExpressionParser {
return astFactory.createExpression( return astFactory.createExpression(
scope, IASTExpression.Kind.NEW_TYPEID, scope, IASTExpression.Kind.NEW_TYPEID,
null, null, null, typeId, null, null, null, null, typeId, null,
"", astFactory.createNewDescriptor(newPlacementExpressions, newTypeIdExpressions, newInitializerExpressions)); "", astFactory.createNewDescriptor(newPlacementExpressions, newTypeIdExpressions, newInitializerExpressions)); //$NON-NLS-1$
} }
catch (ASTSemanticException e) catch (ASTSemanticException e)
{ {
@ -1516,7 +1516,7 @@ public class ExpressionParser implements IExpressionParser {
return astFactory.createExpression( return astFactory.createExpression(
scope, IASTExpression.Kind.NEW_TYPEID, scope, IASTExpression.Kind.NEW_TYPEID,
null, null, null, typeId, null, null, null, null, typeId, null,
"", astFactory.createNewDescriptor(newPlacementExpressions, newTypeIdExpressions, newInitializerExpressions)); "", astFactory.createNewDescriptor(newPlacementExpressions, newTypeIdExpressions, newInitializerExpressions)); //$NON-NLS-1$
} }
catch (ASTSemanticException e) catch (ASTSemanticException e)
{ {
@ -1600,7 +1600,7 @@ public class ExpressionParser implements IExpressionParser {
null, null,
null, null,
d, d,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e) catch (ASTSemanticException e)
{ {
@ -1619,7 +1619,7 @@ public class ExpressionParser implements IExpressionParser {
null, null,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e1) catch (ASTSemanticException e1)
{ {
@ -1693,7 +1693,7 @@ public class ExpressionParser implements IExpressionParser {
null, null,
null, null,
nestedName, nestedName,
"", "", //$NON-NLS-1$
null ); null );
} catch (ASTSemanticException ase ) { } catch (ASTSemanticException ase ) {
throw backtrack; throw backtrack;
@ -1801,7 +1801,7 @@ public class ExpressionParser implements IExpressionParser {
null, null,
null, null,
typeId, typeId,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e6) catch (ASTSemanticException e6)
{ {
@ -1835,7 +1835,7 @@ public class ExpressionParser implements IExpressionParser {
secondExpression, secondExpression,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e2) catch (ASTSemanticException e2)
{ {
@ -1861,7 +1861,7 @@ public class ExpressionParser implements IExpressionParser {
secondExpression, secondExpression,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e3) catch (ASTSemanticException e3)
{ {
@ -1884,7 +1884,7 @@ public class ExpressionParser implements IExpressionParser {
null, null,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e1) catch (ASTSemanticException e1)
{ {
@ -1907,7 +1907,7 @@ public class ExpressionParser implements IExpressionParser {
null, null,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e4) catch (ASTSemanticException e4)
{ {
@ -1948,7 +1948,7 @@ public class ExpressionParser implements IExpressionParser {
secondExpression, secondExpression,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e5) catch (ASTSemanticException e5)
{ {
@ -1988,7 +1988,7 @@ public class ExpressionParser implements IExpressionParser {
secondExpression, secondExpression,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e) catch (ASTSemanticException e)
{ {
@ -2045,7 +2045,7 @@ public class ExpressionParser implements IExpressionParser {
null, null,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e) catch (ASTSemanticException e)
{ {
@ -2177,7 +2177,7 @@ public class ExpressionParser implements IExpressionParser {
null, null,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e7) catch (ASTSemanticException e7)
{ {
@ -2199,7 +2199,7 @@ public class ExpressionParser implements IExpressionParser {
null, null,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e6) catch (ASTSemanticException e6)
{ {
@ -2263,7 +2263,7 @@ public class ExpressionParser implements IExpressionParser {
null, null,
null, null,
null, null,
duple, "", null); duple, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e8) catch (ASTSemanticException e8)
{ {
@ -2282,7 +2282,7 @@ public class ExpressionParser implements IExpressionParser {
null, null,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} catch (ASTSemanticException e9) { } catch (ASTSemanticException e9) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e9.printStackTrace(); e9.printStackTrace();
@ -2322,7 +2322,7 @@ public class ExpressionParser implements IExpressionParser {
} }
catch (ScannerException e) 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 log.errorLog( "Scanner Exception: " + e.getProblem().getMessage()); //$NON-NLS-1$h
failParse(); failParse();
return fetchToken(); return fetchToken();
@ -2438,7 +2438,7 @@ public class ExpressionParser implements IExpressionParser {
assignmentExpression, assignmentExpression,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e) catch (ASTSemanticException e)
{ {
@ -2469,7 +2469,7 @@ public class ExpressionParser implements IExpressionParser {
null, null,
null, null,
null, null,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e) catch (ASTSemanticException e)
{ {
@ -2497,7 +2497,7 @@ public class ExpressionParser implements IExpressionParser {
null, null,
null, null,
duple, duple,
null, "", null); null, "", null); //$NON-NLS-1$
} }
catch (ASTSemanticException e) catch (ASTSemanticException e)
{ {

View file

@ -106,12 +106,12 @@ public abstract class Parser extends ExpressionParser implements IParser
// Util.setDebugging(true); // Util.setDebugging(true);
// Or set debug to true in the core plugin preference // Or set debug to true in the core plugin preference
log.traceLog( log.traceLog(
"Parse " "Parse " //$NON-NLS-1$
+ (++parseCount) + (++parseCount)
+ ": " + ": " //$NON-NLS-1$
+ (System.currentTimeMillis() - startTime) + (System.currentTimeMillis() - startTime)
+ "ms" + "ms" //$NON-NLS-1$
+ (parsePassed ? "" : " - parse failure") ); + (parsePassed ? "" : " - parse failure") ); //$NON-NLS-1$ //$NON-NLS-2$
return parsePassed; return parsePassed;
} }
@ -575,7 +575,7 @@ public abstract class Parser extends ExpressionParser implements IParser
returnValue.add( returnValue.add(
astFactory.createTemplateParameter( astFactory.createTemplateParameter(
kind, kind,
( id == null )? "" : id.getImage(), ( id == null )? "" : id.getImage(), //$NON-NLS-1$
(typeId == null) ? null : typeId.getTypeOrClassName(), (typeId == null) ? null : typeId.getTypeOrClassName(),
null, null,
null)); null));
@ -613,8 +613,8 @@ public abstract class Parser extends ExpressionParser implements IParser
returnValue.add( returnValue.add(
astFactory.createTemplateParameter( astFactory.createTemplateParameter(
IASTTemplateParameter.ParamKind.TEMPLATE_LIST, IASTTemplateParameter.ParamKind.TEMPLATE_LIST,
( optionalId == null )? "" : optionalId.getImage(), ( optionalId == null )? "" : optionalId.getImage(), //$NON-NLS-1$
( optionalTypeId == null ) ? "" : optionalTypeId.toString(), ( optionalTypeId == null ) ? "" : optionalTypeId.toString(), //$NON-NLS-1$
null, null,
subResult)); subResult));
} }
@ -650,7 +650,7 @@ public abstract class Parser extends ExpressionParser implements IParser
declarator.getPointerOperators(), declarator.getPointerOperators(),
declarator.getArrayModifiers(), declarator.getArrayModifiers(),
null, null, declarator.getName() == null 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()), : declarator.getName(), declarator.getInitializerClause(), wrapper.getStartingOffset(), wrapper.getStartingLine(), declarator.getNameStartOffset(), declarator.getNameEndOffset(), declarator.getNameLine(), wrapper.getEndOffset(), wrapper.getEndLine()),
null)); null));
} }
@ -831,7 +831,7 @@ public abstract class Parser extends ExpressionParser implements IParser
namespaceDefinition = namespaceDefinition =
astFactory.createNamespaceDefinition( astFactory.createNamespaceDefinition(
scope, scope,
(identifier == null ? "" : identifier.getImage()), (identifier == null ? "" : identifier.getImage()), //$NON-NLS-1$
first.getOffset(), first.getOffset(),
first.getLineNumber(), first.getLineNumber(),
(identifier == null ? first.getOffset() : identifier.getOffset()), (identifier == null ? first.getOffset() : identifier.getOffset()),
@ -2112,7 +2112,7 @@ public abstract class Parser extends ExpressionParser implements IParser
{ {
failParse(); failParse();
log.traceLog( log.traceLog(
"Unexpected Token =" "Unexpected Token =" //$NON-NLS-1$
+ image ); + image );
consume(); consume();
// eat this token anyway // eat this token anyway
@ -2141,7 +2141,7 @@ public abstract class Parser extends ExpressionParser implements IParser
// check for optional pure virtual // check for optional pure virtual
if (LT(1) == IToken.tASSIGN if (LT(1) == IToken.tASSIGN
&& LT(2) == IToken.tINTEGER && LT(2) == IToken.tINTEGER
&& LA(2).getImage().equals("0")) && LA(2).getImage().equals("0")) //$NON-NLS-1$
{ {
consume(IToken.tASSIGN); consume(IToken.tASSIGN);
consume(IToken.tINTEGER); consume(IToken.tINTEGER);
@ -2265,7 +2265,7 @@ public abstract class Parser extends ExpressionParser implements IParser
{ {
enumeration = astFactory.createEnumerationSpecifier( enumeration = astFactory.createEnumerationSpecifier(
sdw.getScope(), sdw.getScope(),
((identifier == null) ? "" : identifier.getImage()), ((identifier == null) ? "" : identifier.getImage()), //$NON-NLS-1$
mark.getOffset(), mark.getOffset(),
mark.getLineNumber(), mark.getLineNumber(),
((identifier == null) ((identifier == null)

View file

@ -37,15 +37,15 @@ public class SelectionParser extends ContextualParser {
protected void handleNewToken(IToken value) { protected void handleNewToken(IToken value) {
if( value != null && scanner.isOnTopContext() ) 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() ) 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; firstTokenOfDuple = value;
} }
if( value.getEndOffset() == offsetRange.getCeilingOffset() ) 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; lastTokenOfDuple = value;
} }
} }

View file

@ -60,7 +60,7 @@ public class BaseASTFactory {
public IASTDesignator createDesignator(DesignatorKind kind, IASTExpression constantExpression, IToken fieldIdentifier) public IASTDesignator createDesignator(DesignatorKind kind, IASTExpression constantExpression, IToken fieldIdentifier)
{ {
return new ASTDesignator( kind, constantExpression, return new ASTDesignator( kind, constantExpression,
fieldIdentifier == null ? "" : fieldIdentifier.getImage(), fieldIdentifier == null ? "" : fieldIdentifier.getImage(), //$NON-NLS-1$
fieldIdentifier == null ? -1 : fieldIdentifier.getOffset() ); fieldIdentifier == null ? -1 : fieldIdentifier.getOffset() );
} }

View file

@ -52,7 +52,7 @@ public class ASTExpression implements IASTExpression
this.newDescriptor = newDescriptor; this.newDescriptor = newDescriptor;
this.references = references; this.references = references;
this.idExpressionDuple = idExpression; this.idExpressionDuple = idExpression;
this.idExpression = idExpressionDuple == null ? "" : idExpressionDuple.toString(); this.idExpression = idExpressionDuple == null ? "" : idExpressionDuple.toString(); //$NON-NLS-1$
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.core.parser.ast.IASTExpression#getExpressionKind() * @see org.eclipse.cdt.core.parser.ast.IASTExpression#getExpressionKind()

View file

@ -49,7 +49,7 @@ public class ASTTypeId implements IASTTypeId
public ASTTypeId( Type kind, ITokenDuple duple, List pointerOps, List arrayMods, String signature, 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 ) 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.tokenDuple = duple;
this.kind = kind; this.kind = kind;
this.pointerOps = pointerOps; this.pointerOps = pointerOps;

View file

@ -56,7 +56,7 @@ public class ASTUsingDirective extends ASTAnonymousDeclaration implements IASTUs
{ {
buffer.append( fqn[ i ] ); buffer.append( fqn[ i ] );
if( i + 1 != fqn.length ) if( i + 1 != fqn.length )
buffer.append( "::"); buffer.append( "::"); //$NON-NLS-1$
} }
return buffer.toString(); return buffer.toString();
} }

View file

@ -423,7 +423,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
ISymbol namespaceSymbol = null; ISymbol namespaceSymbol = null;
if( ! identifier.equals( "" ) ) if( ! identifier.equals( "" ) ) //$NON-NLS-1$
{ {
try try
{ {
@ -443,7 +443,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
else else
{ {
namespaceSymbol = pst.newContainerSymbol( identifier, TypeInfo.t_namespace ); namespaceSymbol = pst.newContainerSymbol( identifier, TypeInfo.t_namespace );
if( identifier.equals( "" ) ) if( identifier.equals( "" ) ) //$NON-NLS-1$
namespaceSymbol.setContainingSymbol( pstScope ); namespaceSymbol.setContainingSymbol( pstScope );
else else
{ {
@ -544,7 +544,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
TypeInfo.eType pstType = classKindToTypeInfo(kind); TypeInfo.eType pstType = classKindToTypeInfo(kind);
List references = new ArrayList(); List references = new ArrayList();
String newSymbolName = ""; String newSymbolName = ""; //$NON-NLS-1$
if( name != null ){ if( name != null ){
IToken lastToken = name.getLastToken(); IToken lastToken = name.getLastToken();
@ -561,7 +561,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
} }
ISymbol classSymbol = null; ISymbol classSymbol = null;
if( !newSymbolName.equals("") ){ if( !newSymbolName.equals("") ){ //$NON-NLS-1$
try try
{ {
classSymbol = currentScopeSymbol.lookupMemberForDefinition(newSymbolName); classSymbol = currentScopeSymbol.lookupMemberForDefinition(newSymbolName);
@ -870,7 +870,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
// go up the scope until you hit a class // go up the scope until you hit a class
if (kind == IASTExpression.Kind.PRIMARY_THIS){ if (kind == IASTExpression.Kind.PRIMARY_THIS){
try{ try{
symbol = startingScope.lookup("this"); symbol = startingScope.lookup("this"); //$NON-NLS-1$
}catch (ParserSymbolTableException e){ }catch (ParserSymbolTableException e){
throw new ASTSemanticException(); throw new ASTSemanticException();
} }
@ -1515,7 +1515,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
getExpressionReferences( expressionList, references ); getExpressionReferences( expressionList, references );
return new ASTConstructorMemberInitializer( return new ASTConstructorMemberInitializer(
expressionList, expressionList,
duple == null ? "" : duple.toString(), duple == null ? "" : duple.toString(), //$NON-NLS-1$
duple == null ? 0 : duple.getFirstToken().getOffset(), duple == null ? 0 : duple.getFirstToken().getOffset(),
references, requireReferenceResolution ); references, requireReferenceResolution );
} }
@ -1551,7 +1551,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
type = TypeInfo.t__Bool; type = TypeInfo.t__Bool;
List references = new ArrayList(); List references = new ArrayList();
ISymbol s = pst.newSymbol( "", type ); ISymbol s = pst.newSymbol( "", type ); //$NON-NLS-1$
if( kind == IASTSimpleTypeSpecifier.Type.CLASS_OR_TYPENAME ) if( kind == IASTSimpleTypeSpecifier.Type.CLASS_OR_TYPENAME )
{ {
// lookup the duple // lookup the duple
@ -1849,7 +1849,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
newReferences.add( createReference( xrefSymbol, elab.getName(), elab.getNameOffset()) ); newReferences.add( createReference( xrefSymbol, elab.getName(), elab.getNameOffset()) );
} }
String paramName = ""; String paramName = ""; //$NON-NLS-1$
if(absDecl instanceof IASTParameterDeclaration){ if(absDecl instanceof IASTParameterDeclaration){
paramName = ((IASTParameterDeclaration)absDecl).getName(); paramName = ((IASTParameterDeclaration)absDecl).getName();
} }
@ -2091,7 +2091,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
while( initializers.hasNext()) while( initializers.hasNext())
{ {
IASTConstructorMemberInitializer initializer = (IASTConstructorMemberInitializer)initializers.next(); IASTConstructorMemberInitializer initializer = (IASTConstructorMemberInitializer)initializers.next();
if( !initializer.getName().equals( "") && if( !initializer.getName().equals( "") && //$NON-NLS-1$
initializer instanceof ASTConstructorMemberInitializer && initializer instanceof ASTConstructorMemberInitializer &&
((ASTConstructorMemberInitializer)initializer).requiresNameResolution() ) ((ASTConstructorMemberInitializer)initializer).requiresNameResolution() )
{ {
@ -2157,7 +2157,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
int tokencount = tokenizer.countTokens(); int tokencount = tokenizer.countTokens();
if(tokencount > 1){ if(tokencount > 1){
List tokens = new ArrayList(); List tokens = new ArrayList();
String oneToken = ""; String oneToken = ""; //$NON-NLS-1$
// This is NOT a function. This is a method definition // This is NOT a function. This is a method definition
while (tokenizer.hasMoreTokens()){ while (tokenizer.hasMoreTokens()){
oneToken = tokenizer.nextToken(); oneToken = tokenizer.nextToken();
@ -2696,7 +2696,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
public IASTCodeScope createNewCodeBlock(IASTScope scope) { public IASTCodeScope createNewCodeBlock(IASTScope scope) {
IContainerSymbol symbol = scopeToSymbol( 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); newScope.setContainingSymbol(symbol);
ASTCodeScope codeScope = new ASTCodeScope( newScope ); 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 boolean isLong, boolean isSigned, boolean isUnsigned, boolean isTypename, ITokenDuple name, List pointerOps, List arrayMods) throws ASTSemanticException
{ {
ASTTypeId result = 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 ); isConst, isVolatile, isUnsigned, isSigned, isShort, isLong, isTypename );
result.setTypeSymbol( createSymbolForTypeId( scope, result ) ); result.setTypeSymbol( createSymbolForTypeId( scope, result ) );
return result; return result;
@ -2780,7 +2780,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
if( id == null ) return null; if( id == null ) return null;
ASTTypeId typeId = (ASTTypeId)id; 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.isConst(), TypeInfo.isConst );
result.getTypeInfo().setBit( id.isVolatile(), TypeInfo.isVolatile ); result.getTypeInfo().setBit( id.isVolatile(), TypeInfo.isVolatile );

View file

@ -106,11 +106,11 @@ public class ASTExpression implements IASTExpression {
{ {
try 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 ); 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().substring(1), 8 );
return Integer.parseInt( getLiteralString() ); return Integer.parseInt( getLiteralString() );
} }

View file

@ -384,7 +384,7 @@ public class ExpressionParseASTFactory implements IASTFactory {
rhs, rhs,
thirdExpression, thirdExpression,
typeId, typeId,
idExpression == null ? "" : idExpression.toString(), idExpression == null ? "" : idExpression.toString(), //$NON-NLS-1$
literal, literal,
newDescriptor, newDescriptor,
extensionFactory.createExpressionExtension()); extensionFactory.createExpressionExtension());
@ -395,7 +395,7 @@ public class ExpressionParseASTFactory implements IASTFactory {
rhs, rhs,
thirdExpression, thirdExpression,
typeId, typeId,
idExpression == null ? "" : idExpression.toString(), idExpression == null ? "" : idExpression.toString(), //$NON-NLS-1$
literal, literal,
newDescriptor, newDescriptor,
new IASTExpressionExtension() { new IASTExpressionExtension() {

View file

@ -35,14 +35,14 @@ public class ASTSimpleTypeSpecifier extends ASTNode implements IASTSimpleTypeSpe
static static
{ {
nameMap = new Hashtable(); nameMap = new Hashtable();
nameMap.put( Type.BOOL, "bool"); nameMap.put( Type.BOOL, "bool"); //$NON-NLS-1$
nameMap.put( Type.CHAR, "char"); nameMap.put( Type.CHAR, "char"); //$NON-NLS-1$
nameMap.put( Type.DOUBLE, "double"); nameMap.put( Type.DOUBLE, "double"); //$NON-NLS-1$
nameMap.put( Type.FLOAT, "float"); nameMap.put( Type.FLOAT, "float"); //$NON-NLS-1$
nameMap.put( Type.INT, "int"); nameMap.put( Type.INT, "int"); //$NON-NLS-1$
nameMap.put( Type.VOID, "void" ); nameMap.put( Type.VOID, "void" ); //$NON-NLS-1$
nameMap.put( Type.WCHAR_T, "wchar_t" ); nameMap.put( Type.WCHAR_T, "wchar_t" ); //$NON-NLS-1$
nameMap.put( Type._BOOL, "_Bool"); nameMap.put( Type._BOOL, "_Bool"); //$NON-NLS-1$
} }
/** /**
* @param kind * @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( this.kind == IASTSimpleTypeSpecifier.Type.CHAR || this.kind == IASTSimpleTypeSpecifier.Type.WCHAR_T )
{ {
if (isUnsigned()) if (isUnsigned())
type.append("unsigned "); type.append("unsigned "); //$NON-NLS-1$
else if( isSigned() ) else if( isSigned() )
type.append("signed "); type.append("signed "); //$NON-NLS-1$
type.append( (String)nameMap.get( this.kind )); type.append( (String)nameMap.get( this.kind ));
} }
else if( this.kind == Type.BOOL || this.kind == Type.VOID || this.kind == Type._BOOL ) 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 ) else if( this.kind == Type.INT )
{ {
if (isUnsigned()) if (isUnsigned())
type.append("unsigned "); type.append("unsigned "); //$NON-NLS-1$
if (isShort()) if (isShort())
type.append("short "); type.append("short "); //$NON-NLS-1$
if (isLong()) if (isLong())
type.append("long "); type.append("long "); //$NON-NLS-1$
type.append( (String)nameMap.get( this.kind )); type.append( (String)nameMap.get( this.kind ));
} }
else if( this.kind == Type.FLOAT ) else if( this.kind == Type.FLOAT )
{ {
type.append( (String)nameMap.get( this.kind )); type.append( (String)nameMap.get( this.kind ));
if( isComplex() ) if( isComplex() )
type.append( "_Complex" ); type.append( "_Complex" ); //$NON-NLS-1$
else if( isImaginary() ) else if( isImaginary() )
type.append( "_Imaginary" ); type.append( "_Imaginary" ); //$NON-NLS-1$
} }
else if( this.kind == Type.DOUBLE ) else if( this.kind == Type.DOUBLE )
{ {
if (isLong()) if (isLong())
type.append("long "); type.append("long "); //$NON-NLS-1$
type.append( (String)nameMap.get( this.kind )); type.append( (String)nameMap.get( this.kind ));
if( isComplex() ) if( isComplex() )
type.append( "_Complex" ); type.append( "_Complex" ); //$NON-NLS-1$
else if( isImaginary() ) else if( isImaginary() )
type.append( "_Imaginary" ); type.append( "_Imaginary" ); //$NON-NLS-1$
} }
else if( this.kind == Type.CLASS_OR_TYPENAME || this.kind == Type.TEMPLATE ) else if( this.kind == Type.CLASS_OR_TYPENAME || this.kind == Type.TEMPLATE )
{ {
if (isTypename() ) if (isTypename() )
type.append("typename "); type.append("typename "); //$NON-NLS-1$
type.append(typeName.toString()); type.append(typeName.toString());
} }
else if( this.kind == Type.UNSPECIFIED ) else if( this.kind == Type.UNSPECIFIED )
{ {
if (isUnsigned()) if (isUnsigned())
type.append("unsigned "); type.append("unsigned "); //$NON-NLS-1$
if (isShort()) if (isShort())
type.append("short "); type.append("short "); //$NON-NLS-1$
if (isLong()) if (isLong())
type.append("long "); type.append("long "); //$NON-NLS-1$
if (isSigned()) if (isSigned())
type.append("signed "); type.append("signed "); //$NON-NLS-1$
} }
this.typeName = type.toString(); this.typeName = type.toString();
} }

View file

@ -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) * @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 ) { 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) /* (non-Javadoc)
@ -164,9 +164,9 @@ public class QuickParseASTFactory extends BaseASTFactory implements IASTFactory
if( CREATE_EXCESS_CONSTRUCTS ) if( CREATE_EXCESS_CONSTRUCTS )
{ {
try { 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) { } 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) { 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, 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) 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 ); isVolatile, isUnsigned, isSigned, isShort, isLong, isTypename );
} }

View file

@ -1017,7 +1017,7 @@ public class ParserSymbolTable {
//the only way we get here and have no parameters, is if we are looking //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 ) //for a function that takes void parameters ie f( void )
parameterList = new LinkedList(); parameterList = new LinkedList();
parameterList.add( currFn.getSymbolTable().newSymbol( "", TypeInfo.t_void ) ); parameterList.add( currFn.getSymbolTable().newSymbol( "", TypeInfo.t_void ) ); //$NON-NLS-1$
} else { } else {
parameterList = currFn.getParameterList(); parameterList = currFn.getParameterList();
} }

View file

@ -785,7 +785,7 @@ public final class TemplateEngine {
ISymbol param = (ISymbol) iterator.next(); ISymbol param = (ISymbol) iterator.next();
//template type parameter //template type parameter
if( param.getTypeInfo().getTemplateParameterType() == TypeInfo.t_typeName ){ 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 //template parameter
else if ( param.getTypeInfo().getTemplateParameterType() == TypeInfo.t_template ) { else if ( param.getTypeInfo().getTemplateParameterType() == TypeInfo.t_template ) {
@ -823,7 +823,7 @@ public final class TemplateEngine {
} catch ( ParserSymbolTableException e ){ } catch ( ParserSymbolTableException e ){
//we shouldn't get this because there aren't any other symbols in the template //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() ); LinkedList args = new LinkedList( specialization.getArgumentList() );
param.setTypeSymbol( specialization.instantiate( args ) ); param.setTypeSymbol( specialization.instantiate( args ) );

View file

@ -72,7 +72,7 @@ public class ContextStack {
if( !inclusions.add( context.getFilename() ) ) if( !inclusions.add( context.getFilename() ) )
throw new ContextException( IProblem.PREPROCESSOR_CIRCULAR_INCLUSION ); 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 ); context.getExtension().enterScope( requestor );
} else if( context.getKind() == IScannerContext.ContextKind.MACROEXPANSION ) } else if( context.getKind() == IScannerContext.ContextKind.MACROEXPANSION )
@ -92,12 +92,12 @@ public class ContextStack {
try { try {
currentContext.getReader().close(); currentContext.getReader().close();
} catch (IOException ie) { } catch (IOException ie) {
log.traceLog("ContextStack : Error closing reader "); log.traceLog("ContextStack : Error closing reader "); //$NON-NLS-1$
} }
if( currentContext.getKind() == IScannerContext.ContextKind.INCLUSION ) 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() ); inclusions.remove( currentContext.getFilename() );
currentContext.getExtension().exitScope( requestor ); currentContext.getExtension().exitScope( requestor );
} else if( currentContext.getKind() == IScannerContext.ContextKind.MACROEXPANSION ) } else if( currentContext.getKind() == IScannerContext.ContextKind.MACROEXPANSION )

View file

@ -64,7 +64,7 @@ public class DynamicMacroDescriptor implements IMacroDescriptor {
* @see org.eclipse.cdt.core.parser.IMacroDescriptor#getCompleteSignature() * @see org.eclipse.cdt.core.parser.IMacroDescriptor#getCompleteSignature()
*/ */
public String getCompleteSignature() { public String getCompleteSignature() {
return ""; return ""; //$NON-NLS-1$
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -74,23 +74,23 @@ public class FunctionMacroDescriptor implements IMacroDescriptor {
StringBuffer buffer = new StringBuffer( 128 ); StringBuffer buffer = new StringBuffer( 128 );
int count = getParameters().size(); int count = getParameters().size();
buffer.append( "MacroDescriptor with name=" + getName() + "\n" ); buffer.append( "MacroDescriptor with name=" + getName() + "\n" ); //$NON-NLS-2$
buffer.append( "Number of parameters = " + count + "\n" ); buffer.append( "Number of parameters = " + count + "\n" ); //$NON-NLS-2$
Iterator iter = getParameters().iterator(); Iterator iter = getParameters().iterator();
int current = 0; int current = 0;
while( iter.hasNext() ) 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(); count = getTokenizedExpansion().size();
iter = getTokenizedExpansion().iterator(); iter = getTokenizedExpansion().iterator();
buffer.append( "Number of tokens = " + count + "\n" ); buffer.append( "Number of tokens = " + count + "\n" ); //$NON-NLS-2$
current = 0; current = 0;
while( iter.hasNext() ) 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(); return buffer.toString();

View file

@ -26,8 +26,8 @@ public class GCCScannerExtension implements IScannerExtension {
* @see org.eclipse.cdt.core.parser.IScannerExtension#initializeMacroValue(java.lang.String) * @see org.eclipse.cdt.core.parser.IScannerExtension#initializeMacroValue(java.lang.String)
*/ */
public String initializeMacroValue(String original) { public String initializeMacroValue(String original) {
if( original == null || original.trim().equals( "") ) if( original == null || original.trim().equals( "") ) //$NON-NLS-1$
return "1"; return "1"; //$NON-NLS-1$
return original; return original;
} }
@ -37,11 +37,11 @@ public class GCCScannerExtension implements IScannerExtension {
public void setupBuiltInMacros(ParserLanguage language) { public void setupBuiltInMacros(ParserLanguage language) {
if( language == ParserLanguage.CPP ) if( language == ParserLanguage.CPP )
if( scannerData.getScanner().getDefinition( IScanner.__CPLUSPLUS ) == null ) 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 ) 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 ) 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) { 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) * @see org.eclipse.cdt.core.parser.extension.IScannerExtension#canHandlePreprocessorDirective(java.lang.String)
*/ */
public boolean canHandlePreprocessorDirective(String directive) { public boolean canHandlePreprocessorDirective(String directive) {
if( directive.equals("#include_next")) return true; if( directive.equals("#include_next")) return true; //$NON-NLS-1$
return false; 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) * @see org.eclipse.cdt.core.parser.extension.IScannerExtension#handlePreprocessorDirective(java.lang.String, java.lang.String)
*/ */
public void handlePreprocessorDirective(String directive, String restOfLine) { 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 // figure out the name of the current file and its path
// search through include paths // search through include paths

View file

@ -29,7 +29,7 @@ public class ObjectMacroDescriptor implements IMacroDescriptor {
{ {
this.name = name; this.name = name;
this.expansionSignature = expansionSignature; this.expansionSignature = expansionSignature;
fullSignature = "#define " + name + " " + expansionSignature; fullSignature = "#define " + name + " " + expansionSignature; //$NON-NLS-1$ //$NON-NLS-2$
tokenizedExpansion = EMPTY_LIST; tokenizedExpansion = EMPTY_LIST;
} }

View file

@ -66,7 +66,7 @@ import org.eclipse.cdt.internal.core.parser.token.Token;
public class Scanner implements IScanner { public class Scanner implements IScanner {
private final static String SCRATCH = "<scratch>"; private final static String SCRATCH = "<scratch>"; //$NON-NLS-1$
protected final IScannerData scannerData; protected final IScannerData scannerData;
private boolean initialContextInitialized = false; 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 ); IProblem problem = scannerData.getProblemFactory().createProblem( problemID, beginningOffset, getCurrentOffset(), scannerData.getContextStack().getCurrentLineNumber(), getCurrentFile().toCharArray(), arguments, warning, error );
// trace log // trace log
StringBuffer logMessage = new StringBuffer( "Scanner problem encountered: "); StringBuffer logMessage = new StringBuffer( "Scanner problem encountered: "); //$NON-NLS-1$
logMessage.append( problem.getMessage() ); logMessage.append( problem.getMessage() );
scannerData.getLogService().traceLog( logMessage.toString() ); 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 //this is a hack to get around a sudden EOF experience
scannerData.getContextStack().push( scannerData.getContextStack().push(
new ScannerContext( new ScannerContext(
new StringReader("\n"), new StringReader("\n"), //$NON-NLS-1$
START, START,
ScannerContext.ContextKind.SENTINEL, null), requestor); ScannerContext.ContextKind.SENTINEL, null), requestor);
@ -124,8 +124,8 @@ public class Scanner implements IScanner {
} }
log.traceLog( "Scanner constructed with the following configuration:"); log.traceLog( "Scanner constructed with the following configuration:"); //$NON-NLS-1$
log.traceLog( "\tPreprocessor definitions from IScannerInfo: "); log.traceLog( "\tPreprocessor definitions from IScannerInfo: "); //$NON-NLS-1$
if( info.getDefinedSymbols() != null ) if( info.getDefinedSymbols() != null )
{ {
@ -139,7 +139,7 @@ public class Scanner implements IScanner {
if( value instanceof String ) if( value instanceof String )
{ {
addDefinition( symbolName, scannerExtension.initializeMacroValue((String) value)); 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; ++numberOfSymbolsLogged;
} }
@ -147,22 +147,22 @@ public class Scanner implements IScanner {
addDefinition( symbolName, (IMacroDescriptor)value); addDefinition( symbolName, (IMacroDescriptor)value);
} }
if( numberOfSymbolsLogged == 0 ) if( numberOfSymbolsLogged == 0 )
log.traceLog( "\t\tNo definitions specified."); log.traceLog( "\t\tNo definitions specified."); //$NON-NLS-1$
} }
else 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 ) if( info.getIncludePaths() != null )
{ {
overwriteIncludePath( info.getIncludePaths() ); overwriteIncludePath( info.getIncludePaths() );
for( int i = 0; i < info.getIncludePaths().length; ++i ) 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 else
log.traceLog("\t\tNo include paths specified."); log.traceLog("\t\tNo include paths specified."); //$NON-NLS-1$
setupBuiltInMacros(); setupBuiltInMacros();
} }
@ -174,18 +174,18 @@ public class Scanner implements IScanner {
scannerExtension.setupBuiltInMacros(scannerData.getLanguage()); scannerExtension.setupBuiltInMacros(scannerData.getLanguage());
if( getDefinition(__STDC__) == null ) 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( scannerData.getLanguage() == ParserLanguage.C )
{ {
if( getDefinition(__STDC_HOSTED__) == null ) 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 ) 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 else
if( getDefinition( __CPLUSPLUS ) == null ) if( getDefinition( __CPLUSPLUS ) == null )
addDefinition( __CPLUSPLUS, new ObjectMacroDescriptor( __CPLUSPLUS, "199711L")); addDefinition( __CPLUSPLUS, new ObjectMacroDescriptor( __CPLUSPLUS, "199711L")); //$NON-NLS-1$
if( getDefinition(__FILE__) == null ) if( getDefinition(__FILE__) == null )
addDefinition( __FILE__, addDefinition( __FILE__,
@ -222,17 +222,17 @@ public class Scanner implements IScanner {
if( Calendar.MONTH == Calendar.OCTOBER) return "Oct"; if( Calendar.MONTH == Calendar.OCTOBER) return "Oct";
if( Calendar.MONTH == Calendar.NOVEMBER) return "Nov"; if( Calendar.MONTH == Calendar.NOVEMBER) return "Nov";
if( Calendar.MONTH == Calendar.DECEMBER) return "Dec"; if( Calendar.MONTH == Calendar.DECEMBER) return "Dec";
return ""; return ""; //$NON-NLS-1$
} }
public String execute() { public String execute() {
StringBuffer result = new StringBuffer(); StringBuffer result = new StringBuffer();
result.append( getMonth() ); result.append( getMonth() );
result.append(" "); result.append(" "); //$NON-NLS-1$
if( Calendar.DAY_OF_MONTH < 10 ) if( Calendar.DAY_OF_MONTH < 10 )
result.append(" "); result.append(" "); //$NON-NLS-1$
result.append(Calendar.DAY_OF_MONTH); result.append(Calendar.DAY_OF_MONTH);
result.append(" "); result.append(" "); //$NON-NLS-1$
result.append( Calendar.YEAR ); result.append( Calendar.YEAR );
return result.toString(); return result.toString();
} }
@ -559,14 +559,14 @@ public class Scanner implements IScanner {
// constants // constants
private static final int NOCHAR = -1; private static final int NOCHAR = -1;
private static final String TEXT = "<text>"; private static final String TEXT = "<text>"; //$NON-NLS-1$
private static final String START = "<initial reader>"; private static final String START = "<initial reader>"; //$NON-NLS-1$
private static final String EXPRESSION = "<expression>"; private static final String EXPRESSION = "<expression>"; //$NON-NLS-1$
private static final String PASTING = "<pasting>"; private static final String PASTING = "<pasting>"; //$NON-NLS-1$
private static final String DEFINED = "defined"; private static final String DEFINED = "defined"; //$NON-NLS-1$
private static final String _PRAGMA = "_Pragma"; private static final String _PRAGMA = "_Pragma"; //$NON-NLS-1$
private static final String POUND_DEFINE = "#define "; private static final String POUND_DEFINE = "#define "; //$NON-NLS-1$
private IScannerContext lastContext = null; private IScannerContext lastContext = null;
@ -634,39 +634,39 @@ public class Scanner implements IScanner {
c = getChar(insideString); c = getChar(insideString);
switch (c) { switch (c) {
case '(': case '(':
expandDefinition("??(", "[", baseOffset); expandDefinition("??(", "[", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
c = getChar(insideString); c = getChar(insideString);
break; break;
case ')': case ')':
expandDefinition("??)", "]", baseOffset); expandDefinition("??)", "]", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
c = getChar(insideString); c = getChar(insideString);
break; break;
case '<': case '<':
expandDefinition("??<", "{", baseOffset); expandDefinition("??<", "{", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
c = getChar(insideString); c = getChar(insideString);
break; break;
case '>': case '>':
expandDefinition("??>", "}", baseOffset); expandDefinition("??>", "}", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
c = getChar(insideString); c = getChar(insideString);
break; break;
case '=': case '=':
expandDefinition("??=", "#", baseOffset); expandDefinition("??=", "#", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
c = getChar(insideString); c = getChar(insideString);
break; break;
case '/': case '/':
expandDefinition("??/", "\\", baseOffset); expandDefinition("??/", "\\", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
c = getChar(insideString); c = getChar(insideString);
break; break;
case '\'': case '\'':
expandDefinition("??\'", "^", baseOffset); expandDefinition("??\'", "^", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
c = getChar(insideString); c = getChar(insideString);
break; break;
case '!': case '!':
expandDefinition("??!", "|", baseOffset); expandDefinition("??!", "|", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
c = getChar(insideString); c = getChar(insideString);
break; break;
case '-': case '-':
expandDefinition("??-", "~", baseOffset); expandDefinition("??-", "~", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
c = getChar(insideString); c = getChar(insideString);
break; break;
default: default:
@ -709,10 +709,10 @@ public class Scanner implements IScanner {
if (c == '<') { if (c == '<') {
c = getChar(false); c = getChar(false);
if (c == '%') { if (c == '%') {
expandDefinition("<%", "{", baseOffset); expandDefinition("<%", "{", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
c = getChar(false); c = getChar(false);
} else if (c == ':') { } else if (c == ':') {
expandDefinition("<:", "[", baseOffset); expandDefinition("<:", "[", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
c = getChar(false); c = getChar(false);
} else { } else {
// Not a digraph // Not a digraph
@ -722,7 +722,7 @@ public class Scanner implements IScanner {
} else if (c == ':') { } else if (c == ':') {
c = getChar(false); c = getChar(false);
if (c == '>') { if (c == '>') {
expandDefinition(":>", "]", baseOffset); expandDefinition(":>", "]", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
c = getChar(false); c = getChar(false);
} else { } else {
// Not a digraph // Not a digraph
@ -732,10 +732,10 @@ public class Scanner implements IScanner {
} else if (c == '%') { } else if (c == '%') {
c = getChar(false); c = getChar(false);
if (c == '>') { if (c == '>') {
expandDefinition("%>", "}", baseOffset); expandDefinition("%>", "}", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
c = getChar(false); c = getChar(false);
} else if (c == ':') { } else if (c == ':') {
expandDefinition("%:", "#", baseOffset); expandDefinition("%:", "#", baseOffset); //$NON-NLS-1$ //$NON-NLS-2$
c = getChar(false); c = getChar(false);
} else { } else {
// Not a digraph // Not a digraph
@ -1081,17 +1081,17 @@ public class Scanner implements IScanner {
if( ! firstCharZero && floatingPoint && !(c >= '0' && c <= '9') ){ if( ! firstCharZero && floatingPoint && !(c >= '0' && c <= '9') ){
//if pasting, there could actually be a float here instead of just a . //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 == '*' ){ if( c == '*' ){
return newToken( IToken.tDOTSTAR, ".*", scannerData.getContextStack().getCurrentContext() ); return newToken( IToken.tDOTSTAR, ".*", scannerData.getContextStack().getCurrentContext() ); //$NON-NLS-1$
} else if( c == '.' ){ } else if( c == '.' ){
if( getChar() == '.' ) if( getChar() == '.' )
return newToken( IToken.tELLIPSIS, "...", scannerData.getContextStack().getCurrentContext() ); return newToken( IToken.tELLIPSIS, "...", scannerData.getContextStack().getCurrentContext() ); //$NON-NLS-1$
else else
handleProblem( IProblem.SCANNER_BAD_FLOATING_POINT, null, beginOffset, false, true ); handleProblem( IProblem.SCANNER_BAD_FLOATING_POINT, null, beginOffset, false, true );
} else { } else {
ungetChar( c ); ungetChar( c );
return newToken( IToken.tDOT, ".", scannerData.getContextStack().getCurrentContext() ); return newToken( IToken.tDOT, ".", scannerData.getContextStack().getCurrentContext() ); //$NON-NLS-1$
} }
} }
} else if (c == 'x') { } else if (c == 'x') {
@ -1212,7 +1212,7 @@ public class Scanner implements IScanner {
int tokenType; int tokenType;
String result = buff.toString(); String result = buff.toString();
if( floatingPoint && result.equals(".") ) if( floatingPoint && result.equals(".") ) //$NON-NLS-1$
tokenType = IToken.tDOT; tokenType = IToken.tDOT;
else else
tokenType = floatingPoint ? IToken.tFLOATINGPT : IToken.tINTEGER; tokenType = floatingPoint ? IToken.tFLOATINGPT : IToken.tINTEGER;
@ -1238,12 +1238,12 @@ public class Scanner implements IScanner {
if( c == '#' ) if( c == '#' )
{ {
if( skipped ) if( skipped )
handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, "# #", beginningOffset, false, true ); handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, "# #", beginningOffset, false, true ); //$NON-NLS-1$
else else
return newToken( tPOUNDPOUND, "##" ); return newToken( tPOUNDPOUND, "##" ); //$NON-NLS-1$
} else if( tokenizingMacroReplacementList ) { } else if( tokenizingMacroReplacementList ) {
ungetChar( c ); ungetChar( c );
return newToken( tPOUND, "#" ); return newToken( tPOUND, "#" ); //$NON-NLS-1$
} }
while (((c >= 'a') && (c <= 'z')) while (((c >= 'a') && (c <= 'z'))
@ -1263,7 +1263,7 @@ public class Scanner implements IScanner {
if (directive == null) { if (directive == null) {
if( scannerExtension.canHandlePreprocessorDirective( token ) ) if( scannerExtension.canHandlePreprocessorDirective( token ) )
scannerExtension.handlePreprocessorDirective( token, getRestOfPreprocessorLine() ); scannerExtension.handlePreprocessorDirective( token, getRestOfPreprocessorLine() );
StringBuffer buffer = new StringBuffer( "#"); StringBuffer buffer = new StringBuffer( "#"); //$NON-NLS-1$
buffer.append( token ); buffer.append( token );
handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, buffer.toString(), beginningOffset, false, true ); handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, buffer.toString(), beginningOffset, false, true );
} else { } else {
@ -1320,8 +1320,8 @@ public class Scanner implements IScanner {
if( isLimitReached() ) if( isLimitReached() )
handleCompletionOnExpression( expression ); handleCompletionOnExpression( expression );
if (expression.trim().equals("")) if (expression.trim().equals("")) //$NON-NLS-1$
handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, "#if", beginningOffset, false, true ); handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, "#if", beginningOffset, false, true ); //$NON-NLS-1$
boolean expressionEvalResult = false; boolean expressionEvalResult = false;
@ -1355,9 +1355,9 @@ public class Scanner implements IScanner {
if( isLimitReached() ) if( isLimitReached() )
handleInvalidCompletion(); 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 ); buffer.append( restOfLine );
handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, buffer.toString(), beginningOffset, false, true ); handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, buffer.toString(), beginningOffset, false, true );
} }
@ -1415,8 +1415,8 @@ public class Scanner implements IScanner {
handleCompletionOnExpression( elifExpression ); handleCompletionOnExpression( elifExpression );
if (elifExpression.equals("")) if (elifExpression.equals("")) //$NON-NLS-1$
handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, "#elif", beginningOffset, false, true ); handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, "#elif", beginningOffset, false, true ); //$NON-NLS-1$
boolean elsifResult = false; boolean elsifResult = false;
if( scannerData.getBranchTracker().queryCurrentBranchForElif() ) if( scannerData.getBranchTracker().queryCurrentBranchForElif() )
@ -1467,15 +1467,15 @@ public class Scanner implements IScanner {
case PreprocessorDirectives.BLANK : case PreprocessorDirectives.BLANK :
String remainderOfLine = String remainderOfLine =
getRestOfPreprocessorLine().trim(); getRestOfPreprocessorLine().trim();
if (!remainderOfLine.equals("")) { if (!remainderOfLine.equals("")) { //$NON-NLS-1$
StringBuffer buffer = new StringBuffer( "# "); StringBuffer buffer = new StringBuffer( "# "); //$NON-NLS-1$
buffer.append( remainderOfLine ); buffer.append( remainderOfLine );
handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, buffer.toString(), beginningOffset, false, true); handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, buffer.toString(), beginningOffset, false, true);
} }
c = getChar(); c = getChar();
continue; continue;
default : default :
StringBuffer buffer = new StringBuffer( "# "); StringBuffer buffer = new StringBuffer( "# "); //$NON-NLS-1$
buffer.append( token ); buffer.append( token );
handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, buffer.toString(), beginningOffset, false, true ); handleProblem( IProblem.PREPROCESSOR_INVALID_DIRECTIVE, buffer.toString(), beginningOffset, false, true );
} }
@ -1490,51 +1490,51 @@ public class Scanner implements IScanner {
case ':' : case ':' :
return newToken( return newToken(
IToken.tCOLONCOLON, IToken.tCOLONCOLON,
"::", "::", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
default : default :
ungetChar(c); ungetChar(c);
return newToken( return newToken(
IToken.tCOLON, IToken.tCOLON,
":", ":", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
} }
case ';' : case ';' :
return newToken(IToken.tSEMI, ";", scannerData.getContextStack().getCurrentContext()); return newToken(IToken.tSEMI, ";", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
case ',' : case ',' :
return newToken(IToken.tCOMMA, ",", scannerData.getContextStack().getCurrentContext()); return newToken(IToken.tCOMMA, ",", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
case '?' : case '?' :
return newToken(IToken.tQUESTION, "?", scannerData.getContextStack().getCurrentContext()); return newToken(IToken.tQUESTION, "?", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
case '(' : case '(' :
return newToken(IToken.tLPAREN, "(", scannerData.getContextStack().getCurrentContext()); return newToken(IToken.tLPAREN, "(", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
case ')' : case ')' :
return newToken(IToken.tRPAREN, ")", scannerData.getContextStack().getCurrentContext()); return newToken(IToken.tRPAREN, ")", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
case '[' : case '[' :
return newToken(IToken.tLBRACKET, "[", scannerData.getContextStack().getCurrentContext()); return newToken(IToken.tLBRACKET, "[", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
case ']' : case ']' :
return newToken(IToken.tRBRACKET, "]", scannerData.getContextStack().getCurrentContext()); return newToken(IToken.tRBRACKET, "]", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
case '{' : case '{' :
return newToken(IToken.tLBRACE, "{", scannerData.getContextStack().getCurrentContext()); return newToken(IToken.tLBRACE, "{", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
case '}' : case '}' :
return newToken(IToken.tRBRACE, "}", scannerData.getContextStack().getCurrentContext()); return newToken(IToken.tRBRACE, "}", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
case '+' : case '+' :
c = getChar(); c = getChar();
switch (c) { switch (c) {
case '=' : case '=' :
return newToken( return newToken(
IToken.tPLUSASSIGN, IToken.tPLUSASSIGN,
"+=", "+=", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
case '+' : case '+' :
return newToken( return newToken(
IToken.tINCR, IToken.tINCR,
"++", "++", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
default : default :
ungetChar(c); ungetChar(c);
return newToken( return newToken(
IToken.tPLUS, IToken.tPLUS,
"+", "+", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
} }
case '-' : case '-' :
@ -1543,12 +1543,12 @@ public class Scanner implements IScanner {
case '=' : case '=' :
return newToken( return newToken(
IToken.tMINUSASSIGN, IToken.tMINUSASSIGN,
"-=", "-=", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
case '-' : case '-' :
return newToken( return newToken(
IToken.tDECR, IToken.tDECR,
"--", "--", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
case '>' : case '>' :
c = getChar(); c = getChar();
@ -1556,20 +1556,20 @@ public class Scanner implements IScanner {
case '*' : case '*' :
return newToken( return newToken(
IToken.tARROWSTAR, IToken.tARROWSTAR,
"->*", "->*", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
default : default :
ungetChar(c); ungetChar(c);
return newToken( return newToken(
IToken.tARROW, IToken.tARROW,
"->", "->", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
} }
default : default :
ungetChar(c); ungetChar(c);
return newToken( return newToken(
IToken.tMINUS, IToken.tMINUS,
"-", "-", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
} }
case '*' : case '*' :
@ -1578,13 +1578,13 @@ public class Scanner implements IScanner {
case '=' : case '=' :
return newToken( return newToken(
IToken.tSTARASSIGN, IToken.tSTARASSIGN,
"*=", "*=", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
default : default :
ungetChar(c); ungetChar(c);
return newToken( return newToken(
IToken.tSTAR, IToken.tSTAR,
"*", "*", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
} }
case '%' : case '%' :
@ -1593,13 +1593,13 @@ public class Scanner implements IScanner {
case '=' : case '=' :
return newToken( return newToken(
IToken.tMODASSIGN, IToken.tMODASSIGN,
"%=", "%=", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
default : default :
ungetChar(c); ungetChar(c);
return newToken( return newToken(
IToken.tMOD, IToken.tMOD,
"%", "%", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
} }
case '^' : case '^' :
@ -1608,13 +1608,13 @@ public class Scanner implements IScanner {
case '=' : case '=' :
return newToken( return newToken(
IToken.tXORASSIGN, IToken.tXORASSIGN,
"^=", "^=", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
default : default :
ungetChar(c); ungetChar(c);
return newToken( return newToken(
IToken.tXOR, IToken.tXOR,
"^", "^", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
} }
case '&' : case '&' :
@ -1623,18 +1623,18 @@ public class Scanner implements IScanner {
case '=' : case '=' :
return newToken( return newToken(
IToken.tAMPERASSIGN, IToken.tAMPERASSIGN,
"&=", "&=", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
case '&' : case '&' :
return newToken( return newToken(
IToken.tAND, IToken.tAND,
"&&", "&&", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
default : default :
ungetChar(c); ungetChar(c);
return newToken( return newToken(
IToken.tAMPER, IToken.tAMPER,
"&", "&", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
} }
case '|' : case '|' :
@ -1643,35 +1643,35 @@ public class Scanner implements IScanner {
case '=' : case '=' :
return newToken( return newToken(
IToken.tBITORASSIGN, IToken.tBITORASSIGN,
"|=", "|=", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
case '|' : case '|' :
return newToken( return newToken(
IToken.tOR, IToken.tOR,
"||", "||", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
default : default :
ungetChar(c); ungetChar(c);
return newToken( return newToken(
IToken.tBITOR, IToken.tBITOR,
"|", "|", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
} }
case '~' : case '~' :
return newToken(IToken.tCOMPL, "~", scannerData.getContextStack().getCurrentContext()); return newToken(IToken.tCOMPL, "~", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
case '!' : case '!' :
c = getChar(); c = getChar();
switch (c) { switch (c) {
case '=' : case '=' :
return newToken( return newToken(
IToken.tNOTEQUAL, IToken.tNOTEQUAL,
"!=", "!=", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
default : default :
ungetChar(c); ungetChar(c);
return newToken( return newToken(
IToken.tNOT, IToken.tNOT,
"!", "!", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
} }
case '=' : case '=' :
@ -1680,13 +1680,13 @@ public class Scanner implements IScanner {
case '=' : case '=' :
return newToken( return newToken(
IToken.tEQUAL, IToken.tEQUAL,
"==", "==", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
default : default :
ungetChar(c); ungetChar(c);
return newToken( return newToken(
IToken.tASSIGN, IToken.tASSIGN,
"=", "=", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
} }
case '<' : case '<' :
@ -1698,25 +1698,25 @@ public class Scanner implements IScanner {
case '=' : case '=' :
return newToken( return newToken(
IToken.tSHIFTLASSIGN, IToken.tSHIFTLASSIGN,
"<<=", "<<=", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
default : default :
ungetChar(c); ungetChar(c);
return newToken( return newToken(
IToken.tSHIFTL, IToken.tSHIFTL,
"<<", "<<", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
} }
case '=' : case '=' :
return newToken( return newToken(
IToken.tLTEQUAL, IToken.tLTEQUAL,
"<=", "<=", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
default : default :
ungetChar(c); ungetChar(c);
if( forInclusion ) if( forInclusion )
temporarilyReplaceDefinitionsMap(); temporarilyReplaceDefinitionsMap();
return newToken(IToken.tLT, "<", scannerData.getContextStack().getCurrentContext()); return newToken(IToken.tLT, "<", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
} }
case '>' : case '>' :
c = getChar(); c = getChar();
@ -1727,25 +1727,25 @@ public class Scanner implements IScanner {
case '=' : case '=' :
return newToken( return newToken(
IToken.tSHIFTRASSIGN, IToken.tSHIFTRASSIGN,
">>=", ">>=", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
default : default :
ungetChar(c); ungetChar(c);
return newToken( return newToken(
IToken.tSHIFTR, IToken.tSHIFTR,
">>", ">>", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
} }
case '=' : case '=' :
return newToken( return newToken(
IToken.tGTEQUAL, IToken.tGTEQUAL,
">=", ">=", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
default : default :
ungetChar(c); ungetChar(c);
if( forInclusion ) if( forInclusion )
restoreDefinitionsMap(); restoreDefinitionsMap();
return newToken(IToken.tGT, ">", scannerData.getContextStack().getCurrentContext()); return newToken(IToken.tGT, ">", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
} }
case '.' : case '.' :
c = getChar(); c = getChar();
@ -1756,7 +1756,7 @@ public class Scanner implements IScanner {
case '.' : case '.' :
return newToken( return newToken(
IToken.tELLIPSIS, IToken.tELLIPSIS,
"...", "...", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
default : default :
break; break;
@ -1765,13 +1765,13 @@ public class Scanner implements IScanner {
case '*' : case '*' :
return newToken( return newToken(
IToken.tDOTSTAR, IToken.tDOTSTAR,
".*", ".*", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
default : default :
ungetChar(c); ungetChar(c);
return newToken( return newToken(
IToken.tDOT, IToken.tDOT,
".", ".", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
} }
break; break;
@ -1789,13 +1789,13 @@ public class Scanner implements IScanner {
case '=' : case '=' :
return newToken( return newToken(
IToken.tDIVASSIGN, IToken.tDIVASSIGN,
"/=", "/=", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
default : default :
ungetChar(c); ungetChar(c);
return newToken( return newToken(
IToken.tDIV, IToken.tDIV,
"/", "/", //$NON-NLS-1$
scannerData.getContextStack().getCurrentContext()); scannerData.getContextStack().getCurrentContext());
} }
default : default :
@ -1838,9 +1838,9 @@ public class Scanner implements IScanner {
int completionPoint = expression.length() + 2; int completionPoint = expression.length() + 2;
IASTCompletionNode.CompletionKind kind = IASTCompletionNode.CompletionKind.MACRO_REFERENCE; 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()); IScanner subScanner = ParserFactory.createScanner( new StringReader(expression), SCRATCH, EMPTY_INFO, ParserMode.QUICK_PARSE, scannerData.getLanguage(), new NullSourceElementRequestor(), new NullLogService());
IToken lastToken = null; IToken lastToken = null;
@ -1883,7 +1883,7 @@ public class Scanner implements IScanner {
protected void handleInvalidCompletion() throws EndOfFileException 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 protected void handleCompletionOnPreprocessorDirective( String prefix ) throws EndOfFileException
@ -1948,7 +1948,7 @@ public class Scanner implements IScanner {
protected String getCurrentFile() 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 ); return processCharacterLiteral( c, false );
case ',' : case ',' :
if (tokenImage.length() > 0) throw endOfMacroToken; if (tokenImage.length() > 0) throw endOfMacroToken;
return newToken(IToken.tCOMMA, ",", scannerData.getContextStack().getCurrentContext()); return newToken(IToken.tCOMMA, ",", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
case '(' : case '(' :
if (tokenImage.length() > 0) throw endOfMacroToken; if (tokenImage.length() > 0) throw endOfMacroToken;
return newToken(IToken.tLPAREN, "(", scannerData.getContextStack().getCurrentContext()); return newToken(IToken.tLPAREN, "(", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
case ')' : case ')' :
if (tokenImage.length() > 0) throw endOfMacroToken; if (tokenImage.length() > 0) throw endOfMacroToken;
return newToken(IToken.tRPAREN, ")", scannerData.getContextStack().getCurrentContext()); return newToken(IToken.tRPAREN, ")", scannerData.getContextStack().getCurrentContext()); //$NON-NLS-1$
case '/' : case '/' :
if (tokenImage.length() > 0) throw endOfMacroToken; if (tokenImage.length() > 0) throw endOfMacroToken;
c = getChar(); c = getChar();
@ -2231,7 +2231,7 @@ public class Scanner implements IScanner {
if( scannerData.getParserMode() == ParserMode.QUICK_PARSE ) if( scannerData.getParserMode() == ParserMode.QUICK_PARSE )
{ {
if( expression.trim().equals( "0" ) ) if( expression.trim().equals( "0" ) ) //$NON-NLS-1$
return false; return false;
return true; return true;
@ -2275,7 +2275,7 @@ public class Scanner implements IScanner {
protected void skipOverSinglelineComment() throws ScannerException, EndOfFileException { protected void skipOverSinglelineComment() throws ScannerException, EndOfFileException {
StringBuffer comment = new StringBuffer("//"); StringBuffer comment = new StringBuffer("//"); //$NON-NLS-1$
int c; int c;
loop: loop:
@ -2298,7 +2298,7 @@ public class Scanner implements IScanner {
protected boolean skipOverMultilineComment() throws ScannerException, EndOfFileException { protected boolean skipOverMultilineComment() throws ScannerException, EndOfFileException {
int state = 0; int state = 0;
boolean encounteredNewline = false; boolean encounteredNewline = false;
StringBuffer comment = new StringBuffer("/*"); StringBuffer comment = new StringBuffer("/*"); //$NON-NLS-1$
// simple state machine to handle multi-line comments // simple state machine to handle multi-line comments
// state 0 == no end of comment in site // state 0 == no end of comment in site
// state 1 == encountered *, expecting / // state 1 == encountered *, expecting /
@ -2337,7 +2337,7 @@ public class Scanner implements IScanner {
} }
protected void poundInclude( int beginningOffset, int startLine ) throws ScannerException, EndOfFileException { protected void poundInclude( int beginningOffset, int startLine ) throws ScannerException, EndOfFileException {
StringBuffer potentialErrorLine = new StringBuffer( "#include "); StringBuffer potentialErrorLine = new StringBuffer( "#include "); //$NON-NLS-1$
skipOverWhitespace(); skipOverWhitespace();
int baseOffset = lastContext.getOffset() - lastContext.undoStackSize(); int baseOffset = lastContext.getOffset() - lastContext.undoStackSize();
int nameLine = scannerData.getContextStack().getCurrentLineNumber(); int nameLine = scannerData.getContextStack().getCurrentLineNumber();
@ -2348,7 +2348,7 @@ public class Scanner implements IScanner {
int startOffset = baseOffset; int startOffset = baseOffset;
int endOffset = baseOffset; int endOffset = baseOffset;
if (! includeLine.equals("")) { if (! includeLine.equals("")) { //$NON-NLS-1$
Scanner helperScanner = new Scanner( Scanner helperScanner = new Scanner(
new StringReader(includeLine), new StringReader(includeLine),
null, null,
@ -2429,7 +2429,7 @@ public class Scanner implements IScanner {
i = i =
scannerData.getASTFactory().createInclusion( scannerData.getASTFactory().createInclusion(
f, f,
"", "", //$NON-NLS-1$
!useIncludePath, !useIncludePath,
beginningOffset, beginningOffset,
startLine, startLine,
@ -2481,7 +2481,7 @@ public class Scanner implements IScanner {
protected List tokenizeReplacementString( int beginning, String key, String replacementString, List parameterIdentifiers ) protected List tokenizeReplacementString( int beginning, String key, String replacementString, List parameterIdentifiers )
{ {
List macroReplacementTokens = new ArrayList(); List macroReplacementTokens = new ArrayList();
if( replacementString.trim().equals( "" ) ) if( replacementString.trim().equals( "" ) ) //$NON-NLS-1$
return macroReplacementTokens; return macroReplacementTokens;
IScanner helperScanner=null; IScanner helperScanner=null;
try { try {
@ -2602,7 +2602,7 @@ public class Scanner implements IScanner {
String parameters = buffer.toString(); String parameters = buffer.toString();
// replace StringTokenizer later -- not performant // replace StringTokenizer later -- not performant
StringTokenizer tokenizer = new StringTokenizer(parameters, ","); StringTokenizer tokenizer = new StringTokenizer(parameters, ","); //$NON-NLS-1$
ArrayList parameterIdentifiers = ArrayList parameterIdentifiers =
new ArrayList(tokenizer.countTokens()); new ArrayList(tokenizer.countTokens());
while (tokenizer.hasMoreTokens()) { while (tokenizer.hasMoreTokens()) {
@ -2615,7 +2615,7 @@ public class Scanner implements IScanner {
String replacementString = getRestOfPreprocessorLine(); String replacementString = getRestOfPreprocessorLine();
macroReplacementTokens = ( ! replacementString.equals( "" ) ) ? macroReplacementTokens = ( ! replacementString.equals( "" ) ) ? //$NON-NLS-1$
tokenizeReplacementString( beginning, key, replacementString, parameterIdentifiers ) : tokenizeReplacementString( beginning, key, replacementString, parameterIdentifiers ) :
EMPTY_LIST; EMPTY_LIST;
@ -2623,7 +2623,7 @@ public class Scanner implements IScanner {
fullSignature.append( key ); fullSignature.append( key );
fullSignature.append( '('); fullSignature.append( '(');
fullSignature.append( parameters ); fullSignature.append( parameters );
fullSignature.append( ") "); fullSignature.append( ") "); //$NON-NLS-1$
fullSignature.append( replacementString ); fullSignature.append( replacementString );
descriptor = new FunctionMacroDescriptor( descriptor = new FunctionMacroDescriptor(
key, key,
@ -2638,8 +2638,8 @@ public class Scanner implements IScanner {
} }
else if ((c == '\n') || (c == '\r')) else if ((c == '\n') || (c == '\r'))
{ {
checkValidMacroRedefinition(key, previousDefinition, "", beginning); checkValidMacroRedefinition(key, previousDefinition, "", beginning); //$NON-NLS-1$
addDefinition( key, "" ); addDefinition( key, "" ); //$NON-NLS-1$
} }
else if ((c == ' ') || (c == '\t') ) { else if ((c == ' ') || (c == '\t') ) {
// this is a simple definition // this is a simple definition
@ -2657,33 +2657,33 @@ public class Scanner implements IScanner {
if (c == '/') // one line comment if (c == '/') // one line comment
{ {
skipOverSinglelineComment(); skipOverSinglelineComment();
checkValidMacroRedefinition(key, previousDefinition, "", beginning); checkValidMacroRedefinition(key, previousDefinition, "", beginning); //$NON-NLS-1$
addDefinition(key, ""); addDefinition(key, ""); //$NON-NLS-1$
} else if (c == '*') // multi-line comment } else if (c == '*') // multi-line comment
{ {
if (skipOverMultilineComment()) { if (skipOverMultilineComment()) {
// we have gone over a newline // we have gone over a newline
// therefore, this symbol was defined to an empty string // therefore, this symbol was defined to an empty string
checkValidMacroRedefinition(key, previousDefinition, "", beginning); checkValidMacroRedefinition(key, previousDefinition, "", beginning); //$NON-NLS-1$
addDefinition(key, ""); addDefinition(key, ""); //$NON-NLS-1$
} else { } else {
String value = getRestOfPreprocessorLine(); String value = getRestOfPreprocessorLine();
checkValidMacroRedefinition(key, previousDefinition, "", beginning); checkValidMacroRedefinition(key, previousDefinition, "", beginning); //$NON-NLS-1$
addDefinition(key, value); addDefinition(key, value);
} }
} else { } else {
// this is not a comment // this is not a comment
// it is a bad statement // it is a bad statement
potentialErrorMessage.append( key ); potentialErrorMessage.append( key );
potentialErrorMessage.append( " /"); potentialErrorMessage.append( " /"); //$NON-NLS-1$
potentialErrorMessage.append( getRestOfPreprocessorLine() ); potentialErrorMessage.append( getRestOfPreprocessorLine() );
handleProblem( IProblem.PREPROCESSOR_INVALID_MACRO_DEFN, potentialErrorMessage.toString(), beginning, false, true ); handleProblem( IProblem.PREPROCESSOR_INVALID_MACRO_DEFN, potentialErrorMessage.toString(), beginning, false, true );
return; return;
} }
} else { } else {
potentialErrorMessage = new StringBuffer(); potentialErrorMessage = new StringBuffer();
potentialErrorMessage.append( "#define"); potentialErrorMessage.append( "#define"); //$NON-NLS-1$
potentialErrorMessage.append( key ); potentialErrorMessage.append( key );
potentialErrorMessage.append( (char)c ); potentialErrorMessage.append( (char)c );
potentialErrorMessage.append( getRestOfPreprocessorLine() ); potentialErrorMessage.append( getRestOfPreprocessorLine() );
@ -2798,7 +2798,7 @@ public class Scanner implements IScanner {
buffer.append('\"'); buffer.append('\"');
break; break;
case IToken.tLSTRING : case IToken.tLSTRING :
buffer.append( "L\""); buffer.append( "L\""); //$NON-NLS-1$
buffer.append(t.getImage()); buffer.append(t.getImage());
buffer.append('\"'); buffer.append('\"');
break; break;
@ -2958,7 +2958,7 @@ public class Scanner implements IScanner {
buffer.append('\"'); buffer.append('\"');
break; break;
case IToken.tLSTRING: case IToken.tLSTRING:
buffer.append("L\""); buffer.append("L\""); //$NON-NLS-1$
buffer.append(t.getImage()); buffer.append(t.getImage());
buffer.append('\"'); buffer.append('\"');
break; break;
@ -2987,7 +2987,7 @@ public class Scanner implements IScanner {
if( t.getType() != tPOUNDPOUND && ! pastingNext ) if( t.getType() != tPOUNDPOUND && ! pastingNext )
if (i < (numberOfTokens-1)) // Do not append to the last one if (i < (numberOfTokens-1)) // Do not append to the last one
buffer.append( " " ); buffer.append( " " ); //$NON-NLS-1$
} }
String finalString = buffer.toString(); String finalString = buffer.toString();
try try
@ -3013,7 +3013,7 @@ public class Scanner implements IScanner {
} }
else { 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() ); logMessage.append( expansion.getMacroType() );
scannerData.getLogService().traceLog( logMessage.toString() ); scannerData.getLogService().traceLog( logMessage.toString() );
} }
@ -3034,8 +3034,8 @@ public class Scanner implements IScanner {
c = getChar(); c = getChar();
if (c != ')') if (c != ')')
{ {
handleProblem( IProblem.PREPROCESSOR_MACRO_USAGE_ERROR, "defined()", o, false, true ); handleProblem( IProblem.PREPROCESSOR_MACRO_USAGE_ERROR, "defined()", o, false, true ); //$NON-NLS-1$
return "0"; return "0"; //$NON-NLS-1$
} }
} }
else else
@ -3045,9 +3045,9 @@ public class Scanner implements IScanner {
} }
if (getDefinition(definitionIdentifier) != null) if (getDefinition(definitionIdentifier) != null)
return "1"; return "1"; //$NON-NLS-1$
return "0"; return "0"; //$NON-NLS-1$
} }
public void setThrowExceptionOnBadCharacterRead( boolean throwOnBad ){ public void setThrowExceptionOnBadCharacterRead( boolean throwOnBad ){
@ -3117,14 +3117,14 @@ public class Scanner implements IScanner {
*/ */
private String reconcilePath(String originalPath ) { private String reconcilePath(String originalPath ) {
if( originalPath == null ) return null; if( originalPath == null ) return null;
String [] segments = originalPath.split( "[/\\\\]" ); String [] segments = originalPath.split( "[/\\\\]" ); //$NON-NLS-1$
if( segments.length == 1 ) return originalPath; if( segments.length == 1 ) return originalPath;
Vector results = new Vector(); Vector results = new Vector();
for( int i = 0; i < segments.length; ++i ) for( int i = 0; i < segments.length; ++i )
{ {
String segment = segments[i]; String segment = segments[i];
if( segment.equals( ".") ) continue; if( segment.equals( ".") ) continue; //$NON-NLS-1$
if( segment.equals("..") ) if( segment.equals("..") ) //$NON-NLS-1$
{ {
if( results.size() > 0 ) if( results.size() > 0 )
results.removeElementAt( results.size() - 1 ); results.removeElementAt( results.size() - 1 );
@ -3140,7 +3140,7 @@ public class Scanner implements IScanner {
if( i.hasNext() ) if( i.hasNext() )
buffer.append( File.separatorChar ); 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(); return buffer.toString();
} }

View file

@ -87,7 +87,7 @@ public class KeywordSets {
static static
{ {
MACRO_ONLY = new HashSet(); MACRO_ONLY = new HashSet();
MACRO_ONLY.add("defined()" ); MACRO_ONLY.add("defined()" ); //$NON-NLS-1$
} }

View file

@ -36,7 +36,7 @@ public class Token implements IToken {
public String toString() 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; public int type;

View file

@ -50,22 +50,22 @@ public class ASTUtil {
{ {
IASTTemplateParameter.ParamKind kind = parameter.getTemplateParameterKind(); IASTTemplateParameter.ParamKind kind = parameter.getTemplateParameterKind();
if(kind == IASTTemplateParameter.ParamKind.CLASS){ if(kind == IASTTemplateParameter.ParamKind.CLASS){
paramType.append("class"); paramType.append("class"); //$NON-NLS-1$
} }
if(kind == IASTTemplateParameter.ParamKind.TYPENAME){ if(kind == IASTTemplateParameter.ParamKind.TYPENAME){
paramType.append("typename"); paramType.append("typename"); //$NON-NLS-1$
} }
if(kind == IASTTemplateParameter.ParamKind.TEMPLATE_LIST){ if(kind == IASTTemplateParameter.ParamKind.TEMPLATE_LIST){
paramType.append("template<"); paramType.append("template<"); //$NON-NLS-1$
String[] subParams = getTemplateParameters(parameter.getTemplateParameters()); String[] subParams = getTemplateParameters(parameter.getTemplateParameters());
int p = 0; int p = 0;
if ( subParams.length > 0) if ( subParams.length > 0)
paramType.append(subParams[p++]); paramType.append(subParams[p++]);
while( p < subParams.length){ while( p < subParams.length){
paramType.append(", "); paramType.append(", "); //$NON-NLS-1$
paramType.append(subParams[p++]); paramType.append(subParams[p++]);
} }
paramType.append(">"); paramType.append(">"); //$NON-NLS-1$
} }
if(kind == IASTTemplateParameter.ParamKind.PARAMETER){ if(kind == IASTTemplateParameter.ParamKind.PARAMETER){
paramType.append(getType(parameter.getParameterDeclaration())); paramType.append(getType(parameter.getParameterDeclaration()));
@ -107,7 +107,7 @@ public class ASTUtil {
? expression.getLiteralString() ? expression.getLiteralString()
: expression.getIdExpression() ); : expression.getIdExpression() );
if(literal.length() > 0){ if(literal.length() > 0){
initializer.append("="); initializer.append("="); //$NON-NLS-1$
initializer.append(literal); initializer.append(literal);
} }
} }
@ -119,9 +119,9 @@ public class ASTUtil {
StringBuffer type = new StringBuffer(); StringBuffer type = new StringBuffer();
ASTPointerOperator po = declaration.getPointerToFunctionOperator(); ASTPointerOperator po = declaration.getPointerToFunctionOperator();
if(po != null){ if(po != null){
type.append("("); type.append("("); //$NON-NLS-1$
type.append(getPointerOperator(po)); type.append(getPointerOperator(po));
type.append(")"); type.append(")"); //$NON-NLS-1$
String[] parameters =getParameterTypes(declaration.getParameters(), false /* replace with takeVarArgs() later*/); String[] parameters =getParameterTypes(declaration.getParameters(), false /* replace with takeVarArgs() later*/);
type.append(getParametersString(parameters)); type.append(getParametersString(parameters));
} }
@ -131,7 +131,7 @@ public class ASTUtil {
StringBuffer type = new StringBuffer(); StringBuffer type = new StringBuffer();
if(declaration.isConst()) if(declaration.isConst())
type.append("const "); type.append("const "); //$NON-NLS-1$
IASTTypeSpecifier typeSpecifier = declaration.getTypeSpecifier(); IASTTypeSpecifier typeSpecifier = declaration.getTypeSpecifier();
if(typeSpecifier instanceof IASTElaboratedTypeSpecifier){ if(typeSpecifier instanceof IASTElaboratedTypeSpecifier){
IASTElaboratedTypeSpecifier elab = (IASTElaboratedTypeSpecifier) typeSpecifier; IASTElaboratedTypeSpecifier elab = (IASTElaboratedTypeSpecifier) typeSpecifier;
@ -147,18 +147,18 @@ public class ASTUtil {
StringBuffer type = new StringBuffer(); StringBuffer type = new StringBuffer();
ASTClassKind t = elab.getClassKind(); ASTClassKind t = elab.getClassKind();
if( t == ASTClassKind.CLASS){ if( t == ASTClassKind.CLASS){
type.append("class"); type.append("class"); //$NON-NLS-1$
} }
else if( t == ASTClassKind.STRUCT){ else if( t == ASTClassKind.STRUCT){
type.append("struct"); type.append("struct"); //$NON-NLS-1$
} }
else if( t == ASTClassKind.UNION){ else if( t == ASTClassKind.UNION){
type.append("union"); type.append("union"); //$NON-NLS-1$
} }
else if( t == ASTClassKind.STRUCT){ 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()); type.append(elab.getName().toString());
return type.toString(); return type.toString();
} }
@ -174,18 +174,18 @@ public class ASTUtil {
} }
public static String getPointerOperator(ASTPointerOperator po){ public static String getPointerOperator(ASTPointerOperator po){
String pointerString =""; String pointerString =""; //$NON-NLS-1$
if(po == ASTPointerOperator.POINTER) if(po == ASTPointerOperator.POINTER)
pointerString = ("*"); pointerString = ("*"); //$NON-NLS-1$
if(po == ASTPointerOperator.REFERENCE) if(po == ASTPointerOperator.REFERENCE)
pointerString =("&"); pointerString =("&"); //$NON-NLS-1$
if(po == ASTPointerOperator.CONST_POINTER) if(po == ASTPointerOperator.CONST_POINTER)
pointerString =("* const"); pointerString =("* const"); //$NON-NLS-1$
if(po == ASTPointerOperator.VOLATILE_POINTER) if(po == ASTPointerOperator.VOLATILE_POINTER)
pointerString =("* volatile"); pointerString =("* volatile"); //$NON-NLS-1$
return pointerString; return pointerString;
} }
@ -195,7 +195,7 @@ public class ASTUtil {
Iterator i = declaration.getArrayModifiers(); Iterator i = declaration.getArrayModifiers();
while (i.hasNext()){ while (i.hasNext()){
i.next(); i.next();
arrayString.append("[]"); arrayString.append("[]"); //$NON-NLS-1$
} }
return arrayString.toString(); return arrayString.toString();
} }
@ -221,24 +221,24 @@ public class ASTUtil {
} }
// add the ellipse to the parameter type list // add the ellipse to the parameter type list
if(takesVarArgs) if(takesVarArgs)
parameterTypes[paramListSize-1] = "..."; parameterTypes[paramListSize-1] = "..."; //$NON-NLS-1$
return parameterTypes; return parameterTypes;
} }
public static String getParametersString(String[] parameterTypes) public static String getParametersString(String[] parameterTypes)
{ {
StringBuffer parameters = new StringBuffer(""); StringBuffer parameters = new StringBuffer(""); //$NON-NLS-1$
if ((parameterTypes != null) && (parameterTypes.length > 0)) { if ((parameterTypes != null) && (parameterTypes.length > 0)) {
parameters.append("("); parameters.append("("); //$NON-NLS-1$
int i = 0; int i = 0;
parameters.append(parameterTypes[i++]); parameters.append(parameterTypes[i++]);
while (i < parameterTypes.length) { while (i < parameterTypes.length) {
parameters.append(", "); parameters.append(", "); //$NON-NLS-1$
parameters.append(parameterTypes[i++]); parameters.append(parameterTypes[i++]);
} }
parameters.append(")"); parameters.append(")"); //$NON-NLS-1$
} else { } else {
if (parameterTypes != null) parameters.append("()"); if (parameterTypes != null) parameters.append("()"); //$NON-NLS-1$
} }
return parameters.toString(); return parameters.toString();

View file

@ -38,17 +38,17 @@ public class BasicSearchMatch implements IMatch, Comparable {
} }
public int hashCode(){ public int hashCode(){
String hashString = ""; String hashString = ""; //$NON-NLS-1$
hashString += name; hashString += name;
hashString += ":" + parentName; hashString += ":" + parentName; //$NON-NLS-1$
hashString += ":" + returnType; hashString += ":" + returnType; //$NON-NLS-1$
if( getLocation() != null) if( getLocation() != null)
hashString += ":" + getLocation().toString(); hashString += ":" + getLocation().toString(); //$NON-NLS-1$
hashString += ":" + startOffset + ":" + endOffset; hashString += ":" + startOffset + ":" + endOffset; //$NON-NLS-1$ //$NON-NLS-2$
hashString += ":" + type + ":" + visibility; hashString += ":" + type + ":" + visibility; //$NON-NLS-1$ //$NON-NLS-2$
return hashString.hashCode(); return hashString.hashCode();
} }
@ -108,11 +108,11 @@ public class BasicSearchMatch implements IMatch, Comparable {
String str1 = getLocation().toString(); String str1 = getLocation().toString();
String str2 = match.getLocation().toString(); String str2 = match.getLocation().toString();
str1 += " " + getStartOffset()+ " "; str1 += " " + getStartOffset()+ " "; //$NON-NLS-1$ //$NON-NLS-2$
str2 += " " + match.getStartOffset()+ " "; str2 += " " + match.getStartOffset()+ " "; //$NON-NLS-1$ //$NON-NLS-2$
str1 += getName() + " " + getParentName()+ " " + getReturnType(); str1 += getName() + " " + getParentName()+ " " + getReturnType(); //$NON-NLS-1$ //$NON-NLS-2$
str2 += match.getName() + " " + match.getParentName()+ " " + getReturnType(); str2 += match.getName() + " " + match.getParentName()+ " " + getReturnType(); //$NON-NLS-1$ //$NON-NLS-2$
return str1.compareTo( str2 ); return str1.compareTo( str2 );
} }

View file

@ -87,7 +87,7 @@ public class BasicSearchResultCollector implements ICSearchResultCollector {
result.startOffset = start; result.startOffset = start;
result.endOffset = end; result.endOffset = end;
result.parentName = ""; result.parentName = ""; //$NON-NLS-1$
IASTOffsetableNamedElement offsetable = null; IASTOffsetableNamedElement offsetable = null;
@ -99,7 +99,7 @@ public class BasicSearchResultCollector implements ICSearchResultCollector {
result.name = offsetable.getName(); result.name = offsetable.getName();
} }
result.parentName = ""; result.parentName = ""; //$NON-NLS-1$
String [] names = null; String [] names = null;
if( offsetable instanceof IASTEnumerator ){ if( offsetable instanceof IASTEnumerator ){
IASTEnumerator enumerator = (IASTEnumerator) offsetable; IASTEnumerator enumerator = (IASTEnumerator) offsetable;
@ -111,7 +111,7 @@ public class BasicSearchResultCollector implements ICSearchResultCollector {
if( names != null ){ if( names != null ){
for( int i = 0; i < names.length - 1; i++ ){ for( int i = 0; i < names.length - 1; i++ ){
if( i > 0 ) if( i > 0 )
result.parentName += "::"; result.parentName += "::"; //$NON-NLS-1$
result.parentName += names[ i ]; result.parentName += names[ i ];
} }
@ -136,9 +136,9 @@ public class BasicSearchResultCollector implements ICSearchResultCollector {
*/ */
private String getParameterString(IASTFunction function) { private String getParameterString(IASTFunction function) {
if( function == null ) if( function == null )
return ""; return ""; //$NON-NLS-1$
String paramString = "("; String paramString = "("; //$NON-NLS-1$
Iterator iter = function.getParameters(); Iterator iter = function.getParameters();
@ -146,11 +146,11 @@ public class BasicSearchResultCollector implements ICSearchResultCollector {
while( iter.hasNext() ){ while( iter.hasNext() ){
IASTParameterDeclaration param = (IASTParameterDeclaration) iter.next(); IASTParameterDeclaration param = (IASTParameterDeclaration) iter.next();
if( !first ) paramString += ", "; if( !first ) paramString += ", "; //$NON-NLS-1$
IASTTypeSpecifier typeSpec = param.getTypeSpecifier(); IASTTypeSpecifier typeSpec = param.getTypeSpecifier();
if( param.isConst() ) if( param.isConst() )
paramString += "const "; paramString += "const "; //$NON-NLS-1$
if( typeSpec instanceof IASTSimpleTypeSpecifier ){ if( typeSpec instanceof IASTSimpleTypeSpecifier ){
paramString += ((IASTSimpleTypeSpecifier)typeSpec).getTypename(); paramString += ((IASTSimpleTypeSpecifier)typeSpec).getTypename();
@ -159,30 +159,30 @@ public class BasicSearchResultCollector implements ICSearchResultCollector {
} else if( typeSpec instanceof IASTElaboratedTypeSpecifier ){ } else if( typeSpec instanceof IASTElaboratedTypeSpecifier ){
ASTClassKind kind = ((IASTElaboratedTypeSpecifier)typeSpec).getClassKind(); ASTClassKind kind = ((IASTElaboratedTypeSpecifier)typeSpec).getClassKind();
if( kind == ASTClassKind.CLASS ){ if( kind == ASTClassKind.CLASS ){
paramString += "class "; paramString += "class "; //$NON-NLS-1$
} else if( kind == ASTClassKind.STRUCT ){ } else if( kind == ASTClassKind.STRUCT ){
paramString += "struct "; paramString += "struct "; //$NON-NLS-1$
} else if( kind == ASTClassKind.ENUM ){ } else if( kind == ASTClassKind.ENUM ){
paramString += "enum "; paramString += "enum "; //$NON-NLS-1$
} else if( kind == ASTClassKind.UNION ){ } else if( kind == ASTClassKind.UNION ){
paramString += "union "; paramString += "union "; //$NON-NLS-1$
} }
paramString += ((IASTElaboratedTypeSpecifier)typeSpec).getName(); paramString += ((IASTElaboratedTypeSpecifier)typeSpec).getName();
} }
Iterator ptrs = param.getPointerOperators(); Iterator ptrs = param.getPointerOperators();
if( ptrs.hasNext() ) paramString += " "; if( ptrs.hasNext() ) paramString += " "; //$NON-NLS-1$
while( ptrs.hasNext() ){ while( ptrs.hasNext() ){
ASTPointerOperator ptr = (ASTPointerOperator)ptrs.next(); ASTPointerOperator ptr = (ASTPointerOperator)ptrs.next();
if( ptr == ASTPointerOperator.POINTER ) if( ptr == ASTPointerOperator.POINTER )
paramString += "*"; paramString += "*"; //$NON-NLS-1$
else if( ptr == ASTPointerOperator.REFERENCE ) else if( ptr == ASTPointerOperator.REFERENCE )
paramString += "&"; paramString += "&"; //$NON-NLS-1$
else if( ptr == ASTPointerOperator.CONST_POINTER ) else if( ptr == ASTPointerOperator.CONST_POINTER )
paramString += " const * "; paramString += " const * "; //$NON-NLS-1$
else if( ptr == ASTPointerOperator.VOLATILE_POINTER ) else if( ptr == ASTPointerOperator.VOLATILE_POINTER )
paramString += " volatile * "; paramString += " volatile * "; //$NON-NLS-1$
ptr = ASTPointerOperator.POINTER; ptr = ASTPointerOperator.POINTER;
} }
@ -190,7 +190,7 @@ public class BasicSearchResultCollector implements ICSearchResultCollector {
first = false; first = false;
} }
paramString += ")"; paramString += ")"; //$NON-NLS-1$
return paramString; return paramString;
} }

View file

@ -169,7 +169,7 @@ public class SearchEngine implements ICSearchConstants{
//initialize progress monitor //initialize progress monitor
IProgressMonitor progressMonitor = collector.getProgressMonitor(); IProgressMonitor progressMonitor = collector.getProgressMonitor();
if( progressMonitor != null ){ 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 */ /* index search */

View file

@ -181,7 +181,7 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
scanner = scanner =
ParserFactory.createScanner( ParserFactory.createScanner(
new StringReader(patternString), new StringReader(patternString),
"TEXT", "TEXT", //$NON-NLS-1$
new ScannerInfo(), new ScannerInfo(),
ParserMode.QUICK_PARSE, ParserMode.QUICK_PARSE,
ParserLanguage.CPP, ParserLanguage.CPP,
@ -252,7 +252,7 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
scanner = scanner =
ParserFactory.createScanner( ParserFactory.createScanner(
new StringReader(patternString), new StringReader(patternString),
"TEXT", "TEXT", //$NON-NLS-1$
new ScannerInfo(), new ScannerInfo(),
ParserMode.QUICK_PARSE, ParserMode.QUICK_PARSE,
ParserLanguage.CPP, ParserLanguage.CPP,
@ -286,7 +286,7 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
} }
int index = patternString.indexOf( '(' ); 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 ); String nameString = ( index == -1 ) ? patternString : patternString.substring( 0, index );
IScanner scanner=null; IScanner scanner=null;
@ -294,7 +294,7 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
scanner = scanner =
ParserFactory.createScanner( ParserFactory.createScanner(
new StringReader(nameString), new StringReader(nameString),
"TEXT", "TEXT", //$NON-NLS-1$
new ScannerInfo(), new ScannerInfo(),
ParserMode.QUICK_PARSE, ParserMode.QUICK_PARSE,
ParserLanguage.CPP, ParserLanguage.CPP,
@ -353,7 +353,7 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
scanner = scanner =
ParserFactory.createScanner( ParserFactory.createScanner(
new StringReader(patternString), new StringReader(patternString),
"TEXT", "TEXT", //$NON-NLS-1$
new ScannerInfo(), new ScannerInfo(),
ParserMode.QUICK_PARSE, ParserMode.QUICK_PARSE,
ParserLanguage.CPP, ParserLanguage.CPP,
@ -406,17 +406,17 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
private static LinkedList scanForParameters( String paramString ) { private static LinkedList scanForParameters( String paramString ) {
LinkedList list = new LinkedList(); LinkedList list = new LinkedList();
if( paramString == null || paramString.equals("") ) if( paramString == null || paramString.equals("") ) //$NON-NLS-1$
return list; return list;
String functionString = "void f " + paramString + ";"; String functionString = "void f " + paramString + ";"; //$NON-NLS-1$ //$NON-NLS-2$
IScanner scanner=null; IScanner scanner=null;
try { try {
scanner = scanner =
ParserFactory.createScanner( ParserFactory.createScanner(
new StringReader(functionString), new StringReader(functionString),
"TEXT", "TEXT", //$NON-NLS-1$
new ScannerInfo(), new ScannerInfo(),
ParserMode.QUICK_PARSE, ParserMode.QUICK_PARSE,
ParserLanguage.CPP, ParserLanguage.CPP,
@ -456,7 +456,7 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
if (param == null){ if (param == null){
//This means that no params have been added (i.e. empty brackets - void case) //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); list.add (param);
} }
} }
@ -467,7 +467,7 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
static public char [] getParamString( IASTParameterDeclaration param ){ static public char [] getParamString( IASTParameterDeclaration param ){
if( param == null ) return null; if( param == null ) return null;
String signature = ""; String signature = ""; //$NON-NLS-1$
IASTTypeSpecifier typeSpec = param.getTypeSpecifier(); IASTTypeSpecifier typeSpec = param.getTypeSpecifier();
if( typeSpec instanceof IASTSimpleTypeSpecifier ){ if( typeSpec instanceof IASTSimpleTypeSpecifier ){
@ -476,13 +476,13 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
} else if( typeSpec instanceof IASTElaboratedTypeSpecifier ){ } else if( typeSpec instanceof IASTElaboratedTypeSpecifier ){
IASTElaboratedTypeSpecifier elaborated = (IASTElaboratedTypeSpecifier)typeSpec; IASTElaboratedTypeSpecifier elaborated = (IASTElaboratedTypeSpecifier)typeSpec;
if( elaborated.getClassKind() == ASTClassKind.CLASS ){ if( elaborated.getClassKind() == ASTClassKind.CLASS ){
signature += "class "; signature += "class "; //$NON-NLS-1$
} else if( elaborated.getClassKind() == ASTClassKind.ENUM ) { } else if( elaborated.getClassKind() == ASTClassKind.ENUM ) {
signature += "enum "; signature += "enum "; //$NON-NLS-1$
} else if( elaborated.getClassKind() == ASTClassKind.STRUCT ) { } else if( elaborated.getClassKind() == ASTClassKind.STRUCT ) {
signature += "struct "; signature += "struct "; //$NON-NLS-1$
} else if( elaborated.getClassKind() == ASTClassKind.UNION ) { } else if( elaborated.getClassKind() == ASTClassKind.UNION ) {
signature += "union"; signature += "union"; //$NON-NLS-1$
} }
signature += elaborated.getName(); signature += elaborated.getName();
@ -494,29 +494,29 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
signature += enumSpec.getName(); signature += enumSpec.getName();
} }
signature += " "; signature += " "; //$NON-NLS-1$
if( param.isConst() ) signature += "const "; if( param.isConst() ) signature += "const "; //$NON-NLS-1$
if( param.isVolatile() ) signature += "volatile "; if( param.isVolatile() ) signature += "volatile "; //$NON-NLS-1$
Iterator ptrs = param.getPointerOperators(); Iterator ptrs = param.getPointerOperators();
while( ptrs.hasNext() ){ while( ptrs.hasNext() ){
ASTPointerOperator ptrOp = (ASTPointerOperator) ptrs.next(); ASTPointerOperator ptrOp = (ASTPointerOperator) ptrs.next();
if( ptrOp == ASTPointerOperator.POINTER ){ if( ptrOp == ASTPointerOperator.POINTER ){
signature += " * "; signature += " * "; //$NON-NLS-1$
} else if( ptrOp == ASTPointerOperator.REFERENCE ){ } else if( ptrOp == ASTPointerOperator.REFERENCE ){
signature += " & "; signature += " & "; //$NON-NLS-1$
} else if( ptrOp == ASTPointerOperator.CONST_POINTER ){ } else if( ptrOp == ASTPointerOperator.CONST_POINTER ){
signature += " const * "; signature += " const * "; //$NON-NLS-1$
} else if( ptrOp == ASTPointerOperator.VOLATILE_POINTER ){ } else if( ptrOp == ASTPointerOperator.VOLATILE_POINTER ){
signature += " volatile * "; signature += " volatile * "; //$NON-NLS-1$
} }
} }
Iterator arrayModifiers = param.getArrayModifiers(); Iterator arrayModifiers = param.getArrayModifiers();
while( arrayModifiers.hasNext() ){ while( arrayModifiers.hasNext() ){
arrayModifiers.next(); arrayModifiers.next();
signature += " [] "; signature += " [] "; //$NON-NLS-1$
} }
return signature.toCharArray(); return signature.toCharArray();
@ -525,7 +525,7 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
static private LinkedList scanForNames( IScanner scanner, IToken unusedToken ){ static private LinkedList scanForNames( IScanner scanner, IToken unusedToken ){
LinkedList list = new LinkedList(); LinkedList list = new LinkedList();
String name = new String(""); String name = new String(""); //$NON-NLS-1$
try { try {
IToken token = ( unusedToken != null ) ? unusedToken : scanner.nextToken(); IToken token = ( unusedToken != null ) ? unusedToken : scanner.nextToken();
@ -540,12 +540,12 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
switch( token.getType() ){ switch( token.getType() ){
case IToken.tCOLONCOLON : case IToken.tCOLONCOLON :
list.addLast( name.toCharArray() ); list.addLast( name.toCharArray() );
name = new String(""); name = new String(""); //$NON-NLS-1$
lastTokenWasOperator = false; lastTokenWasOperator = false;
break; break;
case IToken.t_operator : case IToken.t_operator :
name += token.getImage() + " "; name += token.getImage() + " "; //$NON-NLS-1$
lastTokenWasOperator = true; lastTokenWasOperator = true;
break; break;
@ -562,7 +562,7 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
token.getType() != IToken.tRBRACKET && token.getType() != IToken.tRBRACKET &&
token.getType()!= IToken.tGT token.getType()!= IToken.tGT
){ ){
name += " "; name += " "; //$NON-NLS-1$
} else { } else {
encounteredWild = false; encounteredWild = false;
} }
@ -581,8 +581,8 @@ public abstract class CSearchPattern implements ICSearchConstants, ICSearchPatte
} catch ( ScannerException e ){ } catch ( ScannerException e ){
if( e.getProblem().getID() == IProblem.SCANNER_BAD_CHARACTER ){ if( e.getProblem().getID() == IProblem.SCANNER_BAD_CHARACTER ){
//TODO : This may not be \\, it could be another bad character //TODO : This may not be \\, it could be another bad character
if( !encounteredWild && !lastTokenWasOperator ) name += " "; if( !encounteredWild && !lastTokenWasOperator ) name += " "; //$NON-NLS-1$
name += "\\"; name += "\\"; //$NON-NLS-1$
encounteredWild = true; encounteredWild = true;
lastTokenWasOperator = false; lastTokenWasOperator = false;
prev = null; prev = null;

View file

@ -361,7 +361,7 @@ public class MatchLocator implements ISourceElementRequestor, ICSearchConstants
int length = paths.length; int length = paths.length;
if( progressMonitor != null ){ if( progressMonitor != null ){
progressMonitor.beginTask( "", length ); progressMonitor.beginTask( "", length ); //$NON-NLS-1$
} }
for( int i = 0; i < length; i++ ){ for( int i = 0; i < length; i++ ){
@ -448,7 +448,7 @@ public class MatchLocator implements ISourceElementRequestor, ICSearchConstants
} }
if (VERBOSE) if (VERBOSE)
MatchLocator.verbose("*** New Search for path: " + pathString); MatchLocator.verbose("*** New Search for path: " + pathString); //$NON-NLS-1$
try{ try{
@ -461,7 +461,7 @@ public class MatchLocator implements ISourceElementRequestor, ICSearchConstants
} }
catch(VirtualMachineError vmErr){ catch(VirtualMachineError vmErr){
if (VERBOSE){ if (VERBOSE){
MatchLocator.verbose("MatchLocator VM Error: "); MatchLocator.verbose("MatchLocator VM Error: "); //$NON-NLS-1$
vmErr.printStackTrace(); vmErr.printStackTrace();
} }
} }
@ -483,7 +483,7 @@ public class MatchLocator implements ISourceElementRequestor, ICSearchConstants
offset = reference.getOffset(); offset = reference.getOffset();
end = offset + reference.getName().length(); end = offset + reference.getName().length();
if (VERBOSE) if (VERBOSE)
MatchLocator.verbose("Report Match: " + reference.getName()); MatchLocator.verbose("Report Match: " + reference.getName()); //$NON-NLS-1$
} else if( node instanceof IASTOffsetableNamedElement ){ } else if( node instanceof IASTOffsetableNamedElement ){
IASTOffsetableNamedElement offsetableElement = (IASTOffsetableNamedElement) node; IASTOffsetableNamedElement offsetableElement = (IASTOffsetableNamedElement) node;
offset = offsetableElement.getNameOffset() != 0 ? offsetableElement.getNameOffset() offset = offsetableElement.getNameOffset() != 0 ? offsetableElement.getNameOffset()
@ -494,7 +494,7 @@ public class MatchLocator implements ISourceElementRequestor, ICSearchConstants
} }
if (VERBOSE) if (VERBOSE)
MatchLocator.verbose("Report Match: " + offsetableElement.getName()); MatchLocator.verbose("Report Match: " + offsetableElement.getName()); //$NON-NLS-1$
} }
IMatch match = null; IMatch match = null;
@ -591,7 +591,7 @@ public class MatchLocator implements ISourceElementRequestor, ICSearchConstants
} }
public static void verbose(String log) { 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) /* (non-Javadoc)

View file

@ -102,7 +102,7 @@ public class MethodDeclarationPattern extends CSearchPattern {
Iterator params = function.getParameters(); 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 //All empty lists have transformed to void, this function has no parms
return ACCURATE_MATCH; return ACCURATE_MATCH;
} }

View file

@ -20,19 +20,19 @@ public class Addr2line {
private String lastaddr, lastsymbol, lastline; private String lastaddr, lastsymbol, lastline;
public Addr2line(String command, String file) throws IOException { 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); addr2line = ProcessFactory.getFactory().exec(args);
stdin = new BufferedWriter(new OutputStreamWriter(addr2line.getOutputStream())); stdin = new BufferedWriter(new OutputStreamWriter(addr2line.getOutputStream()));
stdout = new BufferedReader(new InputStreamReader(addr2line.getInputStream())); stdout = new BufferedReader(new InputStreamReader(addr2line.getInputStream()));
} }
public Addr2line(String file) throws IOException { public Addr2line(String file) throws IOException {
this("addr2line", file); this("addr2line", file); //$NON-NLS-1$
} }
private void getOutput(String address) throws IOException { private void getOutput(String address) throws IOException {
if ( address.equals(lastaddr) == false ) { if ( address.equals(lastaddr) == false ) {
stdin.write(address + "\n"); stdin.write(address + "\n"); //$NON-NLS-1$
stdin.flush(); stdin.flush();
lastsymbol = stdout.readLine(); lastsymbol = stdout.readLine();
lastline = stdout.readLine(); lastline = stdout.readLine();
@ -92,7 +92,7 @@ public class Addr2line {
if (line != null) { if (line != null) {
int colon = line.lastIndexOf(':'); int colon = line.lastIndexOf(':');
String number = line.substring(colon + 1); String number = line.substring(colon + 1);
if (!number.startsWith("0")) { if (!number.startsWith("0")) { //$NON-NLS-1$
return Integer.parseInt(number); return Integer.parseInt(number);
} }
} }

View file

@ -27,11 +27,11 @@ public class CPPFilt {
} }
public CPPFilt() throws IOException { public CPPFilt() throws IOException {
this("c++filt"); this("c++filt"); //$NON-NLS-1$
} }
public String getFunction(String symbol) throws IOException { public String getFunction(String symbol) throws IOException {
stdin.write(symbol + "\n"); stdin.write(symbol + "\n"); //$NON-NLS-1$
stdin.flush(); stdin.flush();
String str = stdout.readLine(); String str = stdout.readLine();
if ( str != null ) { if ( str != null ) {

View file

@ -19,7 +19,7 @@ public class CygPath {
private BufferedWriter stdin; private BufferedWriter stdin;
public CygPath(String command) throws IOException { 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); cygpath = ProcessFactory.getFactory().exec(args);
//cppfilt = new Spawner(args); //cppfilt = new Spawner(args);
stdin = new BufferedWriter(new OutputStreamWriter(cygpath.getOutputStream())); stdin = new BufferedWriter(new OutputStreamWriter(cygpath.getOutputStream()));
@ -27,11 +27,11 @@ public class CygPath {
} }
public CygPath() throws IOException { public CygPath() throws IOException {
this("cygpath"); this("cygpath"); //$NON-NLS-1$
} }
public String getFileName(String name) throws IOException { public String getFileName(String name) throws IOException {
stdin.write(name + "\n"); stdin.write(name + "\n"); //$NON-NLS-1$
stdin.flush(); stdin.flush();
String str = stdout.readLine(); String str = stdout.readLine();
if ( str != null ) { if ( str != null ) {

View file

@ -43,9 +43,9 @@ public class CygwinToolsProvider extends ToolsProvider implements ICygwinToolsPr
public IPath getCygPathPath() { public IPath getCygPathPath() {
ICExtensionReference ref = getExtensionReference(); 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) { if (value == null || value.length() == 0) {
value = "cygpath"; //$NON-NLS-1 value = "cygpath"; //$NON-NLS-1$
} }
return new Path(value); return new Path(value);
} }

View file

@ -47,12 +47,12 @@ public class Objdump {
} }
public Objdump(String file) throws IOException { 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 { void init(String command, String[] params, String file) throws IOException {
if (params == null || params.length == 0) { 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 { } else {
args = new String[params.length + 1]; args = new String[params.length + 1];
args[0] = command; args[0] = command;

View file

@ -80,36 +80,36 @@ public class ToolsProvider implements IToolsProvider {
IPath getAddr2LinePath() { IPath getAddr2LinePath() {
ICExtensionReference ref = getExtensionReference(); 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) { if (value == null || value.length() == 0) {
value = "addr2line"; //$NON-NLS-1 value = "addr2line"; //$NON-NLS-1$
} }
return new Path(value); return new Path(value);
} }
IPath getObjdumpPath() { IPath getObjdumpPath() {
ICExtensionReference ref = getExtensionReference(); 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) { if (value == null || value.length() == 0) {
value = "objdump"; //$NON-NLS-1 value = "objdump"; //$NON-NLS-1$
} }
return new Path(value); return new Path(value);
} }
String getObjdumpArgs() { String getObjdumpArgs() {
ICExtensionReference ref = getExtensionReference(); 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) { if (value == null || value.length() == 0) {
value = ""; //$NON-NLS-1 value = ""; //$NON-NLS-1$
} }
return value; return value;
} }
IPath getCPPFiltPath() { IPath getCPPFiltPath() {
ICExtensionReference ref = getExtensionReference(); 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) { if (value == null || value.length() == 0) {
value = "c++filt"; //$NON-NLS-1 value = "c++filt"; //$NON-NLS-1$
} }
return new Path(value); return new Path(value);
} }

View file

@ -13,7 +13,7 @@ import java.util.List;
public class Coff { 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; FileHeader filehdr;
OptionalHeader opthdr; OptionalHeader opthdr;
RandomAccessFile rfile; RandomAccessFile rfile;
@ -78,19 +78,19 @@ public class Coff {
public String toString() { public String toString() {
StringBuffer buffer = new StringBuffer(); 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_magic = ").append(f_magic).append(NL); //$NON-NLS-1$
buffer.append("f_nscns = ").append(f_nscns).append(NL); 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(DateFormat.getDateInstance().format(new Date(f_timdat)));
buffer.append(NL); buffer.append(NL);
buffer.append("f_symptr = ").append(f_symptr).append(NL); buffer.append("f_symptr = ").append(f_symptr).append(NL); //$NON-NLS-1$
buffer.append("f_nsyms = ").append(f_nsyms).append(NL); buffer.append("f_nsyms = ").append(f_nsyms).append(NL); //$NON-NLS-1$
buffer.append("f_opthdr = ").append(f_opthdr).append(NL); buffer.append("f_opthdr = ").append(f_opthdr).append(NL); //$NON-NLS-1$
buffer.append("f_flags = ").append(f_flags).append(NL); buffer.append("f_flags = ").append(f_flags).append(NL); //$NON-NLS-1$
return buffer.toString(); return buffer.toString();
} }
} }
@ -128,15 +128,15 @@ public class Coff {
public String toString() { public String toString() {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
buffer.append("OPTIONAL HEADER VALUES").append(NL); buffer.append("OPTIONAL HEADER VALUES").append(NL); //$NON-NLS-1$
buffer.append("magic = ").append(magic).append(NL); buffer.append("magic = ").append(magic).append(NL); //$NON-NLS-1$
buffer.append("vstamp = ").append(vstamp).append(NL); buffer.append("vstamp = ").append(vstamp).append(NL); //$NON-NLS-1$
buffer.append("tsize = ").append(tsize).append(NL); buffer.append("tsize = ").append(tsize).append(NL); //$NON-NLS-1$
buffer.append("dsize = ").append(dsize).append(NL); buffer.append("dsize = ").append(dsize).append(NL); //$NON-NLS-1$
buffer.append("bsize = ").append(bsize).append(NL); buffer.append("bsize = ").append(bsize).append(NL); //$NON-NLS-1$
buffer.append("entry = ").append(entry).append(NL); buffer.append("entry = ").append(entry).append(NL); //$NON-NLS-1$
buffer.append("text_start = ").append(text_start).append(NL); buffer.append("text_start = ").append(text_start).append(NL); //$NON-NLS-1$
buffer.append("data_start = ").append(data_start).append(NL); buffer.append("data_start = ").append(data_start).append(NL); //$NON-NLS-1$
return buffer.toString(); return buffer.toString();
} }
} }
@ -146,11 +146,11 @@ public class Coff {
public final static int SCNHSZ = 40; public final static int SCNHSZ = 40;
/* names of "special" sections */ /* names of "special" sections */
public final static String _TEXT = ".text"; public final static String _TEXT = ".text"; //$NON-NLS-1$
public final static String _DATA = ".data"; public final static String _DATA = ".data"; //$NON-NLS-1$
public final static String _BSS = ".bss"; public final static String _BSS = ".bss"; //$NON-NLS-1$
public final static String _COMMENT = ".comment"; public final static String _COMMENT = ".comment"; //$NON-NLS-1$
public final static String _LIB = ".lib"; public final static String _LIB = ".lib"; //$NON-NLS-1$
/* s_flags "type". */ /* s_flags "type". */
public final static int STYP_REG = 0x0000; /* "regular": allocated, relocated, public final static int STYP_REG = 0x0000; /* "regular": allocated, relocated,
@ -256,17 +256,17 @@ public class Coff {
public String toString() { public String toString() {
StringBuffer buffer = new StringBuffer(); 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(new String(s_name)).append(NL);
buffer.append("s_paddr = ").append(s_paddr).append(NL); buffer.append("s_paddr = ").append(s_paddr).append(NL); //$NON-NLS-1$
buffer.append("s_vaddr = ").append(s_vaddr).append(NL); buffer.append("s_vaddr = ").append(s_vaddr).append(NL); //$NON-NLS-1$
buffer.append("s_size = ").append(s_size).append(NL); buffer.append("s_size = ").append(s_size).append(NL); //$NON-NLS-1$
buffer.append("s_scnptr = ").append(s_scnptr).append(NL); buffer.append("s_scnptr = ").append(s_scnptr).append(NL); //$NON-NLS-1$
buffer.append("s_relptr = ").append(s_relptr).append(NL); buffer.append("s_relptr = ").append(s_relptr).append(NL); //$NON-NLS-1$
buffer.append("s_lnnoptr = ").append(s_lnnoptr).append(NL); buffer.append("s_lnnoptr = ").append(s_lnnoptr).append(NL); //$NON-NLS-1$
buffer.append("s_nreloc = ").append(s_nreloc).append(NL); buffer.append("s_nreloc = ").append(s_nreloc).append(NL); //$NON-NLS-1$
buffer.append("s_nlnno = ").append(s_nlnno).append(NL); buffer.append("s_nlnno = ").append(s_nlnno).append(NL); //$NON-NLS-1$
buffer.append("s_flags = ").append(s_flags).append(NL); buffer.append("s_flags = ").append(s_flags).append(NL); //$NON-NLS-1$
///* ///*
try { try {
Reloc[] rcs = getRelocs(); Reloc[] rcs = getRelocs();
@ -310,9 +310,9 @@ public class Coff {
public String toString() { public String toString() {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
buffer.append("RELOC VALUES").append(NL); buffer.append("RELOC VALUES").append(NL); //$NON-NLS-1$
buffer.append("r_vaddr = ").append(r_vaddr); buffer.append("r_vaddr = ").append(r_vaddr); //$NON-NLS-1$
buffer.append(" r_symndx = ").append(r_symndx).append(NL); buffer.append(" r_symndx = ").append(r_symndx).append(NL); //$NON-NLS-1$
return buffer.toString(); return buffer.toString();
} }
} }
@ -339,10 +339,10 @@ public class Coff {
public String toString() { public String toString() {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
if (l_lnno == 0) { 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 { } else {
buffer.append("line# ").append(l_lnno); buffer.append("line# ").append(l_lnno); //$NON-NLS-1$
buffer.append(" at address = ").append(l_addr).append(NL); buffer.append(" at address = ").append(l_addr).append(NL); //$NON-NLS-1$
} }
return buffer.toString(); return buffer.toString();
} }
@ -400,7 +400,7 @@ public class Coff {
return new String(_n_name, 0, i); return new String(_n_name, 0, i);
} }
} }
return ""; return ""; //$NON-NLS-1$
} }
public String getName(byte[] table) { public String getName(byte[] table) {
@ -550,7 +550,7 @@ public class Coff {
} }
public Coff(String filename) throws IOException { 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 { public Coff(RandomAccessFile file, long offset) throws IOException {

View file

@ -9,7 +9,7 @@ import java.io.RandomAccessFile;
public class Exe { 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; protected RandomAccessFile rfile;
ExeHeader ehdr; ExeHeader ehdr;
@ -66,59 +66,59 @@ public class Exe {
public String toString() { public String toString() {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
buffer.append("EXE HEADER VALUES").append(NL); buffer.append("EXE HEADER VALUES").append(NL); //$NON-NLS-1$
buffer.append("signature "); buffer.append("signature "); //$NON-NLS-1$
buffer.append((char)e_signature[0] + " " + (char)e_signature[1]); buffer.append((char)e_signature[0] + " " + (char)e_signature[1]); //$NON-NLS-1$
buffer.append(NL); 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(Long.toHexString(new Short(e_lastsize).longValue()));
buffer.append(NL); 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(Long.toHexString(new Short(e_nblocks).longValue()));
buffer.append(NL); 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(Long.toHexString(new Short(e_nreloc).longValue()));
buffer.append(NL); 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(Long.toHexString(new Short(e_hdrsize).longValue()));
buffer.append(NL); 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(Long.toHexString(new Short(e_minalloc).longValue()));
buffer.append(NL); 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(Long.toHexString(new Short(e_maxalloc).longValue()));
buffer.append(NL); 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(Long.toHexString(new Short(e_ss).longValue()));
buffer.append(NL); 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(Long.toHexString(new Short(e_sp).longValue()));
buffer.append(NL); 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(Long.toHexString(new Short(e_checksum).longValue()));
buffer.append(NL); 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(Long.toHexString(new Short(e_ip).longValue()));
buffer.append(NL); 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(Long.toHexString(new Short(e_cs).longValue()));
buffer.append(NL); 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(Long.toHexString(new Short(e_relocoffs).longValue()));
buffer.append(NL); 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(Long.toHexString(new Short(e_noverlay).longValue()));
buffer.append(NL); buffer.append(NL);
return buffer.toString(); return buffer.toString();
@ -137,7 +137,7 @@ public class Exe {
} }
public Exe(String file) throws IOException { public Exe(String file) throws IOException {
rfile = new RandomAccessFile(file, "r"); rfile = new RandomAccessFile(file, "r"); //$NON-NLS-1$
try { try {
ehdr = new ExeHeader(rfile); ehdr = new ExeHeader(rfile);
} finally { } finally {

View file

@ -53,7 +53,7 @@ import org.eclipse.cdt.utils.coff.Exe.ExeHeader;
*/ */
public class PE { 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; RandomAccessFile rfile;
String filename; String filename;
ExeHeader exeHeader; ExeHeader exeHeader;
@ -129,8 +129,8 @@ public class PE {
public String toString() { public String toString() {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
buffer.append("DOS STUB VALUES").append(NL); buffer.append("DOS STUB VALUES").append(NL); //$NON-NLS-1$
buffer.append("e_lfanew = ").append(e_lfanew).append(NL); buffer.append("e_lfanew = ").append(e_lfanew).append(NL); //$NON-NLS-1$
buffer.append(new String(dos_message)).append(NL); buffer.append(new String(dos_message)).append(NL);
return buffer.toString(); return buffer.toString();
} }
@ -195,28 +195,28 @@ public class PE {
public String toString() { public String toString() {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
buffer.append("NT OPTIONAL HEADER VALUES").append(NL); buffer.append("NT OPTIONAL HEADER VALUES").append(NL); //$NON-NLS-1$
buffer.append("ImageBase = ").append(ImageBase).append(NL); buffer.append("ImageBase = ").append(ImageBase).append(NL); //$NON-NLS-1$
buffer.append("SexctionAlignement = ").append(SectionAlignment).append(NL); buffer.append("SexctionAlignement = ").append(SectionAlignment).append(NL); //$NON-NLS-1$
buffer.append("FileAlignment = ").append(FileAlignment).append(NL); buffer.append("FileAlignment = ").append(FileAlignment).append(NL); //$NON-NLS-1$
buffer.append("MajorOSVersion = ").append(MajorOperatingSystemVersion).append(NL); buffer.append("MajorOSVersion = ").append(MajorOperatingSystemVersion).append(NL); //$NON-NLS-1$
buffer.append("MinorOSVersion = ").append(MinorOperatingSystemVersion).append(NL); buffer.append("MinorOSVersion = ").append(MinorOperatingSystemVersion).append(NL); //$NON-NLS-1$
buffer.append("MajorImageVersion = ").append(MajorImageVersion).append(NL); buffer.append("MajorImageVersion = ").append(MajorImageVersion).append(NL); //$NON-NLS-1$
buffer.append("MinorImageVersion = ").append(MinorImageVersion).append(NL); buffer.append("MinorImageVersion = ").append(MinorImageVersion).append(NL); //$NON-NLS-1$
buffer.append("MajorSubVersion = ").append(MajorSubsystemVersion).append(NL); buffer.append("MajorSubVersion = ").append(MajorSubsystemVersion).append(NL); //$NON-NLS-1$
buffer.append("MinorSubVersion = ").append(MinorSubsystemVersion).append(NL); buffer.append("MinorSubVersion = ").append(MinorSubsystemVersion).append(NL); //$NON-NLS-1$
buffer.append("Reserved = ").append(Reserved).append(NL); buffer.append("Reserved = ").append(Reserved).append(NL); //$NON-NLS-1$
buffer.append("SizeOfImage = ").append(SizeOfImage).append(NL); buffer.append("SizeOfImage = ").append(SizeOfImage).append(NL); //$NON-NLS-1$
buffer.append("SizeOfHeaders = ").append(SizeOfHeaders).append(NL); buffer.append("SizeOfHeaders = ").append(SizeOfHeaders).append(NL); //$NON-NLS-1$
buffer.append("CheckSum = ").append(CheckSum).append(NL); buffer.append("CheckSum = ").append(CheckSum).append(NL); //$NON-NLS-1$
buffer.append("Subsystem = ").append(Subsystem).append(NL); buffer.append("Subsystem = ").append(Subsystem).append(NL); //$NON-NLS-1$
buffer.append("DLL = ").append(DLLCharacteristics).append(NL); buffer.append("DLL = ").append(DLLCharacteristics).append(NL); //$NON-NLS-1$
buffer.append("StackReserve = ").append(SizeOfStackReserve).append(NL); buffer.append("StackReserve = ").append(SizeOfStackReserve).append(NL); //$NON-NLS-1$
buffer.append("StackCommit = ").append(SizeOfStackCommit).append(NL); buffer.append("StackCommit = ").append(SizeOfStackCommit).append(NL); //$NON-NLS-1$
buffer.append("HeapReserve = ").append(SizeOfHeapReserve).append(NL); buffer.append("HeapReserve = ").append(SizeOfHeapReserve).append(NL); //$NON-NLS-1$
buffer.append("HeapCommit = ").append(SizeOfHeapCommit).append(NL); buffer.append("HeapCommit = ").append(SizeOfHeapCommit).append(NL); //$NON-NLS-1$
buffer.append("LoaderFlags = ").append(LoaderFlags).append(NL);; buffer.append("LoaderFlags = ").append(LoaderFlags).append(NL);; //$NON-NLS-1$
buffer.append("#Rva size = ").append(NumberOfRvaAndSizes).append(NL); buffer.append("#Rva size = ").append(NumberOfRvaAndSizes).append(NL); //$NON-NLS-1$
return buffer.toString(); return buffer.toString();
} }
} }
@ -232,8 +232,8 @@ public class PE {
public String toString() { public String toString() {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
buffer.append("rva = ").append(rva).append(" "); buffer.append("rva = ").append(rva).append(" "); //$NON-NLS-1$ //$NON-NLS-2$
buffer.append("size = ").append(size).append(NL); buffer.append("size = ").append(size).append(NL); //$NON-NLS-1$
return buffer.toString(); return buffer.toString();
} }
} }
@ -264,11 +264,11 @@ public class PE {
public String toString() { public String toString() {
StringBuffer buffer = new StringBuffer(); StringBuffer buffer = new StringBuffer();
buffer.append("rva = ").append(rva); buffer.append("rva = ").append(rva); //$NON-NLS-1$
buffer.append(" timestamp = ").append(timestamp); buffer.append(" timestamp = ").append(timestamp); //$NON-NLS-1$
buffer.append(" forwarder = ").append(forwarder); buffer.append(" forwarder = ").append(forwarder); //$NON-NLS-1$
buffer.append(" name = ").append(name); buffer.append(" name = ").append(name); //$NON-NLS-1$
buffer.append(" thunk = ").append(thunk).append(NL); buffer.append(" thunk = ").append(thunk).append(NL); //$NON-NLS-1$
return buffer.toString(); return buffer.toString();
} }
} }
@ -283,7 +283,7 @@ public class PE {
public PE (String filename, long pos, boolean filter) throws IOException { public PE (String filename, long pos, boolean filter) throws IOException {
try { try {
rfile = new RandomAccessFile(filename, "r"); rfile = new RandomAccessFile(filename, "r"); //$NON-NLS-1$
this.filename = filename; this.filename = filename;
rfile.seek(pos); rfile.seek(pos);
@ -349,55 +349,55 @@ public class PE {
// Machine type. // Machine type.
switch (filhdr.f_magic) { switch (filhdr.f_magic) {
case PEConstants.IMAGE_FILE_MACHINE_UNKNOWN: case PEConstants.IMAGE_FILE_MACHINE_UNKNOWN:
attrib.cpu = "none"; attrib.cpu = "none"; //$NON-NLS-1$
break; break;
case PEConstants.IMAGE_FILE_MACHINE_ALPHA: case PEConstants.IMAGE_FILE_MACHINE_ALPHA:
attrib.cpu = "alpha"; attrib.cpu = "alpha"; //$NON-NLS-1$
break; break;
case PEConstants.IMAGE_FILE_MACHINE_ARM: case PEConstants.IMAGE_FILE_MACHINE_ARM:
attrib.cpu = "arm"; attrib.cpu = "arm"; //$NON-NLS-1$
break; break;
case PEConstants.IMAGE_FILE_MACHINE_ALPHA64: case PEConstants.IMAGE_FILE_MACHINE_ALPHA64:
attrib.cpu = "arm64"; attrib.cpu = "arm64"; //$NON-NLS-1$
break; break;
case PEConstants.IMAGE_FILE_MACHINE_I386: case PEConstants.IMAGE_FILE_MACHINE_I386:
attrib.cpu = "x86"; attrib.cpu = "x86"; //$NON-NLS-1$
break; break;
case PEConstants.IMAGE_FILE_MACHINE_IA64: case PEConstants.IMAGE_FILE_MACHINE_IA64:
attrib.cpu = "ia64"; attrib.cpu = "ia64"; //$NON-NLS-1$
break; break;
case PEConstants.IMAGE_FILE_MACHINE_M68K: case PEConstants.IMAGE_FILE_MACHINE_M68K:
attrib.cpu = "m68k"; attrib.cpu = "m68k"; //$NON-NLS-1$
break; break;
case PEConstants.IMAGE_FILE_MACHINE_MIPS16: case PEConstants.IMAGE_FILE_MACHINE_MIPS16:
attrib.cpu = "mips16"; attrib.cpu = "mips16"; //$NON-NLS-1$
break; break;
case PEConstants.IMAGE_FILE_MACHINE_MIPSFPU: case PEConstants.IMAGE_FILE_MACHINE_MIPSFPU:
attrib.cpu = "mipsfpu"; attrib.cpu = "mipsfpu"; //$NON-NLS-1$
break; break;
case PEConstants.IMAGE_FILE_MACHINE_MIPSFPU16: case PEConstants.IMAGE_FILE_MACHINE_MIPSFPU16:
attrib.cpu = "mipsfpu16"; attrib.cpu = "mipsfpu16"; //$NON-NLS-1$
break; break;
case PEConstants.IMAGE_FILE_MACHINE_POWERPC: case PEConstants.IMAGE_FILE_MACHINE_POWERPC:
attrib.cpu = "powerpc"; attrib.cpu = "powerpc"; //$NON-NLS-1$
break; break;
case PEConstants.IMAGE_FILE_MACHINE_R3000: case PEConstants.IMAGE_FILE_MACHINE_R3000:
attrib.cpu = "r3000"; attrib.cpu = "r3000"; //$NON-NLS-1$
break; break;
case PEConstants.IMAGE_FILE_MACHINE_R4000: case PEConstants.IMAGE_FILE_MACHINE_R4000:
attrib.cpu = "r4000"; attrib.cpu = "r4000"; //$NON-NLS-1$
break; break;
case PEConstants.IMAGE_FILE_MACHINE_R10000: case PEConstants.IMAGE_FILE_MACHINE_R10000:
attrib.cpu = "r10000"; attrib.cpu = "r10000"; //$NON-NLS-1$
break; break;
case PEConstants.IMAGE_FILE_MACHINE_SH3: case PEConstants.IMAGE_FILE_MACHINE_SH3:
attrib.cpu = "sh3"; attrib.cpu = "sh3"; //$NON-NLS-1$
break; break;
case PEConstants.IMAGE_FILE_MACHINE_SH4: case PEConstants.IMAGE_FILE_MACHINE_SH4:
attrib.cpu = "sh4"; attrib.cpu = "sh4"; //$NON-NLS-1$
break; break;
case PEConstants.IMAGE_FILE_MACHINE_THUMB: case PEConstants.IMAGE_FILE_MACHINE_THUMB:
attrib.cpu = "thumb"; attrib.cpu = "thumb"; //$NON-NLS-1$
break; break;
} }
@ -583,8 +583,8 @@ public class PE {
try { try {
ImageDataDirectory[] dirs = getImageDataDirectories(); ImageDataDirectory[] dirs = getImageDataDirectories();
for (int i = 0; i < dirs.length; i++) { for (int i = 0; i < dirs.length; i++) {
buffer.append("Entry ").append(i); buffer.append("Entry ").append(i); //$NON-NLS-1$
buffer.append(" ").append(dirs[i]); buffer.append(" ").append(dirs[i]); //$NON-NLS-1$
} }
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
@ -622,7 +622,7 @@ public class PE {
RandomAccessFile getRandomAccessFile () throws IOException { RandomAccessFile getRandomAccessFile () throws IOException {
if (rfile == null) { if (rfile == null) {
rfile = new RandomAccessFile(filename, "r"); rfile = new RandomAccessFile(filename, "r"); //$NON-NLS-1$
} }
return rfile; return rfile;
} }

View file

@ -222,9 +222,9 @@ public class PEArchive {
*/ */
public PEArchive(String filename) throws IOException { public PEArchive(String filename) throws IOException {
this.filename = filename; this.filename = filename;
rfile = new RandomAccessFile(filename, "r"); rfile = new RandomAccessFile(filename, "r"); //$NON-NLS-1$
String hdr = rfile.readLine(); String hdr = rfile.readLine();
if (hdr == null || hdr.compareTo("!<arch>") != 0) { if (hdr == null || hdr.compareTo("!<arch>") != 0) { //$NON-NLS-1$
rfile.close(); rfile.close();
throw new IOException("Not a valid archive file."); 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 the name is "//" then this is the string table section.
// //
if (name.compareTo("//") == 0) if (name.compareTo("//") == 0) //$NON-NLS-1$
strtbl_pos = pos; strtbl_pos = pos;
// //
@ -306,14 +306,14 @@ public class PEArchive {
if (names != null && !stringInStrings(object_name, names)) if (names != null && !stringInStrings(object_name, names))
continue; continue;
object_name = "" + count + "_" + object_name; object_name = "" + count + "_" + object_name; //$NON-NLS-1$ //$NON-NLS-2$
count++; count++;
byte[] data = headers[i].getObjectData(); byte[] data = headers[i].getObjectData();
File output = new File(outdir, object_name); File output = new File(outdir, object_name);
names_used.add(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.write(data);
rfile.close(); rfile.close();
} }

View file

@ -59,7 +59,7 @@ public class ARMember extends BinaryObject {
if (header != null) { if (header != null) {
return header.getObjectName(); return header.getObjectName();
} }
return ""; return ""; //$NON-NLS-1$
} }
protected PE getPE() throws IOException { protected PE getPE() throws IOException {

View file

@ -96,7 +96,7 @@ public class BinaryObject extends BinaryFile implements IBinaryObject {
if (attr != null) { if (attr != null) {
return attribute.getCPU(); 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() * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryShared#getSoName()
*/ */
public String getSoName() { public String getSoName() {
return ""; return ""; //$NON-NLS-1$
} }
protected PE getPE() throws IOException { protected PE getPE() throws IOException {
@ -262,7 +262,7 @@ public class BinaryObject extends BinaryFile implements IBinaryObject {
try { try {
String filename = addr2line.getFileName(sym.addr); String filename = addr2line.getFileName(sym.addr);
// Addr2line returns the funny "??" when it can not find the file. // 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; filename = null;
} }

View file

@ -38,7 +38,7 @@ public class BinaryShared extends BinaryExecutable implements IBinaryShared {
if (soname != null) { if (soname != null) {
return soname; return soname;
} }
return ""; return ""; //$NON-NLS-1$
} }
/** /**

View file

@ -40,7 +40,7 @@ public class CygwinPEParser extends PEParser implements IBinaryParser, ICygwinTo
* @see org.eclipse.cdt.core.model.IBinaryParser#getFormat() * @see org.eclipse.cdt.core.model.IBinaryParser#getFormat()
*/ */
public String getFormat() { public String getFormat() {
return "Cygwin PE"; return "Cygwin PE"; //$NON-NLS-1$
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -69,7 +69,7 @@ public class PEParser extends AbstractCExtension implements IBinaryParser {
* @see org.eclipse.cdt.core.model.IBinaryParser#getFormat() * @see org.eclipse.cdt.core.model.IBinaryParser#getFormat()
*/ */
public String getFormat() { public String getFormat() {
return "PE"; return "PE"; //$NON-NLS-1$
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -135,7 +135,7 @@ public class Symbol implements ISymbol {
stopAddr2Line(); stopAddr2Line();
} }
}; };
new Thread(worker, "Addr2line Reaper").start(); new Thread(worker, "Addr2line Reaper").start(); //$NON-NLS-1$
} }
} else { } else {
timestamp = System.currentTimeMillis(); timestamp = System.currentTimeMillis();

View file

@ -31,7 +31,7 @@ public class DebugType {
int size = arrayType.getSize(); int size = arrayType.getSize();
DebugType type = arrayType.getComponentType(); DebugType type = arrayType.getComponentType();
sb.append(type.toString()); sb.append(type.toString());
sb.append(" [").append(size).append(']'); sb.append(" [").append(size).append(']'); //$NON-NLS-1$
} else if (this instanceof DebugDerivedType) { } else if (this instanceof DebugDerivedType) {
DebugDerivedType derived = (DebugDerivedType)this; DebugDerivedType derived = (DebugDerivedType)this;
DebugType component = derived.getComponentType(); DebugType component = derived.getComponentType();
@ -42,9 +42,9 @@ public class DebugType {
sb.append(component.toString()); sb.append(component.toString());
} }
if (this instanceof DebugPointerType) { if (this instanceof DebugPointerType) {
sb.append(" *"); sb.append(" *"); //$NON-NLS-1$
} else if (this instanceof DebugReferenceType) { } else if (this instanceof DebugReferenceType) {
sb.append(" &"); sb.append(" &"); //$NON-NLS-1$
} else if (this instanceof DebugCrossRefType && component == null) { } else if (this instanceof DebugCrossRefType && component == null) {
DebugCrossRefType crossRef = (DebugCrossRefType)this; DebugCrossRefType crossRef = (DebugCrossRefType)this;
sb.append(crossRef.getCrossRefName()); sb.append(crossRef.getCrossRefName());
@ -58,27 +58,27 @@ public class DebugType {
DebugFunctionType function = (DebugFunctionType)this; DebugFunctionType function = (DebugFunctionType)this;
DebugType type = function.getReturnType(); DebugType type = function.getReturnType();
sb.append(type.toString()); sb.append(type.toString());
sb.append(" (*())"); sb.append(" (*())"); //$NON-NLS-1$
} else if (this instanceof DebugEnumType) { } else if (this instanceof DebugEnumType) {
DebugEnumType enum = (DebugEnumType)this; DebugEnumType enum = (DebugEnumType)this;
DebugEnumField[] fields = enum.getDebugEnumFields(); 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++) { for (int i = 0; i < fields.length; i++) {
if (i > 0) { if (i > 0) {
sb.append(','); sb.append(',');
} }
sb.append(' ').append(fields[i].getName()); 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) { } else if (this instanceof DebugStructType) {
DebugStructType struct = (DebugStructType)this; DebugStructType struct = (DebugStructType)this;
if (struct.isUnion()) { if (struct.isUnion()) {
sb.append("union "); sb.append("union "); //$NON-NLS-1$
} else { } 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(); DebugField[] fields = struct.getDebugFields();
for (int i = 0; i < fields.length; i++) { for (int i = 0; i < fields.length; i++) {
if (i > 0) { if (i > 0) {
@ -87,7 +87,7 @@ public class DebugType {
sb.append(' ').append(fields[i].getDebugType()); sb.append(' ').append(fields[i].getDebugType());
sb.append(' ').append(fields[i].getName()); sb.append(' ').append(fields[i].getName());
} }
sb.append(" }"); sb.append(" }"); //$NON-NLS-1$
} else if (this instanceof DebugUnknownType) { } else if (this instanceof DebugUnknownType) {
DebugUnknownType unknown = (DebugUnknownType)this; DebugUnknownType unknown = (DebugUnknownType)this;
sb.append(unknown.getName()); sb.append(unknown.getName());

View file

@ -30,20 +30,20 @@ import org.eclipse.cdt.utils.elf.Elf;
public class Dwarf { public class Dwarf {
/* Section names. */ /* Section names. */
final static String DWARF_DEBUG_INFO = ".debug_info"; final static String DWARF_DEBUG_INFO = ".debug_info"; //$NON-NLS-1$
final static String DWARF_DEBUG_ABBREV = ".debug_abbrev"; final static String DWARF_DEBUG_ABBREV = ".debug_abbrev"; //$NON-NLS-1$
final static String DWARF_DEBUG_ARANGES = ".debug_aranges"; final static String DWARF_DEBUG_ARANGES = ".debug_aranges"; //$NON-NLS-1$
final static String DWARF_DEBUG_LINE = ".debug_line"; final static String DWARF_DEBUG_LINE = ".debug_line"; //$NON-NLS-1$
final static String DWARF_DEBUG_FRAME = ".debug_frame"; final static String DWARF_DEBUG_FRAME = ".debug_frame"; //$NON-NLS-1$
final static String DWARF_EH_FRAME = ".eh_frame"; final static String DWARF_EH_FRAME = ".eh_frame"; //$NON-NLS-1$
final static String DWARF_DEBUG_LOC = ".debug_loc"; final static String DWARF_DEBUG_LOC = ".debug_loc"; //$NON-NLS-1$
final static String DWARF_DEBUG_PUBNAMES = ".debug_pubnames"; final static String DWARF_DEBUG_PUBNAMES = ".debug_pubnames"; //$NON-NLS-1$
final static String DWARF_DEBUG_STR = ".debug_str"; final static String DWARF_DEBUG_STR = ".debug_str"; //$NON-NLS-1$
final static String DWARF_DEBUG_FUNCNAMES = ".debug_funcnames"; final static String DWARF_DEBUG_FUNCNAMES = ".debug_funcnames"; //$NON-NLS-1$
final static String DWARF_DEBUG_TYPENAMES = ".debug_typenames"; final static String DWARF_DEBUG_TYPENAMES = ".debug_typenames"; //$NON-NLS-1$
final static String DWARF_DEBUG_VARNAMES = ".debug_varnames"; final static String DWARF_DEBUG_VARNAMES = ".debug_varnames"; //$NON-NLS-1$
final static String DWARF_DEBUG_WEAKNAMES = ".debug_weaknames"; final static String DWARF_DEBUG_WEAKNAMES = ".debug_weaknames"; //$NON-NLS-1$
final static String DWARF_DEBUG_MACINFO = ".debug_macinfo"; final static String DWARF_DEBUG_MACINFO = ".debug_macinfo"; //$NON-NLS-1$
final static String[] DWARF_SCNNAMES = final static String[] DWARF_SCNNAMES =
{ {
DWARF_DEBUG_INFO, DWARF_DEBUG_INFO,
@ -68,10 +68,10 @@ public class Dwarf {
byte addressSize; byte addressSize;
public String toString() { public String toString() {
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
sb.append("Length: " + length).append("\n"); sb.append("Length: " + length).append("\n"); //$NON-NLS-1$ //$NON-NLS-2$
sb.append("Version: " + version).append("\n"); sb.append("Version: " + version).append("\n"); //$NON-NLS-1$ //$NON-NLS-2$
sb.append("Abbreviation: " + abbreviationOffset).append("\n"); sb.append("Abbreviation: " + abbreviationOffset).append("\n"); //$NON-NLS-1$ //$NON-NLS-2$
sb.append("Address size: " + addressSize).append("\n"); sb.append("Address size: " + addressSize).append("\n"); //$NON-NLS-1$ //$NON-NLS-2$
return sb.toString(); return sb.toString();
} }
} }
@ -102,8 +102,8 @@ public class Dwarf {
} }
public String toString() { public String toString() {
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
sb.append("name: " + Long.toHexString(name)); sb.append("name: " + Long.toHexString(name)); //$NON-NLS-1$
sb.append(" value: " + Long.toHexString(form)); sb.append(" value: " + Long.toHexString(form)); //$NON-NLS-1$
return sb.toString(); return sb.toString();
} }
} }
@ -340,7 +340,7 @@ public class Dwarf {
header.abbreviationOffset = read_4_bytes(data, offset + 6); header.abbreviationOffset = read_4_bytes(data, offset + 6);
header.addressSize = data[offset + 10]; 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); System.out.println(header);
// read the abbrev section. // read the abbrev section.
@ -562,7 +562,7 @@ public class Dwarf {
void processDebugInfoEntry(IDebugEntryRequestor requestor, AbbreviationEntry entry, List list) { void processDebugInfoEntry(IDebugEntryRequestor requestor, AbbreviationEntry entry, List list) {
int len = list.size(); int len = list.size();
int tag = (int) entry.tag; 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++) { for (int i = 0; i < len; i++) {
AttributeValue av = (AttributeValue) list.get(i); AttributeValue av = (AttributeValue) list.get(i);
System.out.println(av); System.out.println(av);
@ -656,7 +656,7 @@ public class Dwarf {
void processSubProgram(IDebugEntryRequestor requestor, List list) { void processSubProgram(IDebugEntryRequestor requestor, List list) {
long lowPC = 0; long lowPC = 0;
long highPC = 0; long highPC = 0;
String funcName = ""; String funcName = ""; //$NON-NLS-1$
boolean isExtern = false; boolean isExtern = false;
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
@ -683,7 +683,7 @@ public class Dwarf {
} catch (ClassCastException e) { } catch (ClassCastException e) {
} }
} }
requestor.enterFunction(funcName, new DebugUnknownType(""), isExtern, lowPC); requestor.enterFunction(funcName, new DebugUnknownType(""), isExtern, lowPC); //$NON-NLS-1$
requestor.exitFunction(highPC); requestor.exitFunction(highPC);
} }

View file

@ -64,94 +64,94 @@ public final class StabConstant {
public static String type2String(int t) { public static String type2String(int t) {
switch (t) { switch (t) {
case N_UNDF : case N_UNDF :
return "UNDF"; return "UNDF"; //$NON-NLS-1$
case N_GSYM : case N_GSYM :
return "GSYM"; return "GSYM"; //$NON-NLS-1$
case N_FNAME : case N_FNAME :
return "FNAME"; return "FNAME"; //$NON-NLS-1$
case N_FUN : case N_FUN :
return "FUN"; return "FUN"; //$NON-NLS-1$
case N_STSYM : case N_STSYM :
return "STSYM"; return "STSYM"; //$NON-NLS-1$
case N_LCSYM : case N_LCSYM :
return "LCSYM"; return "LCSYM"; //$NON-NLS-1$
case N_MAIN : case N_MAIN :
return "MAIN"; return "MAIN"; //$NON-NLS-1$
case N_ROSYM : case N_ROSYM :
return "ROSYM"; return "ROSYM"; //$NON-NLS-1$
case N_PC : case N_PC :
return "PC"; return "PC"; //$NON-NLS-1$
case N_NSYMS : case N_NSYMS :
return "SSYMS"; return "SSYMS"; //$NON-NLS-1$
case N_NOMAP : case N_NOMAP :
return "NOMAP"; return "NOMAP"; //$NON-NLS-1$
case N_OBJ : case N_OBJ :
return "OBJ"; return "OBJ"; //$NON-NLS-1$
case N_OPT : case N_OPT :
return "OPT"; return "OPT"; //$NON-NLS-1$
case N_RSYM : case N_RSYM :
return "RSYM"; return "RSYM"; //$NON-NLS-1$
case N_M2C : case N_M2C :
return "M2C"; return "M2C"; //$NON-NLS-1$
case N_SLINE : case N_SLINE :
return "SLINE"; return "SLINE"; //$NON-NLS-1$
case N_DSLINE : case N_DSLINE :
return "DSLINE"; return "DSLINE"; //$NON-NLS-1$
case N_BSLINE : case N_BSLINE :
return "BSLINE"; return "BSLINE"; //$NON-NLS-1$
case N_DEFD : case N_DEFD :
return "DEFD"; return "DEFD"; //$NON-NLS-1$
case N_FLINE : case N_FLINE :
return "FLINE"; return "FLINE"; //$NON-NLS-1$
case N_EHDECL : case N_EHDECL :
return "EHDECL"; return "EHDECL"; //$NON-NLS-1$
case N_CATCH : case N_CATCH :
return "CATCH"; return "CATCH"; //$NON-NLS-1$
case N_SSYM : case N_SSYM :
return "SSYM"; return "SSYM"; //$NON-NLS-1$
case N_ENDM : case N_ENDM :
return "ENDM"; return "ENDM"; //$NON-NLS-1$
case N_SO : case N_SO :
return "SO"; return "SO"; //$NON-NLS-1$
case N_LSYM : case N_LSYM :
return "LSYM"; return "LSYM"; //$NON-NLS-1$
case N_BINCL : case N_BINCL :
return "BINCL"; return "BINCL"; //$NON-NLS-1$
case N_SOL : case N_SOL :
return "SOL"; return "SOL"; //$NON-NLS-1$
case N_PSYM : case N_PSYM :
return "PSYM"; return "PSYM"; //$NON-NLS-1$
case N_EINCL : case N_EINCL :
return "EINCL"; return "EINCL"; //$NON-NLS-1$
case N_ENTRY : case N_ENTRY :
return "ENTRY"; return "ENTRY"; //$NON-NLS-1$
case N_LBRAC : case N_LBRAC :
return "LBRAC"; return "LBRAC"; //$NON-NLS-1$
case N_EXCL : case N_EXCL :
return "EXCL"; return "EXCL"; //$NON-NLS-1$
case N_SCOPE: case N_SCOPE:
return "SCOPE"; return "SCOPE"; //$NON-NLS-1$
case N_RBRAC : case N_RBRAC :
return "RBRAC"; return "RBRAC"; //$NON-NLS-1$
case N_BCOMM : case N_BCOMM :
return "COMM"; return "COMM"; //$NON-NLS-1$
case N_ECOMM : case N_ECOMM :
return "ECOMM"; return "ECOMM"; //$NON-NLS-1$
case N_ECOML : case N_ECOML :
return "ECOML"; return "ECOML"; //$NON-NLS-1$
case N_WITH : case N_WITH :
return "WITH"; return "WITH"; //$NON-NLS-1$
case N_NBTEXT : case N_NBTEXT :
return "NBTEXT"; return "NBTEXT"; //$NON-NLS-1$
case N_NBDATA : case N_NBDATA :
return "NBDATA"; return "NBDATA"; //$NON-NLS-1$
case N_NBBSS : case N_NBBSS :
return "NBBSS"; return "NBBSS"; //$NON-NLS-1$
case N_NBSTS : case N_NBSTS :
return "NBSTS"; return "NBSTS"; //$NON-NLS-1$
case N_NBLCS : case N_NBLCS :
return "NBLCS"; return "NBLCS"; //$NON-NLS-1$
} }
return "" + t; return "" + t; //$NON-NLS-1$
} }
} }

View file

@ -39,9 +39,9 @@ import org.eclipse.cdt.utils.elf.Elf;
public class Stabs { public class Stabs {
final static String LLLOW = "01000000000000000000000"; final static String LLLOW = "01000000000000000000000"; //$NON-NLS-1$
final static String LLHIGH = "0777777777777777777777"; final static String LLHIGH = "0777777777777777777777"; //$NON-NLS-1$
final static String ULLHIGH = "01777777777777777777777"; final static String ULLHIGH = "01777777777777777777777"; //$NON-NLS-1$
byte[] stabData; byte[] stabData;
byte[] stabstrData; byte[] stabstrData;
@ -55,7 +55,7 @@ public class Stabs {
String currentFile; String currentFile;
Map mapTypes = new HashMap(); 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 { public Stabs(String file) throws IOException {
Elf exe = new Elf(file); Elf exe = new Elf(file);
@ -77,9 +77,9 @@ public class Stabs {
Elf.Section[] sections = exe.getSections(); Elf.Section[] sections = exe.getSections();
for (int i = 0; i < sections.length; i++) { for (int i = 0; i < sections.length; i++) {
String name = sections[i].toString(); String name = sections[i].toString();
if (name.equals(".stab")) { if (name.equals(".stab")) { //$NON-NLS-1$
data = sections[i].loadSectionData(); data = sections[i].loadSectionData();
} else if (name.equals(".stabstr")) { } else if (name.equals(".stabstr")) { //$NON-NLS-1$
stabstr = sections[i].loadSectionData(); stabstr = sections[i].loadSectionData();
} }
} }
@ -163,7 +163,7 @@ public class Stabs {
// According to the spec all the other fields are duplicated so we // According to the spec all the other fields are duplicated so we
// still have the data. // still have the data.
// From the spec continuation line on AIX is '?' // 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); field = field.substring(0, field.length() - 1);
if (holder == null) { if (holder == null) {
holder = field; holder = field;
@ -215,7 +215,7 @@ public class Stabs {
} }
// Start a new Function // Start a new Function
if (field.length() == 0) { if (field.length() == 0) {
field = " anon "; field = " anon "; //$NON-NLS-1$
} }
inFunction = true; inFunction = true;
parseStabString(requestor, field, value); parseStabString(requestor, field, value);
@ -278,7 +278,7 @@ public class Stabs {
if (field != null && field.length() > 0) { if (field != null && field.length() > 0) {
// if it ends with "/" do not call the entering yet // if it ends with "/" do not call the entering yet
// we have to concatenate the next one. // we have to concatenate the next one.
if (field.endsWith("/")) { if (field.endsWith("/")) { //$NON-NLS-1$
currentFile = field; currentFile = field;
} else { } else {
if (currentFile != null) { if (currentFile != null) {
@ -314,7 +314,7 @@ public class Stabs {
String information = sf.getTypeInformation(); String information = sf.getTypeInformation();
String paramName = sf.getName(); String paramName = sf.getName();
DebugParameterKind paramKind = DebugParameterKind.REGISTER_REFERENCE; DebugParameterKind paramKind = DebugParameterKind.REGISTER_REFERENCE;
DebugType paramType = parseStabType("", information); DebugType paramType = parseStabType("", information); //$NON-NLS-1$
requestor.acceptParameter(paramName, paramType, paramKind, value); requestor.acceptParameter(paramName, paramType, paramKind, value);
} }
break; break;
@ -339,7 +339,7 @@ public class Stabs {
{ {
String excName = sf.getName(); String excName = sf.getName();
String information = sf.getTypeInformation(); String information = sf.getTypeInformation();
DebugType excType = parseStabType("", information); DebugType excType = parseStabType("", information); //$NON-NLS-1$
requestor.acceptCaughtException(excName, excType, value); requestor.acceptCaughtException(excName, excType, value);
} }
break; break;
@ -351,7 +351,7 @@ public class Stabs {
{ {
String funcName = sf.getName(); String funcName = sf.getName();
String funcInfo = sf.getTypeInformation(); String funcInfo = sf.getTypeInformation();
DebugType funcType = parseStabType("", funcInfo); DebugType funcType = parseStabType("", funcInfo); //$NON-NLS-1$
boolean funcGlobal = sf.getSymbolDescriptor() == 'F'; boolean funcGlobal = sf.getSymbolDescriptor() == 'F';
requestor.enterFunction(funcName, funcType, funcGlobal, value); requestor.enterFunction(funcName, funcType, funcGlobal, value);
} }
@ -362,7 +362,7 @@ public class Stabs {
String varName = sf.getName(); String varName = sf.getName();
String varInfo = sf.getTypeInformation(); String varInfo = sf.getTypeInformation();
DebugVariableKind varKind = DebugVariableKind.GLOBAL; DebugVariableKind varKind = DebugVariableKind.GLOBAL;
DebugType varType = parseStabType("", varInfo); DebugType varType = parseStabType("", varInfo); //$NON-NLS-1$
requestor.acceptVariable(varName, varType, varKind, value); requestor.acceptVariable(varName, varType, varKind, value);
} }
break; break;
@ -389,7 +389,7 @@ public class Stabs {
String paramName = sf.getName(); String paramName = sf.getName();
String paramInfo = sf.getTypeInformation(); String paramInfo = sf.getTypeInformation();
DebugParameterKind paramKind = DebugParameterKind.STACK; DebugParameterKind paramKind = DebugParameterKind.STACK;
DebugType paramType = parseStabType("", paramInfo); DebugType paramType = parseStabType("", paramInfo); //$NON-NLS-1$
requestor.acceptParameter(paramName, paramType, paramKind, value); requestor.acceptParameter(paramName, paramType, paramKind, value);
} }
break; break;
@ -405,7 +405,7 @@ public class Stabs {
String paramName = sf.getName(); String paramName = sf.getName();
String paramInfo = sf.getTypeInformation(); String paramInfo = sf.getTypeInformation();
DebugParameterKind paramKind = DebugParameterKind.REGISTER; DebugParameterKind paramKind = DebugParameterKind.REGISTER;
DebugType paramType = parseStabType("", paramInfo); DebugType paramType = parseStabType("", paramInfo); //$NON-NLS-1$
requestor.acceptParameter(paramName, paramType, paramKind, value); requestor.acceptParameter(paramName, paramType, paramKind, value);
} }
break; break;
@ -423,7 +423,7 @@ public class Stabs {
String varName = sf.getName(); String varName = sf.getName();
String varInfo = sf.getTypeInformation(); String varInfo = sf.getTypeInformation();
DebugVariableKind varKind = DebugVariableKind.REGISTER; DebugVariableKind varKind = DebugVariableKind.REGISTER;
DebugType varType = parseStabType("", varInfo); DebugType varType = parseStabType("", varInfo); //$NON-NLS-1$
requestor.acceptVariable(varName, varType, varKind, value); requestor.acceptVariable(varName, varType, varKind, value);
} }
break; break;
@ -434,7 +434,7 @@ public class Stabs {
String varName = sf.getName(); String varName = sf.getName();
String varInfo = sf.getTypeInformation(); String varInfo = sf.getTypeInformation();
DebugVariableKind varKind = DebugVariableKind.STATIC; DebugVariableKind varKind = DebugVariableKind.STATIC;
DebugType varType = parseStabType("", varInfo); DebugType varType = parseStabType("", varInfo); //$NON-NLS-1$
requestor.acceptVariable(varName, varType, varKind, value); requestor.acceptVariable(varName, varType, varKind, value);
} }
break; break;
@ -471,7 +471,7 @@ public class Stabs {
String paramName = sf.getName(); String paramName = sf.getName();
String paramInfo = sf.getTypeInformation(); String paramInfo = sf.getTypeInformation();
DebugParameterKind paramKind = DebugParameterKind.REFERENCE; DebugParameterKind paramKind = DebugParameterKind.REFERENCE;
DebugType paramType = parseStabType("", paramInfo); DebugType paramType = parseStabType("", paramInfo); //$NON-NLS-1$
requestor.acceptParameter(paramName, paramType, paramKind, value); requestor.acceptParameter(paramName, paramType, paramKind, value);
} }
break; break;
@ -482,7 +482,7 @@ public class Stabs {
String varName = sf.getName(); String varName = sf.getName();
String varInfo = sf.getTypeInformation(); String varInfo = sf.getTypeInformation();
DebugVariableKind varKind = DebugVariableKind.LOCAL_STATIC; DebugVariableKind varKind = DebugVariableKind.LOCAL_STATIC;
DebugType varType = parseStabType("", varInfo); DebugType varType = parseStabType("", varInfo); //$NON-NLS-1$
requestor.acceptVariable(varName, varType, varKind, value); requestor.acceptVariable(varName, varType, varKind, value);
} }
break; break;
@ -502,7 +502,7 @@ public class Stabs {
String varName = sf.getName(); String varName = sf.getName();
String varInfo = sf.getTypeInformation(); String varInfo = sf.getTypeInformation();
DebugVariableKind varKind = DebugVariableKind.LOCAL; DebugVariableKind varKind = DebugVariableKind.LOCAL;
DebugType varType = parseStabType("", varInfo); DebugType varType = parseStabType("", varInfo); //$NON-NLS-1$
requestor.acceptVariable(varName, varType, varKind, value); requestor.acceptVariable(varName, varType, varKind, value);
} }
break; break;
@ -535,7 +535,7 @@ public class Stabs {
// Reference (C++) // Reference (C++)
case '&' : case '&' :
{ {
DebugType subType = parseStabType("", reader); DebugType subType = parseStabType("", reader); //$NON-NLS-1$
type = new DebugReferenceType(subType); type = new DebugReferenceType(subType);
} }
break; break;
@ -547,7 +547,7 @@ public class Stabs {
// pointer type. // pointer type.
case '*' : case '*' :
{ {
DebugType subType = parseStabType("", reader); DebugType subType = parseStabType("", reader); //$NON-NLS-1$
type = new DebugPointerType(subType); type = new DebugPointerType(subType);
} }
break; break;
@ -603,7 +603,7 @@ public class Stabs {
// Function type // Function type
case 'f' : case 'f' :
{ {
DebugType subType = parseStabType("", reader); DebugType subType = parseStabType("", reader); //$NON-NLS-1$
type = new DebugFunctionType(subType); type = new DebugFunctionType(subType);
} }
break; break;
@ -723,11 +723,11 @@ public class Stabs {
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
int c = reader.read(); int c = reader.read();
if (c == 's') { if (c == 's') {
sb.append("struct "); sb.append("struct "); //$NON-NLS-1$
} else if (c == 'u') { } else if (c == 'u') {
sb.append("union "); sb.append("union "); //$NON-NLS-1$
} else if (c == 'e') { } else if (c == 'e') {
sb.append("enum "); sb.append("enum "); //$NON-NLS-1$
} else { } else {
sb.append((char) c); sb.append((char) c);
} }
@ -885,7 +885,7 @@ public class Stabs {
// we only understand range for an array. // we only understand range for an array.
int c = reader.read(); int c = reader.read();
if (c == 'r') { if (c == 'r') {
DebugType index_type = parseStabType("", reader); DebugType index_type = parseStabType("", reader); //$NON-NLS-1$
c = reader.read(); c = reader.read();
// Check ';' // Check ';'
@ -944,7 +944,7 @@ public class Stabs {
} }
// The array_content_type // The array_content_type
DebugType subType = parseStabType("", reader); DebugType subType = parseStabType("", reader); //$NON-NLS-1$
return new DebugArrayType(subType, upper - lower + 1); return new DebugArrayType(subType, upper - lower + 1);
} }
@ -1044,7 +1044,7 @@ public class Stabs {
String name = sb.toString(); String name = sb.toString();
// get the type of the field // get the type of the field
DebugType fieldType = parseStabType("", reader); DebugType fieldType = parseStabType("", reader); //$NON-NLS-1$
c = reader.read(); c = reader.read();
// Sanity check: we should have ',' here. // Sanity check: we should have ',' here.
@ -1173,9 +1173,9 @@ public class Stabs {
if (lowerBound == 0 && upperBound == -1) { if (lowerBound == 0 && upperBound == -1) {
// if the lower bound is 0 and the upper bound is -1, // if the lower bound is 0 and the upper bound is -1,
// it means unsigned int // 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); 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); rangeType = new DebugBaseType(name, 8, true);
} else { } else {
rangeType = new DebugBaseType(name, 4, true); rangeType = new DebugBaseType(name, 4, true);
@ -1242,7 +1242,7 @@ public class Stabs {
case 'e' : case 'e' :
{ {
int val = 0; int val = 0;
DebugType type = parseStabType("", reader); DebugType type = parseStabType("", reader); //$NON-NLS-1$
c = reader.read(); c = reader.read();
if (c == ',') { if (c == ',') {
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
@ -1293,13 +1293,13 @@ public class Stabs {
} }
try { try {
String s = sb.toString(); String s = sb.toString();
if (s.equals("-INF")) { if (s.equals("-INF")) { //$NON-NLS-1$
val = Double.NEGATIVE_INFINITY; val = Double.NEGATIVE_INFINITY;
} else if (s.equals("INF")) { } else if (s.equals("INF")) { //$NON-NLS-1$
val = Double.POSITIVE_INFINITY; val = Double.POSITIVE_INFINITY;
} else if (s.equals("QNAN")) { } else if (s.equals("QNAN")) { //$NON-NLS-1$
val = Double.NaN; val = Double.NaN;
} else if (s.equals("SNAN")) { } else if (s.equals("SNAN")) { //$NON-NLS-1$
val = Double.NaN; val = Double.NaN;
} else { } else {
val = Double.parseDouble(s); val = Double.parseDouble(s);

View file

@ -63,13 +63,13 @@ public class StringField {
if (name.length() > 1 && name.charAt(0) == '$') { if (name.length() > 1 && name.charAt(0) == '$') {
switch (name.charAt(1)) { switch (name.charAt(1)) {
case 't' : case 't' :
name = "this"; name = "this"; //$NON-NLS-1$
break; break;
case 'v' : case 'v' :
/* Was: name = "vptr"; */ /* Was: name = "vptr"; */
break; break;
case 'e' : case 'e' :
name = "eh_throw"; name = "eh_throw"; //$NON-NLS-1$
break; break;
case '_' : case '_' :
/* This was an anonymous type that was never fixed up. */ /* This was an anonymous type that was never fixed up. */

View file

@ -120,7 +120,7 @@ public class DebugAddr2line {
String function = addr2line.getFunction(address); String function = addr2line.getFunction(address);
String filename = addr2line.getFileName(address); String filename = addr2line.getFileName(address);
System.out.println(Long.toHexString(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) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
} }

View file

@ -75,7 +75,7 @@ public class DebugSymsRequestor implements IDebugEntryRequestor {
DebugSym sym = new DebugSym(); DebugSym sym = new DebugSym();
sym.name = name; sym.name = name;
sym.addr = address; sym.addr = address;
sym.type = "CU"; sym.type = "CU"; //$NON-NLS-1$
sym.filename = name; sym.filename = name;
currentCU = sym; currentCU = sym;
list.add(sym); list.add(sym);
@ -110,7 +110,7 @@ public class DebugSymsRequestor implements IDebugEntryRequestor {
DebugSym sym = new DebugSym(); DebugSym sym = new DebugSym();
sym.name = name; sym.name = name;
sym.addr = address; sym.addr = address;
sym.type = "Func"; sym.type = "Func"; //$NON-NLS-1$
if (currentCU != null) { if (currentCU != null) {
sym.filename = currentCU.filename; sym.filename = currentCU.filename;
} }
@ -145,10 +145,10 @@ public class DebugSymsRequestor implements IDebugEntryRequestor {
*/ */
public void acceptStatement(int line, long address) { public void acceptStatement(int line, long address) {
DebugSym sym = new DebugSym(); DebugSym sym = new DebugSym();
sym.name = ""; sym.name = ""; //$NON-NLS-1$
sym.addr = address; sym.addr = address;
sym.startLine = line; sym.startLine = line;
sym.type = "SLINE"; sym.type = "SLINE"; //$NON-NLS-1$
if (currentFunction != null) { if (currentFunction != null) {
if (currentFunction.startLine == 0) { if (currentFunction.startLine == 0) {
currentFunction.startLine = line; currentFunction.startLine = line;
@ -186,7 +186,7 @@ public class DebugSymsRequestor implements IDebugEntryRequestor {
DebugSym sym = new DebugSym(); DebugSym sym = new DebugSym();
sym.name = name; sym.name = name;
sym.addr = offset; sym.addr = offset;
sym.type = "PARAM"; sym.type = "PARAM"; //$NON-NLS-1$
if (currentCU != null) { if (currentCU != null) {
sym.filename = currentCU.filename; sym.filename = currentCU.filename;
} }
@ -200,7 +200,7 @@ public class DebugSymsRequestor implements IDebugEntryRequestor {
DebugSym sym = new DebugSym(); DebugSym sym = new DebugSym();
sym.name = name; sym.name = name;
sym.addr = address; sym.addr = address;
sym.type = "VAR"; sym.type = "VAR"; //$NON-NLS-1$
if (currentCU != null) { if (currentCU != null) {
sym.filename = currentCU.filename; sym.filename = currentCU.filename;
} }

View file

@ -197,7 +197,7 @@ public class AR {
efile.seek(elf_offset); efile.seek(elf_offset);
efile.read(temp); efile.read(temp);
} else { } else {
efile = new ERandomAccessFile(filename, "r"); efile = new ERandomAccessFile(filename, "r"); //$NON-NLS-1$
efile.seek(elf_offset); efile.seek(elf_offset);
efile.read(temp); efile.read(temp);
efile.close(); efile.close();
@ -229,9 +229,9 @@ public class AR {
*/ */
public AR(String filename) throws IOException { public AR(String filename) throws IOException {
this.filename = filename; this.filename = filename;
efile = new ERandomAccessFile(filename, "r"); efile = new ERandomAccessFile(filename, "r"); //$NON-NLS-1$
String hdr = efile.readLine(); String hdr = efile.readLine();
if (hdr == null || hdr.compareTo("!<arch>") != 0) { if (hdr == null || hdr.compareTo("!<arch>") != 0) { //$NON-NLS-1$
efile.close(); efile.close();
throw new IOException("Not a valid archive file."); 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 the name is "//" then this is the string table section.
// //
if (name.compareTo("//") == 0) if (name.compareTo("//") == 0) //$NON-NLS-1$
strtbl_pos = pos; strtbl_pos = pos;
// //
@ -312,14 +312,14 @@ public class AR {
if (names != null && !stringInStrings(object_name, names)) if (names != null && !stringInStrings(object_name, names))
continue; continue;
object_name = "" + count + "_" + object_name; object_name = "" + count + "_" + object_name; //$NON-NLS-1$ //$NON-NLS-2$
count++; count++;
byte[] data = headers[i].getObjectData(); byte[] data = headers[i].getObjectData();
File output = new File(outdir, object_name); File output = new File(outdir, object_name);
names_used.add(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.write(data);
rfile.close(); rfile.close();
} }

View file

@ -32,7 +32,7 @@ public class Elf {
private Symbol[] dynsym_symbols; private Symbol[] dynsym_symbols;
private Section dynsym_sym; private Section dynsym_sym;
protected String EMPTY_STRING = ""; protected String EMPTY_STRING = ""; //$NON-NLS-1$
public class ELFhdr { public class ELFhdr {
@ -311,7 +311,7 @@ public class Elf {
private String cppFilt(String in) { private String cppFilt(String in) {
if (cppFiltEnabled) { if (cppFiltEnabled) {
try { try {
if (in.indexOf("__") != -1 || in.indexOf("_._") != -1) { if (in.indexOf("__") != -1 || in.indexOf("_._") != -1) { //$NON-NLS-1$ //$NON-NLS-2$
if (cppFilt == null) { if (cppFilt == null) {
cppFilt = new CPPFilt(); cppFilt = new CPPFilt();
} }
@ -383,7 +383,7 @@ public class Elf {
if (line != null) { if (line != null) {
int colon = line.lastIndexOf(':'); int colon = line.lastIndexOf(':');
String number = line.substring(colon + 1); String number = line.substring(colon + 1);
if (!number.startsWith("0")) { if (!number.startsWith("0")) { //$NON-NLS-1$
break; // bail out break; // bail out
} }
} }
@ -628,7 +628,7 @@ public class Elf {
this.cppFiltEnabled = filton; this.cppFiltEnabled = filton;
try { try {
efile = new ERandomAccessFile(file, "r"); efile = new ERandomAccessFile(file, "r"); //$NON-NLS-1$
efile.setFileOffset( offset ); efile.setFileOffset( offset );
ehdr = new ELFhdr(); ehdr = new ELFhdr();
this.file = file; this.file = file;
@ -729,69 +729,69 @@ public class Elf {
switch (ehdr.e_machine) { switch (ehdr.e_machine) {
case Elf.ELFhdr.EM_386 : case Elf.ELFhdr.EM_386 :
case Elf.ELFhdr.EM_486 : case Elf.ELFhdr.EM_486 :
attrib.cpu = "x86"; attrib.cpu = "x86"; //$NON-NLS-1$
break; break;
case Elf.ELFhdr.EM_68K: case Elf.ELFhdr.EM_68K:
attrib.cpu = "m68k"; attrib.cpu = "m68k"; //$NON-NLS-1$
break; break;
case Elf.ELFhdr.EM_PPC : case Elf.ELFhdr.EM_PPC :
case Elf.ELFhdr.EM_CYGNUS_POWERPC : case Elf.ELFhdr.EM_CYGNUS_POWERPC :
case Elf.ELFhdr.EM_RS6000 : case Elf.ELFhdr.EM_RS6000 :
attrib.cpu = "ppc"; attrib.cpu = "ppc"; //$NON-NLS-1$
break; break;
case Elf.ELFhdr.EM_PPC64 : case Elf.ELFhdr.EM_PPC64 :
attrib.cpu = "ppc64"; attrib.cpu = "ppc64"; //$NON-NLS-1$
break; break;
case Elf.ELFhdr.EM_SH : case Elf.ELFhdr.EM_SH :
attrib.cpu = "sh"; attrib.cpu = "sh"; //$NON-NLS-1$
break; break;
case Elf.ELFhdr.EM_ARM : case Elf.ELFhdr.EM_ARM :
attrib.cpu = "arm"; attrib.cpu = "arm"; //$NON-NLS-1$
break; break;
case Elf.ELFhdr.EM_MIPS_RS3_LE : case Elf.ELFhdr.EM_MIPS_RS3_LE :
case Elf.ELFhdr.EM_MIPS : case Elf.ELFhdr.EM_MIPS :
attrib.cpu = "mips"; attrib.cpu = "mips"; //$NON-NLS-1$
break; break;
case Elf.ELFhdr.EM_SPARC32PLUS: case Elf.ELFhdr.EM_SPARC32PLUS:
case Elf.ELFhdr.EM_SPARC: case Elf.ELFhdr.EM_SPARC:
case Elf.ELFhdr.EM_SPARCV9: case Elf.ELFhdr.EM_SPARCV9:
attrib.cpu = "sparc"; attrib.cpu = "sparc"; //$NON-NLS-1$
break; break;
case Elf.ELFhdr.EM_H8_300: case Elf.ELFhdr.EM_H8_300:
case Elf.ELFhdr.EM_H8_300H: case Elf.ELFhdr.EM_H8_300H:
attrib.cpu = "h8300"; attrib.cpu = "h8300"; //$NON-NLS-1$
break; break;
case Elf.ELFhdr.EM_V850: case Elf.ELFhdr.EM_V850:
case Elf.ELFhdr.EM_CYGNUS_V850: case Elf.ELFhdr.EM_CYGNUS_V850:
attrib.cpu = "v850"; attrib.cpu = "v850"; //$NON-NLS-1$
break; break;
case Elf.ELFhdr.EM_MN10300: case Elf.ELFhdr.EM_MN10300:
case Elf.ELFhdr.EM_CYGNUS_MN10300: case Elf.ELFhdr.EM_CYGNUS_MN10300:
attrib.cpu = "mn10300"; attrib.cpu = "mn10300"; //$NON-NLS-1$
break; break;
case Elf.ELFhdr.EM_MN10200: case Elf.ELFhdr.EM_MN10200:
case Elf.ELFhdr.EM_CYGNUS_MN10200: case Elf.ELFhdr.EM_CYGNUS_MN10200:
attrib.cpu = "mn10200"; attrib.cpu = "mn10200"; //$NON-NLS-1$
break; break;
case Elf.ELFhdr.EM_M32R: case Elf.ELFhdr.EM_M32R:
attrib.cpu = "m32r"; attrib.cpu = "m32r"; //$NON-NLS-1$
break; break;
case Elf.ELFhdr.EM_FR30: case Elf.ELFhdr.EM_FR30:
case Elf.ELFhdr.EM_CYGNUS_FR30: case Elf.ELFhdr.EM_CYGNUS_FR30:
attrib.cpu = "fr30"; attrib.cpu = "fr30"; //$NON-NLS-1$
break; break;
case Elf.ELFhdr.EM_XSTORMY16: case Elf.ELFhdr.EM_XSTORMY16:
attrib.cpu = "xstormy16"; attrib.cpu = "xstormy16"; //$NON-NLS-1$
break; break;
case Elf.ELFhdr.EM_CYGNUS_FRV: case Elf.ELFhdr.EM_CYGNUS_FRV:
attrib.cpu = "frv"; attrib.cpu = "frv"; //$NON-NLS-1$
break; break;
case Elf.ELFhdr.EM_IQ2000: case Elf.ELFhdr.EM_IQ2000:
attrib.cpu = "iq2000"; attrib.cpu = "iq2000"; //$NON-NLS-1$
break; break;
case Elf.ELFhdr.EM_NONE: case Elf.ELFhdr.EM_NONE:
default: default:
attrib.cpu = "none"; attrib.cpu = "none"; //$NON-NLS-1$
} }
switch (ehdr.e_ident[Elf.ELFhdr.EI_DATA]) { switch (ehdr.e_ident[Elf.ELFhdr.EI_DATA]) {
case Elf.ELFhdr.ELFDATA2LSB : case Elf.ELFhdr.ELFDATA2LSB :
@ -807,10 +807,10 @@ public class Elf {
if(sec != null) { if(sec != null) {
for (int i = 0; i < sec.length; i++) { for (int i = 0; i < sec.length; i++) {
String s = sec[i].toString(); String s = sec[i].toString();
if (s.equals(".debug_info")) { if (s.equals(".debug_info")) { //$NON-NLS-1$
attrib.debugType = Attribute.DEBUG_TYPE_DWARF; attrib.debugType = Attribute.DEBUG_TYPE_DWARF;
break; break;
} else if (s.equals(".stab")) { } else if (s.equals(".stab")) { //$NON-NLS-1$
attrib.debugType = Attribute.DEBUG_TYPE_STABS; attrib.debugType = Attribute.DEBUG_TYPE_STABS;
break; break;
} }

View file

@ -67,7 +67,7 @@ public class ElfHelper {
private void loadDynamics() throws IOException { private void loadDynamics() throws IOException {
if (dynamics == null) { if (dynamics == null) {
dynamics = new Elf.Dynamic[0]; dynamics = new Elf.Dynamic[0];
Elf.Section dynSect = elf.getSectionByName(".dynamic"); Elf.Section dynSect = elf.getSectionByName(".dynamic"); //$NON-NLS-1$
if (dynSect != null) { if (dynSect != null) {
dynamics = elf.getDynamicSections(dynSect); dynamics = elf.getDynamicSections(dynSect);
} }
@ -258,7 +258,7 @@ public class ElfHelper {
} }
public String getSoname() throws IOException { public String getSoname() throws IOException {
String soname = ""; String soname = ""; //$NON-NLS-1$
loadDynamics(); loadDynamics();
@ -310,7 +310,7 @@ public class ElfHelper {
loadSections(); loadSections();
for (int i = 0; i < sections.length; i++) { 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()); File file = new File(elf.getFilename());
String full_usage = new String(sections[i].loadSectionData()); String full_usage = new String(sections[i].loadSectionData());
@ -327,7 +327,7 @@ public class ElfHelper {
return buffer.toString(); return buffer.toString();
} }
} }
return new String(""); return new String(""); //$NON-NLS-1$
} }
public Sizes getSizes() throws IOException { public Sizes getSizes() throws IOException {

View file

@ -57,7 +57,7 @@ public class ARMember extends BinaryObject {
if (header != null) { if (header != null) {
return header.getObjectName(); return header.getObjectName();
} }
return ""; return ""; //$NON-NLS-1$
} }
protected ElfHelper getElfHelper() throws IOException { protected ElfHelper getElfHelper() throws IOException {

View file

@ -90,7 +90,7 @@ public class BinaryObject extends BinaryFile implements IBinaryObject {
if (attr != null) { if (attr != null) {
return attribute.getCPU(); return attribute.getCPU();
} }
return ""; return ""; //$NON-NLS-1$
} }
/** /**
@ -285,7 +285,7 @@ public class BinaryObject extends BinaryFile implements IBinaryObject {
try { try {
String filename = addr2line.getFileName(sym.addr); String filename = addr2line.getFileName(sym.addr);
// Addr2line returns the funny "??" when it can not find the file. // 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.startLine = addr2line.getLineNumber(sym.addr);
sym.endLine = addr2line.getLineNumber(sym.addr + sym.size - 1); sym.endLine = addr2line.getLineNumber(sym.addr + sym.size - 1);
} catch (IOException e) { } catch (IOException e) {

View file

@ -37,7 +37,7 @@ public class BinaryShared extends BinaryExecutable implements IBinaryShared {
if (soname != null) { if (soname != null) {
return soname; return soname;
} }
return ""; return ""; //$NON-NLS-1$
} }
/** /**

View file

@ -88,7 +88,7 @@ public class ElfParser extends AbstractCExtension implements IBinaryParser {
* @see org.eclipse.cdt.core.model.IBinaryParser#getFormat() * @see org.eclipse.cdt.core.model.IBinaryParser#getFormat()
*/ */
public String getFormat() { public String getFormat() {
return "ELF"; return "ELF"; //$NON-NLS-1$
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -40,7 +40,7 @@ public class GNUElfParser extends ElfParser implements IBinaryParser, IToolsProv
* @see org.eclipse.cdt.core.model.IBinaryParser#getFormat() * @see org.eclipse.cdt.core.model.IBinaryParser#getFormat()
*/ */
public String getFormat() { public String getFormat() {
return "GNU ELF"; return "GNU ELF"; //$NON-NLS-1$
} }

View file

@ -131,7 +131,7 @@ public class Symbol implements ISymbol, Comparable {
stopAddr2Line(); stopAddr2Line();
} }
}; };
new Thread(worker, "Addr2line Reaper").start(); new Thread(worker, "Addr2line Reaper").start(); //$NON-NLS-1$
} }
} else { } else {
timestamp = System.currentTimeMillis(); timestamp = System.currentTimeMillis();

View file

@ -65,7 +65,7 @@ public class PTY {
static { static {
try { try {
System.loadLibrary("pty"); System.loadLibrary("pty"); //$NON-NLS-1$
hasPTY = true; hasPTY = true;
} catch (SecurityException e) { } catch (SecurityException e) {
} catch (UnsatisfiedLinkError e) { } catch (UnsatisfiedLinkError e) {

View file

@ -74,7 +74,7 @@ class PTYInputStream extends InputStream {
private native int close0(int fd) throws IOException; private native int close0(int fd) throws IOException;
static { static {
System.loadLibrary("pty"); System.loadLibrary("pty"); //$NON-NLS-1$
} }
} }

View file

@ -21,22 +21,22 @@ public class EnvironmentReader {
if (null != envVars) if (null != envVars)
return (Properties)envVars.clone(); return (Properties)envVars.clone();
String OS = System.getProperty("os.name").toLowerCase(); String OS = System.getProperty("os.name").toLowerCase(); //$NON-NLS-1$
Process p = null; Process p = null;
envVars = new Properties(); envVars = new Properties();
rawVars = new Vector(32); rawVars = new Vector(32);
String command = "env"; String command = "env"; //$NON-NLS-1$
InputStream in = null; InputStream in = null;
boolean check_ready = false; boolean check_ready = false;
boolean isWin32 = false; boolean isWin32 = false;
if (OS.startsWith("windows 9") || OS.startsWith("windows me")) { // 95, 98, me if (OS.startsWith("windows 9") || OS.startsWith("windows me")) { // 95, 98, me //$NON-NLS-1$ //$NON-NLS-2$
command = "command.com /c set"; command = "command.com /c set"; //$NON-NLS-1$
//The buffered stream doesn't always like windows 98 //The buffered stream doesn't always like windows 98
check_ready = true; check_ready = true;
isWin32 = true; isWin32 = true;
} else } else
if (OS.startsWith("windows ")) { if (OS.startsWith("windows ")) { //$NON-NLS-1$
command = "cmd.exe /c set"; command = "cmd.exe /c set"; //$NON-NLS-1$
isWin32 = true; isWin32 = true;
} }
try { try {
@ -54,7 +54,7 @@ public class EnvironmentReader {
String value = line.substring(idx + 1); String value = line.substring(idx + 1);
envVars.setProperty(key, value); envVars.setProperty(key, value);
} else { } else {
envVars.setProperty(line, ""); envVars.setProperty(line, ""); //$NON-NLS-1$
} }
if (check_ready && br.ready() == false) { if (check_ready && br.ready() == false) {
break; break;

View file

@ -16,11 +16,11 @@ public class ProcessFactory {
private ProcessFactory() { private ProcessFactory() {
hasSpawner = false; hasSpawner = false;
String OS = System.getProperty("os.name").toLowerCase(); String OS = System.getProperty("os.name").toLowerCase(); //$NON-NLS-1$
runtime = Runtime.getRuntime(); runtime = Runtime.getRuntime();
try { try {
// Spawner does not work for Windows 98 fallback // 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; hasSpawner = false;
} else { } else {
System.loadLibrary("spawner"); //$NON-NLS-1$ System.loadLibrary("spawner"); //$NON-NLS-1$

View file

@ -74,7 +74,7 @@ class SpawnerInputStream extends InputStream {
private native int close0(int fd) throws IOException; private native int close0(int fd) throws IOException;
static { static {
System.loadLibrary("spawner"); System.loadLibrary("spawner"); //$NON-NLS-1$
} }
} }