mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
More string to char[] changes. savings of about 4 Meg on this one.
This commit is contained in:
parent
b4270454a9
commit
3a58a1be85
24 changed files with 403 additions and 85 deletions
|
@ -94,4 +94,136 @@ public class Keywords {
|
|||
public static final String XOR = "xor"; //$NON-NLS-1$
|
||||
public static final String XOR_EQ = "xor_eq"; //$NON-NLS-1$
|
||||
|
||||
|
||||
public static final char[] c_BOOL = "_Bool".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] c_COMPLEX = "_Complex".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] c_IMAGINARY = "_Imaginary".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cAND = "and".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cAND_EQ = "and_eq".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cASM = "asm".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cAUTO = "auto".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cBITAND = "bitand".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cBITOR = "bitor".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cBOOL = "bool".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cBREAK = "break".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cCASE = "case".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cCATCH = "catch".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cCHAR = "char".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cCLASS = "class".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cCOMPL = "compl".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cCONST = "const".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cCONST_CAST = "const_cast".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cCONTINUE = "continue".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cDEFAULT = "default".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cDELETE = "delete".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cDO = "do".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cDOUBLE = "double".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cDYNAMIC_CAST = "dynamic_cast".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cELSE = "else".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cENUM = "enum".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cEXPLICIT = "explicit".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cEXPORT = "export".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cEXTERN = "extern".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cFALSE = "false".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cFLOAT = "float".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cFOR = "for".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cFRIEND = "friend".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cGOTO = "goto".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cIF = "if".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cINLINE = "inline".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cINT = "int".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cLONG = "long".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cMUTABLE = "mutable".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cNAMESPACE = "namespace".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cNEW = "new".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cNOT = "not".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cNOT_EQ = "not_eq".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cOPERATOR = "operator".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cOR = "or".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cOR_EQ = "or_eq".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cPRIVATE = "private".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cPROTECTED = "protected".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cPUBLIC = "public".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cREGISTER = "register".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cREINTERPRET_CAST = "reinterpret_cast".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cRESTRICT = "restrict".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cRETURN = "return".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cSHORT = "short".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cSIGNED = "signed".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cSIZEOF = "sizeof".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cSTATIC = "static".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cSTATIC_CAST = "static_cast".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cSTRUCT = "struct".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cSWITCH = "switch".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cTEMPLATE = "template".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cTHIS = "this".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cTHROW = "throw".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cTRUE = "true".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cTRY = "try".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cTYPEDEF = "typedef".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cTYPEID = "typeid".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cTYPENAME = "typename".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cUNION = "union".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cUNSIGNED = "unsigned".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cUSING = "using".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cVIRTUAL = "virtual".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cVOID = "void".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cVOLATILE = "volatile".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cWCHAR_T = "wchar_t".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cWHILE = "while".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cXOR = "xor".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cXOR_EQ = "xor_eq".toCharArray(); //$NON-NLS-1$
|
||||
|
||||
public static final char[] cpCOLONCOLON = "::".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpCOLON = ":".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpSEMI = ".toCharArray();".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpCOMMA = ",".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpQUESTION = "?".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpLPAREN = "(".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpRPAREN = ")".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpLBRACKET = "[".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpRBRACKET = "]".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpLBRACE = "{".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpRBRACE = "}".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpPLUSASSIGN = "+=".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpINCR = "++".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpPLUS = "+".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpMINUSASSIGN = "-=".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpDECR = "--".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpARROWSTAR = "->*".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpARROW = "->".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpMINUS = "-".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpSTARASSIGN = "*=".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpSTAR = "*".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpMODASSIGN = "%=".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpMOD = "%".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpXORASSIGN = "^=".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpXOR = "^".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpAMPERASSIGN = "&=".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpAND = "&&".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpAMPER = "&".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpBITORASSIGN = "|=".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpOR = "||".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpBITOR = "|".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpCOMPL = "~".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpNOTEQUAL = "!=".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpNOT = "!".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpEQUAL = "==".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpASSIGN ="=".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpSHIFTL = "<<".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpLTEQUAL = "<=".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpLT = "<".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpSHIFTRASSIGN = ">>=".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpSHIFTR = ">>".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpGTEQUAL = ">=".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpGT = ">".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpSHIFTLASSIGN = "<<=".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpELLIPSIS = "...".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpDOTSTAR = ".*".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpDOT = ".".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpDIVASSIGN = "/=".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpDIV = "/".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpPOUND = "#".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpPOUNDPOUND = "##".toCharArray(); //$NON-NLS-1$
|
||||
public static final char[] cpEQUALS = "=".toCharArray(); //$NON-NLS-1$
|
||||
}
|
||||
|
|
|
@ -322,7 +322,8 @@ public interface IASTExpression extends ISourceElementCallbackDelegate, IASTNode
|
|||
public IASTExpression getRHSExpression();
|
||||
public IASTExpression getThirdExpression();
|
||||
public String getLiteralString();
|
||||
public String getIdExpression();
|
||||
public String getIdExpression();
|
||||
public char[] getIdExpressionCharArray();
|
||||
public IASTTypeId getTypeId();
|
||||
public IASTNewExpressionDescriptor getNewExpressionDescriptor();
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ public interface IASTTypeId extends ISourceElementCallbackDelegate
|
|||
{
|
||||
public IASTSimpleTypeSpecifier.Type getKind();
|
||||
public String getTypeOrClassName();
|
||||
public char[] getTypeOrClassNameCharArray();
|
||||
public Iterator getPointerOperators();
|
||||
public Iterator getArrayModifiers();
|
||||
|
||||
|
@ -36,6 +37,7 @@ public interface IASTTypeId extends ISourceElementCallbackDelegate
|
|||
|
||||
|
||||
public String getFullSignature();
|
||||
public char[] getFullSignatureCharArray();
|
||||
public ISymbol getTypeSymbol() throws ASTNotImplementedException;
|
||||
/**
|
||||
* @param manager
|
||||
|
|
|
@ -59,7 +59,7 @@ public class CompletionParser extends ContextualParser implements IParser {
|
|||
translationUnit();
|
||||
//long stopTime = System.currentTimeMillis();
|
||||
//System.out.println("Completion Parse time: " + (stopTime - startTime) + "ms");
|
||||
return new ASTCompletionNode( getCompletionKind(), getCompletionScope(), getCompletionContext(), getCompletionPrefix(), reconcileKeywords( getKeywordSet(), getCompletionPrefix() ), getCompletionFunctionName(), getParameterListExpression() );
|
||||
return new ASTCompletionNode( getCompletionKind(), getCompletionScope(), getCompletionContext(), getCompletionPrefix(), reconcileKeywords( getKeywordSet(), getCompletionPrefix() ), String.valueOf(getCompletionFunctionName()), getParameterListExpression() );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -72,7 +72,7 @@ public class ContextualParser extends CompleteParser {
|
|||
protected IASTNode context;
|
||||
protected IToken finalToken;
|
||||
protected Set keywordSet;
|
||||
protected String functionOrConstructorName = "";//$NON-NLS-1$
|
||||
protected char[] functionOrConstructorName = EMPTY_STRING;
|
||||
|
||||
/**
|
||||
* @return
|
||||
|
@ -162,7 +162,7 @@ public class ContextualParser extends CompleteParser {
|
|||
setCompletionFunctionName();
|
||||
}
|
||||
|
||||
private String currentFunctionName = String.valueOf(EMPTY_STRING);
|
||||
private char[] currentFunctionName = EMPTY_STRING;
|
||||
protected IASTExpression parameterListExpression;
|
||||
|
||||
|
||||
|
@ -217,7 +217,7 @@ public class ContextualParser extends CompleteParser {
|
|||
/**
|
||||
* @return
|
||||
*/
|
||||
protected String getCompletionFunctionName() {
|
||||
protected char[] getCompletionFunctionName() {
|
||||
return functionOrConstructorName;
|
||||
}
|
||||
|
||||
|
@ -225,7 +225,7 @@ public class ContextualParser extends CompleteParser {
|
|||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.internal.core.parser.ExpressionParser#setCurrentFunctionName(java.lang.String)
|
||||
*/
|
||||
protected void setCurrentFunctionName(String functionName) {
|
||||
protected void setCurrentFunctionName(char[] functionName) {
|
||||
currentFunctionName = functionName;
|
||||
}
|
||||
|
||||
|
|
|
@ -1956,7 +1956,7 @@ public class ExpressionParser implements IExpressionParser, IParserData {
|
|||
if (LT(1) == IToken.tLPAREN) {
|
||||
consume(IToken.tLPAREN);
|
||||
setCurrentFunctionName(((typeId != null) ? typeId
|
||||
.getFullSignature() : String.valueOf(EMPTY_STRING)));
|
||||
.getFullSignatureCharArray() : EMPTY_STRING));
|
||||
setCompletionValues(scope, CompletionKind.CONSTRUCTOR_REFERENCE);
|
||||
if (templateIdScopes != null) {
|
||||
templateIdScopes.push(new Integer(IToken.tLPAREN));
|
||||
|
@ -1967,7 +1967,7 @@ public class ExpressionParser implements IExpressionParser, IParserData {
|
|||
newInitializerExpressions.add(expression(scope,
|
||||
CompletionKind.CONSTRUCTOR_REFERENCE, key));
|
||||
|
||||
setCurrentFunctionName(String.valueOf(EMPTY_STRING));
|
||||
setCurrentFunctionName(EMPTY_STRING);
|
||||
consume(IToken.tRPAREN);
|
||||
if (templateIdScopes != null) {
|
||||
templateIdScopes.pop();
|
||||
|
@ -1995,7 +1995,7 @@ public class ExpressionParser implements IExpressionParser, IParserData {
|
|||
/**
|
||||
* @param functionName
|
||||
*/
|
||||
protected void setCurrentFunctionName(String functionName) {
|
||||
protected void setCurrentFunctionName(char[] functionName) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2297,12 +2297,12 @@ public class ExpressionParser implements IExpressionParser, IParserData {
|
|||
if (firstExpression != null) {
|
||||
if (firstExpression.getExpressionKind() == IASTExpression.Kind.ID_EXPRESSION)
|
||||
setCurrentFunctionName(firstExpression
|
||||
.getIdExpression());
|
||||
.getIdExpressionCharArray());
|
||||
else if (firstExpression.getRHSExpression() != null
|
||||
&& firstExpression.getRHSExpression()
|
||||
.getIdExpression() != null) {
|
||||
setCurrentFunctionName(firstExpression
|
||||
.getRHSExpression().getIdExpression());
|
||||
.getRHSExpression().getIdExpressionCharArray());
|
||||
context = astFactory
|
||||
.expressionToMostPreciseASTNode(scope,
|
||||
firstExpression.getLHSExpression());
|
||||
|
@ -2316,7 +2316,7 @@ public class ExpressionParser implements IExpressionParser, IParserData {
|
|||
CompletionKind.FUNCTION_REFERENCE, context);
|
||||
secondExpression = expression(scope,
|
||||
CompletionKind.FUNCTION_REFERENCE, key);
|
||||
setCurrentFunctionName(String.valueOf(EMPTY_STRING));
|
||||
setCurrentFunctionName(EMPTY_STRING);
|
||||
endOffset = consume(IToken.tRPAREN).getEndOffset();
|
||||
if (templateIdScopes != null) {
|
||||
templateIdScopes.pop();
|
||||
|
@ -2477,12 +2477,12 @@ public class ExpressionParser implements IExpressionParser, IParserData {
|
|||
int line = la.getLineNumber();
|
||||
char [] fn = la.getFilename();
|
||||
la = null;
|
||||
String typeName = consume().getImage();
|
||||
char[] typeName = consume().getCharImage();
|
||||
consume(IToken.tLPAREN);
|
||||
setCurrentFunctionName(typeName);
|
||||
IASTExpression inside = expression(scope,
|
||||
CompletionKind.CONSTRUCTOR_REFERENCE, key);
|
||||
setCurrentFunctionName(String.valueOf(EMPTY_STRING));
|
||||
setCurrentFunctionName(EMPTY_STRING);
|
||||
int endOffset = consume(IToken.tRPAREN).getEndOffset();
|
||||
try {
|
||||
return astFactory.createExpression(scope, type, inside, null, null,
|
||||
|
|
|
@ -60,6 +60,7 @@ import org.eclipse.cdt.core.parser.ast.IASTClassSpecifier.ClassNameType;
|
|||
import org.eclipse.cdt.core.parser.ast.IASTCompletionNode.CompletionKind;
|
||||
import org.eclipse.cdt.core.parser.extension.IParserExtension;
|
||||
import org.eclipse.cdt.internal.core.parser.problem.IProblemFactory;
|
||||
import org.eclipse.cdt.internal.core.parser.scanner2.CharArrayUtils;
|
||||
import org.eclipse.cdt.internal.core.parser.token.TokenFactory;
|
||||
|
||||
/**
|
||||
|
@ -1555,7 +1556,7 @@ public abstract class Parser extends ExpressionParser implements IParser
|
|||
className = duple.getToken(index);
|
||||
}
|
||||
|
||||
boolean result = className.getImage().equals(duple.getLastToken());
|
||||
boolean result = CharArrayUtils.equals( className.getCharImage(), duple.getLastToken().getCharImage() );
|
||||
backup(mark);
|
||||
return result;
|
||||
} finally {
|
||||
|
|
|
@ -59,7 +59,7 @@ public class ASTDesignator implements IASTDesignator
|
|||
{
|
||||
return String.valueOf(fieldName);
|
||||
}
|
||||
public char[] fieldNameArray(){
|
||||
public char[] fieldNameCharArray(){
|
||||
return fieldName;
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
|
|
|
@ -40,7 +40,7 @@ public class ASTQualifiedNamedElement implements IASTQualifiedNameElement
|
|||
if (parent instanceof IASTNamespaceDefinition
|
||||
|| parent instanceof IASTClassSpecifier )
|
||||
{
|
||||
names.push(((IASTOffsetableNamedElement)parent).getName().toCharArray());
|
||||
names.push(((IASTOffsetableNamedElement)parent).getNameCharArray());
|
||||
if( parent instanceof IASTScopedElement )
|
||||
parent = ((IASTScopedElement)parent).getOwnerScope();
|
||||
}
|
||||
|
|
|
@ -252,6 +252,7 @@ public abstract class ASTExpression extends ASTNode implements IASTExpression
|
|||
}
|
||||
|
||||
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
|
||||
private static final char[] EMPTY_CHAR_ARRAY = "".toCharArray(); //$NON-NLS-1$
|
||||
|
||||
public IASTExpression getLHSExpression() {
|
||||
return null;
|
||||
|
@ -272,6 +273,10 @@ public abstract class ASTExpression extends ASTNode implements IASTExpression
|
|||
public String getIdExpression() {
|
||||
return EMPTY_STRING;
|
||||
}
|
||||
|
||||
public char[] getIdExpressionCharArray(){
|
||||
return EMPTY_CHAR_ARRAY;
|
||||
}
|
||||
|
||||
public IASTTypeId getTypeId() {
|
||||
return null;
|
||||
|
|
|
@ -40,6 +40,10 @@ public class ASTIdExpression extends ASTExpression {
|
|||
return String.valueOf( idExpressionValue );
|
||||
}
|
||||
|
||||
public char[] getIdExpressionCharArray(){
|
||||
return idExpressionValue;
|
||||
}
|
||||
|
||||
public ITokenDuple getIdExpressionTokenDuple()
|
||||
{
|
||||
return idExpression;
|
||||
|
|
|
@ -225,13 +225,13 @@ public class ASTMethod extends ASTFunction implements IASTMethod
|
|||
* @return
|
||||
* @throws LookupError
|
||||
*/
|
||||
protected List performPrefixLookup(String prefix, IContainerSymbol thisContainer, IContainerSymbol qualification, TypeFilter filter, List paramList) throws LookupError {
|
||||
protected List performPrefixLookup(char[] prefix, IContainerSymbol thisContainer, IContainerSymbol qualification, TypeFilter filter, List paramList) throws LookupError {
|
||||
if( filter.isLookingInThis() ){
|
||||
try{
|
||||
ISymbol thisPointer = thisContainer.lookup( ParserSymbolTable.THIS );
|
||||
ISymbol thisClass = ( thisPointer != null ) ? thisPointer.getTypeSymbol() : null;
|
||||
if( thisClass != null && thisClass instanceof IContainerSymbol ){
|
||||
return ((IContainerSymbol) thisClass).prefixLookup( filter, prefix.toCharArray(), true, paramList );
|
||||
return ((IContainerSymbol) thisClass).prefixLookup( filter, prefix, true, paramList );
|
||||
}
|
||||
} catch (ParserSymbolTableException e) {
|
||||
throw new LookupError();
|
||||
|
|
|
@ -74,7 +74,7 @@ public class ASTNode implements IASTNode {
|
|||
filter.addAcceptedType( LookupKind.ALL );
|
||||
}
|
||||
|
||||
List lookupResults = performPrefixLookup(prefix, thisContainer, qualification, filter, parameters);
|
||||
List lookupResults = performPrefixLookup(prefix.toCharArray(), thisContainer, qualification, filter, parameters);
|
||||
|
||||
if(lookupResults == null)
|
||||
return null;
|
||||
|
@ -111,13 +111,13 @@ public class ASTNode implements IASTNode {
|
|||
* @return
|
||||
* @throws LookupError
|
||||
*/
|
||||
protected List performPrefixLookup(String prefix, IContainerSymbol thisContainer, IContainerSymbol qualification, TypeFilter filter, List paramList) throws LookupError {
|
||||
protected List performPrefixLookup(char[] prefix, IContainerSymbol thisContainer, IContainerSymbol qualification, TypeFilter filter, List paramList) throws LookupError {
|
||||
List results = null;
|
||||
try {
|
||||
if( qualification != null ){
|
||||
results = qualification.prefixLookup( filter, prefix.toCharArray(), true, paramList );
|
||||
results = qualification.prefixLookup( filter, prefix, true, paramList );
|
||||
} else {
|
||||
results = thisContainer.prefixLookup( filter, prefix.toCharArray(), false, paramList );
|
||||
results = thisContainer.prefixLookup( filter, prefix, false, paramList );
|
||||
}
|
||||
} catch (ParserSymbolTableException e) {
|
||||
throw new LookupError();
|
||||
|
|
|
@ -81,6 +81,9 @@ public class ASTTypeId implements IASTTypeId
|
|||
{
|
||||
return String.valueOf(typeName);
|
||||
}
|
||||
public char[] getTypeOrClassNameCharArray(){
|
||||
return typeName;
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.parser.ast.IASTTypeId#getPointerOperators()
|
||||
*/
|
||||
|
@ -113,6 +116,10 @@ public class ASTTypeId implements IASTTypeId
|
|||
{
|
||||
return String.valueOf(signature);
|
||||
}
|
||||
|
||||
public char[] getFullSignatureCharArray(){
|
||||
return signature;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.parser.ast.IASTTypeId#createTypeSymbol(org.eclipse.cdt.core.parser.ast.IASTFactory)
|
||||
|
|
|
@ -575,7 +575,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
|||
}
|
||||
try
|
||||
{
|
||||
endResult = scopeToSymbol(scope).addUsingDeclaration( name.getLastToken().getImage().toCharArray(), containerSymbol );
|
||||
endResult = scopeToSymbol(scope).addUsingDeclaration( name.getLastToken().getCharImage(), containerSymbol );
|
||||
}
|
||||
catch (ParserSymbolTableException e)
|
||||
{
|
||||
|
@ -583,7 +583,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
|||
}
|
||||
} else
|
||||
try {
|
||||
endResult = scopeToSymbol(scope).addUsingDeclaration(name.getLastToken().getImage().toCharArray());
|
||||
endResult = scopeToSymbol(scope).addUsingDeclaration(name.getLastToken().getCharImage());
|
||||
} catch (ParserSymbolTableException e) {
|
||||
handleProblem(e.createProblemID(), name.getLastToken().getCharImage(), startingOffset, endingOffset, startingLine, true );
|
||||
}
|
||||
|
@ -1131,7 +1131,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
|||
idExpression.toString()
|
||||
);
|
||||
}
|
||||
else if( literal != null && !literal.equals( String.valueOf(EMPTY_STRING) ))
|
||||
else if( literal != null && literal.length > 0 )
|
||||
{
|
||||
TraceUtil.outputTrace(
|
||||
logService,
|
||||
|
@ -2803,7 +2803,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
|||
|
||||
try
|
||||
{
|
||||
lookup = ((IContainerSymbol)currentSymbol).lookup( designator.fieldName().toCharArray() );
|
||||
lookup = ((IContainerSymbol)currentSymbol).lookup( designator.fieldNameCharArray() );
|
||||
}
|
||||
catch (ParserSymbolTableException e){
|
||||
break;
|
||||
|
@ -2815,7 +2815,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
|||
try
|
||||
{
|
||||
if( lookup != null )
|
||||
addReference( clause.getReferences(), createReference( lookup, designator.fieldNameArray(), designator.fieldOffset() ));
|
||||
addReference( clause.getReferences(), createReference( lookup, designator.fieldNameCharArray(), designator.fieldOffset() ));
|
||||
}
|
||||
catch (ASTSemanticException e1)
|
||||
{
|
||||
|
@ -3529,7 +3529,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto
|
|||
if( typeSymbol == null /*|| typeSymbol.getType() == TypeInfo.t_type*/ )
|
||||
{
|
||||
freeReferences( refs );
|
||||
handleProblem( scope, IProblem.SEMANTIC_INVALID_TYPE, id.getTypeOrClassName().toCharArray() );
|
||||
handleProblem( scope, IProblem.SEMANTIC_INVALID_TYPE, typeId.getTypeOrClassNameCharArray() );
|
||||
}
|
||||
result.setTypeSymbol( typeSymbol );
|
||||
typeId.addReferences( refs, cache );
|
||||
|
|
|
@ -203,6 +203,9 @@ public class ASTExpression implements IASTExpression {
|
|||
{
|
||||
return null;
|
||||
}
|
||||
public char[] getIdExpressionCharArray(){
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.parser.ast.IASTExpression#reconcileReferences()
|
||||
|
|
|
@ -39,6 +39,9 @@ public class ASTIdExpression extends ASTExpression implements IASTExpression {
|
|||
return String.valueOf(idExpression);
|
||||
}
|
||||
|
||||
public char[] getIdExpressionCharArray(){
|
||||
return idExpression;
|
||||
}
|
||||
public String toString(){
|
||||
return ASTUtil.getExpressionString( this );
|
||||
}
|
||||
|
|
|
@ -74,6 +74,9 @@ public class ASTTypeId implements IASTTypeId
|
|||
{
|
||||
return String.valueOf(name);
|
||||
}
|
||||
public char[] getTypeOrClassNameCharArray(){
|
||||
return name;
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.parser.ast.IASTTypeId#getPointerOperators()
|
||||
*/
|
||||
|
@ -95,6 +98,10 @@ public class ASTTypeId implements IASTTypeId
|
|||
{
|
||||
return String.valueOf(completeSignature);
|
||||
}
|
||||
public char[] getFullSignatureCharArray(){
|
||||
return completeSignature;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.parser.ast.IASTTypeId#createTypeSymbol(org.eclipse.cdt.core.parser.ast.IASTFactory)
|
||||
*/
|
||||
|
|
|
@ -248,7 +248,7 @@ public class QuickParseASTFactory extends BaseASTFactory implements IASTFactory
|
|||
*/
|
||||
public IASTTemplateParameter createTemplateParameter(IASTTemplateParameter.ParamKind kind, char[] identifier, IASTTypeId defaultValue, IASTParameterDeclaration parameter, List parms, IASTCodeScope parameterScope, int startingOffset, int startingLine, int nameOffset, int nameEndOffset, int nameLine, int endingOffset, int endingLine, char[] fn)
|
||||
{
|
||||
return new ASTTemplateParameter( kind, identifier, defaultValue != null ? defaultValue.getTypeOrClassName().toCharArray() : EMPTY_STRING, parameter, parms, startingOffset, startingLine, nameOffset, nameEndOffset, nameLine, endingOffset, endingLine, fn ); //$NON-NLS-1$
|
||||
return new ASTTemplateParameter( kind, identifier, defaultValue != null ? defaultValue.getTypeOrClassNameCharArray() : EMPTY_STRING, parameter, parms, startingOffset, startingLine, nameOffset, nameEndOffset, nameLine, endingOffset, endingLine, fn ); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
|
@ -237,15 +237,15 @@ public class BasicTypeInfo implements ITypeInfo {
|
|||
return result;
|
||||
}
|
||||
|
||||
private static final char _image[][] = { "".toCharArray(), //$NON-NLS-1$ t_undef
|
||||
"".toCharArray(), //$NON-NLS-1$ t_type
|
||||
private static final char _image[][] = { ParserSymbolTable.EMPTY_NAME_ARRAY, //$NON-NLS-1$ t_undef
|
||||
ParserSymbolTable.EMPTY_NAME_ARRAY, //t_type
|
||||
"namespace".toCharArray(), //$NON-NLS-1$ t_namespace
|
||||
"class".toCharArray(), //$NON-NLS-1$ t_class
|
||||
"struct".toCharArray(), //$NON-NLS-1$ t_struct
|
||||
"union".toCharArray(), //$NON-NLS-1$ t_union
|
||||
"enum".toCharArray(), //$NON-NLS-1$ t_enumeration
|
||||
"".toCharArray(), //$NON-NLS-1$ t_constructor
|
||||
"".toCharArray(), //$NON-NLS-1$ t_function
|
||||
ParserSymbolTable.EMPTY_NAME_ARRAY, //t_constructor
|
||||
ParserSymbolTable.EMPTY_NAME_ARRAY, //t_function
|
||||
"_Bool".toCharArray(), //$NON-NLS-1$ t__Bool
|
||||
"bool".toCharArray(), //$NON-NLS-1$ t_bool
|
||||
"char".toCharArray(), //$NON-NLS-1$ t_char
|
||||
|
@ -254,12 +254,12 @@ public class BasicTypeInfo implements ITypeInfo {
|
|||
"float".toCharArray(), //$NON-NLS-1$ t_float
|
||||
"double".toCharArray(), //$NON-NLS-1$ t_double
|
||||
"void".toCharArray(), //$NON-NLS-1$ t_void
|
||||
"".toCharArray(), //$NON-NLS-1$ t_enumerator
|
||||
"".toCharArray(), //$NON-NLS-1$ t_block
|
||||
ParserSymbolTable.EMPTY_NAME_ARRAY, //t_enumerator
|
||||
ParserSymbolTable.EMPTY_NAME_ARRAY, //t_block
|
||||
"template".toCharArray(), //$NON-NLS-1$ t_template
|
||||
"".toCharArray(), //$NON-NLS-1$ t_asm
|
||||
"".toCharArray(), //$NON-NLS-1$ t_linkage
|
||||
"".toCharArray(), //$NON-NLS-1$ t_templateParameter
|
||||
ParserSymbolTable.EMPTY_NAME_ARRAY, //t_asm
|
||||
ParserSymbolTable.EMPTY_NAME_ARRAY, //t_linkage
|
||||
ParserSymbolTable.EMPTY_NAME_ARRAY, //t_templateParameter
|
||||
"typename".toCharArray() //$NON-NLS-1$ t_typeName
|
||||
};
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ import org.eclipse.cdt.core.parser.ISourceElementRequestor;
|
|||
import org.eclipse.cdt.core.parser.IToken;
|
||||
import org.eclipse.cdt.core.parser.ITokenDuple;
|
||||
import org.eclipse.cdt.core.parser.ast.IReferenceManager;
|
||||
import org.eclipse.cdt.internal.core.parser.scanner2.CharArrayUtils;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -79,7 +80,7 @@ public abstract class AbstractToken implements IToken, ITokenDuple {
|
|||
return false;
|
||||
if( ((IToken)other).getType() != getType() )
|
||||
return false;
|
||||
if( !(((IToken)other).getImage().equals( getImage() )))
|
||||
if( !CharArrayUtils.equals( ((IToken)other).getCharImage(), getCharImage() ) )
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -185,6 +185,35 @@ public class BasicTokenDuple implements ITokenDuple {
|
|||
|
||||
}
|
||||
|
||||
public static int getCharArrayLength( IToken f, IToken l ){
|
||||
if( f == l )
|
||||
return f.getCharImage().length;
|
||||
|
||||
IToken prev = null;
|
||||
IToken iter = f;
|
||||
|
||||
int length = 0;
|
||||
for( ; ; ){
|
||||
if( iter == null ) return 0;
|
||||
if( prev != null && prev.getType() != IToken.tCOLONCOLON &&
|
||||
prev.getType() != IToken.tIDENTIFIER &&
|
||||
prev.getType() != IToken.tLT &&
|
||||
prev.getType() != IToken.tCOMPL &&
|
||||
iter.getType() != IToken.tGT &&
|
||||
prev.getType() != IToken.tLBRACKET &&
|
||||
iter.getType() != IToken.tRBRACKET &&
|
||||
iter.getType() != IToken.tCOLONCOLON )
|
||||
{
|
||||
length++;
|
||||
}
|
||||
length += iter.getCharImage().length;
|
||||
if( iter == l ) break;
|
||||
prev = iter;
|
||||
iter = iter.getNext();
|
||||
}
|
||||
return length;
|
||||
}
|
||||
|
||||
public static char[] createCharArrayRepresentation( IToken f, IToken l)
|
||||
{
|
||||
if( f == l ) return f.getCharImage();
|
||||
|
@ -192,29 +221,8 @@ public class BasicTokenDuple implements ITokenDuple {
|
|||
IToken prev = null;
|
||||
IToken iter = f;
|
||||
|
||||
//first figure out how long the array should be
|
||||
int length = 0;
|
||||
for( ; ; ){
|
||||
if( prev != null &&
|
||||
prev.getType() != IToken.tCOLONCOLON &&
|
||||
prev.getType() != IToken.tIDENTIFIER &&
|
||||
prev.getType() != IToken.tLT &&
|
||||
prev.getType() != IToken.tCOMPL &&
|
||||
iter.getType() != IToken.tGT &&
|
||||
prev.getType() != IToken.tLBRACKET &&
|
||||
iter.getType() != IToken.tRBRACKET &&
|
||||
iter.getType() != IToken.tCOLONCOLON )
|
||||
{
|
||||
length++;
|
||||
}
|
||||
if( iter == null ) return EMPTY_STRING;
|
||||
length += iter.getCharImage().length;
|
||||
if( iter == l ) break;
|
||||
prev = iter;
|
||||
iter = iter.getNext();
|
||||
}
|
||||
prev = null;
|
||||
iter = f;
|
||||
int length = getCharArrayLength( f, l );
|
||||
|
||||
char[] buff = new char[ length ];
|
||||
int i = 0;
|
||||
for( ; ; )
|
||||
|
@ -386,43 +394,51 @@ public class BasicTokenDuple implements ITokenDuple {
|
|||
if( argLists == null || argLists[ argLists.length - 1 ] == null )
|
||||
return nameDuple.toCharArray();
|
||||
|
||||
Iterator i = nameDuple.iterator();
|
||||
AbstractToken i = (AbstractToken) nameDuple.getFirstToken();
|
||||
IToken last = nameDuple.getLastToken();
|
||||
|
||||
if( !i.hasNext() )
|
||||
if( i == null )
|
||||
return EMPTY_STRING;
|
||||
|
||||
char[] tempArray = i.getCharImage();
|
||||
|
||||
StringBuffer nameBuffer = new StringBuffer();
|
||||
IToken token = (IToken) i.next();
|
||||
nameBuffer.append( token.getImage() );
|
||||
if( i == last )
|
||||
return tempArray;
|
||||
|
||||
|
||||
char[] nameBuffer = new char[ getCharArrayLength( i, lastToken ) ];
|
||||
|
||||
CharArrayUtils.overWrite( nameBuffer, 0, tempArray );
|
||||
int idx = tempArray.length;
|
||||
|
||||
if( !i.hasNext() )
|
||||
return nameBuffer.toString().toCharArray();
|
||||
|
||||
//appending of spaces needs to be the same as in toString()
|
||||
|
||||
//destructors
|
||||
if( token.getType() == IToken.tCOMPL ){
|
||||
token = (IToken) i.next();
|
||||
nameBuffer.append( token.getImage() );
|
||||
if( i.getType() == IToken.tCOMPL ){
|
||||
i = (AbstractToken) i.next;
|
||||
tempArray = i.getCharImage();
|
||||
CharArrayUtils.overWrite( nameBuffer, idx, tempArray );
|
||||
idx += tempArray.length;
|
||||
}
|
||||
//operators
|
||||
else if( token.getType() == IToken.t_operator ){
|
||||
token = (IToken) i.next();
|
||||
nameBuffer.append( ' ' );
|
||||
else if( i.getType() == IToken.t_operator ){
|
||||
i = (AbstractToken) i.next;
|
||||
nameBuffer[ idx++ ] = ' ';
|
||||
|
||||
IToken first = token;
|
||||
IToken first = i;
|
||||
IToken temp = null;
|
||||
while( i.hasNext() ){
|
||||
temp = (IToken) i.next();
|
||||
while( i != last ){
|
||||
temp = (IToken) i.next;
|
||||
if( temp.getType() != IToken.tLT )
|
||||
token = temp;
|
||||
i = (AbstractToken) temp;
|
||||
else
|
||||
break;
|
||||
}
|
||||
nameBuffer.append( createCharArrayRepresentation( first, token ) );
|
||||
CharArrayUtils.overWrite( nameBuffer, idx, createCharArrayRepresentation( first, i ) );
|
||||
idx += getCharArrayLength( first, i );
|
||||
}
|
||||
|
||||
return nameBuffer.toString().toCharArray();
|
||||
return CharArrayUtils.extract( nameBuffer, 0, idx );
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
|
@ -46,7 +46,7 @@ public class ImagedToken extends SimpleToken {
|
|||
return new String( image );
|
||||
}
|
||||
|
||||
public char[] getCharImage() {
|
||||
public final char[] getCharImage() {
|
||||
return image;
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
|
|
|
@ -333,7 +333,143 @@ public class SimpleToken extends AbstractToken implements IToken {
|
|||
* @see org.eclipse.cdt.core.parser.IToken#getCharImage()
|
||||
*/
|
||||
public char[] getCharImage() {
|
||||
return getImage().toCharArray(); //TODO - fix me!
|
||||
switch ( getType() ) {
|
||||
case IToken.tCOLONCOLON : return Keywords.cpCOLONCOLON;
|
||||
case IToken.tCOLON : return Keywords.cpCOLON;
|
||||
case IToken.tSEMI : return Keywords.cpSEMI;
|
||||
case IToken.tCOMMA : return Keywords.cpCOMMA;
|
||||
case IToken.tQUESTION : return Keywords.cpQUESTION;
|
||||
case IToken.tLPAREN : return Keywords.cpLPAREN;
|
||||
case IToken.tRPAREN : return Keywords.cpRPAREN;
|
||||
case IToken.tLBRACKET : return Keywords.cpLBRACKET;
|
||||
case IToken.tRBRACKET : return Keywords.cpRBRACKET;
|
||||
case IToken.tLBRACE : return Keywords.cpLBRACE;
|
||||
case IToken.tRBRACE : return Keywords.cpRBRACE;
|
||||
case IToken.tPLUSASSIGN : return Keywords.cpPLUSASSIGN;
|
||||
case IToken.tINCR : return Keywords.cpINCR;
|
||||
case IToken.tPLUS : return Keywords.cpPLUS;
|
||||
case IToken.tMINUSASSIGN : return Keywords.cpMINUSASSIGN;
|
||||
case IToken.tDECR : return Keywords.cpDECR;
|
||||
case IToken.tARROWSTAR : return Keywords.cpARROWSTAR;
|
||||
case IToken.tARROW : return Keywords.cpARROW;
|
||||
case IToken.tMINUS : return Keywords.cpMINUS;
|
||||
case IToken.tSTARASSIGN : return Keywords.cpSTARASSIGN;
|
||||
case IToken.tSTAR : return Keywords.cpSTAR;
|
||||
case IToken.tMODASSIGN : return Keywords.cpMODASSIGN;
|
||||
case IToken.tMOD : return Keywords.cpMOD;
|
||||
case IToken.tXORASSIGN : return Keywords.cpXORASSIGN;
|
||||
case IToken.tXOR : return Keywords.cpXOR;
|
||||
case IToken.tAMPERASSIGN : return Keywords.cpAMPERASSIGN;
|
||||
case IToken.tAND : return Keywords.cpAND;
|
||||
case IToken.tAMPER : return Keywords.cpAMPER;
|
||||
case IToken.tBITORASSIGN : return Keywords.cpBITORASSIGN;
|
||||
case IToken.tOR : return Keywords.cpOR;
|
||||
case IToken.tBITOR : return Keywords.cpBITOR;
|
||||
case IToken.tCOMPL : return Keywords.cpCOMPL;
|
||||
case IToken.tNOTEQUAL : return Keywords.cpNOTEQUAL;
|
||||
case IToken.tNOT : return Keywords.cpNOT;
|
||||
case IToken.tEQUAL : return Keywords.cpEQUALS;
|
||||
case IToken.tASSIGN : return Keywords.cpASSIGN;
|
||||
case IToken.tSHIFTL : return Keywords.cpSHIFTL;
|
||||
case IToken.tLTEQUAL : return Keywords.cpLTEQUAL;
|
||||
case IToken.tLT : return Keywords.cpLT;
|
||||
case IToken.tSHIFTRASSIGN : return Keywords.cpSHIFTRASSIGN;
|
||||
case IToken.tSHIFTR : return Keywords.cpSHIFTR;
|
||||
case IToken.tGTEQUAL : return Keywords.cpGTEQUAL;
|
||||
case IToken.tGT : return Keywords.cpGT;
|
||||
case IToken.tSHIFTLASSIGN : return Keywords.cpSHIFTLASSIGN;
|
||||
case IToken.tELLIPSIS : return Keywords.cpELLIPSIS;
|
||||
case IToken.tDOTSTAR : return Keywords.cpDOTSTAR;
|
||||
case IToken.tDOT : return Keywords.cpDOT;
|
||||
case IToken.tDIVASSIGN : return Keywords.cpDIVASSIGN;
|
||||
case IToken.tDIV : return Keywords.cpDIV;
|
||||
case IToken.t_and : return Keywords.cAND;
|
||||
case IToken.t_and_eq : return Keywords.cAND_EQ ;
|
||||
case IToken.t_asm : return Keywords.cASM ;
|
||||
case IToken.t_auto : return Keywords.cAUTO ;
|
||||
case IToken.t_bitand : return Keywords.cBITAND ;
|
||||
case IToken.t_bitor : return Keywords.cBITOR ;
|
||||
case IToken.t_bool : return Keywords.cBOOL ;
|
||||
case IToken.t_break : return Keywords.cBREAK ;
|
||||
case IToken.t_case : return Keywords.cCASE ;
|
||||
case IToken.t_catch : return Keywords.cCATCH ;
|
||||
case IToken.t_char : return Keywords.cCHAR ;
|
||||
case IToken.t_class : return Keywords.cCLASS ;
|
||||
case IToken.t_compl : return Keywords.cCOMPL ;
|
||||
case IToken.t_const : return Keywords.cCONST ;
|
||||
case IToken.t_const_cast : return Keywords.cCONST_CAST ;
|
||||
case IToken.t_continue : return Keywords.cCONTINUE ;
|
||||
case IToken.t_default : return Keywords.cDEFAULT ;
|
||||
case IToken.t_delete : return Keywords.cDELETE ;
|
||||
case IToken.t_do : return Keywords.cDO;
|
||||
case IToken.t_double : return Keywords.cDOUBLE ;
|
||||
case IToken.t_dynamic_cast: return Keywords.cDYNAMIC_CAST ;
|
||||
case IToken.t_else : return Keywords.cELSE;
|
||||
case IToken.t_enum : return Keywords.cENUM ;
|
||||
case IToken.t_explicit : return Keywords.cEXPLICIT ;
|
||||
case IToken.t_export : return Keywords.cEXPORT ;
|
||||
case IToken.t_extern : return Keywords.cEXTERN;
|
||||
case IToken.t_false : return Keywords.cFALSE;
|
||||
case IToken.t_float : return Keywords.cFLOAT;
|
||||
case IToken.t_for : return Keywords.cFOR;
|
||||
case IToken.t_friend : return Keywords.cFRIEND;
|
||||
case IToken.t_goto : return Keywords.cGOTO;
|
||||
case IToken.t_if : return Keywords.cIF ;
|
||||
case IToken.t_inline : return Keywords.cINLINE ;
|
||||
case IToken.t_int : return Keywords.cINT ;
|
||||
case IToken.t_long : return Keywords.cLONG ;
|
||||
case IToken.t_mutable : return Keywords.cMUTABLE ;
|
||||
case IToken.t_namespace : return Keywords.cNAMESPACE ;
|
||||
case IToken.t_new : return Keywords.cNEW ;
|
||||
case IToken.t_not : return Keywords.cNOT ;
|
||||
case IToken.t_not_eq : return Keywords.cNOT_EQ;
|
||||
case IToken.t_operator : return Keywords.cOPERATOR ;
|
||||
case IToken.t_or : return Keywords.cOR ;
|
||||
case IToken.t_or_eq : return Keywords.cOR_EQ;
|
||||
case IToken.t_private : return Keywords.cPRIVATE ;
|
||||
case IToken.t_protected : return Keywords.cPROTECTED ;
|
||||
case IToken.t_public : return Keywords.cPUBLIC ;
|
||||
case IToken.t_register : return Keywords.cREGISTER ;
|
||||
case IToken.t_reinterpret_cast : return Keywords.cREINTERPRET_CAST ;
|
||||
case IToken.t_return : return Keywords.cRETURN ;
|
||||
case IToken.t_short : return Keywords.cSHORT ;
|
||||
case IToken.t_sizeof : return Keywords.cSIZEOF ;
|
||||
case IToken.t_static : return Keywords.cSTATIC ;
|
||||
case IToken.t_static_cast : return Keywords.cSTATIC_CAST ;
|
||||
case IToken.t_signed : return Keywords.cSIGNED ;
|
||||
case IToken.t_struct : return Keywords.cSTRUCT ;
|
||||
case IToken.t_switch : return Keywords.cSWITCH ;
|
||||
case IToken.t_template : return Keywords.cTEMPLATE ;
|
||||
case IToken.t_this : return Keywords.cTHIS ;
|
||||
case IToken.t_throw : return Keywords.cTHROW ;
|
||||
case IToken.t_true : return Keywords.cTRUE ;
|
||||
case IToken.t_try : return Keywords.cTRY ;
|
||||
case IToken.t_typedef : return Keywords.cTYPEDEF ;
|
||||
case IToken.t_typeid : return Keywords.cTYPEID ;
|
||||
case IToken.t_typename : return Keywords.cTYPENAME ;
|
||||
case IToken.t_union : return Keywords.cUNION ;
|
||||
case IToken.t_unsigned : return Keywords.cUNSIGNED ;
|
||||
case IToken.t_using : return Keywords.cUSING ;
|
||||
case IToken.t_virtual : return Keywords.cVIRTUAL ;
|
||||
case IToken.t_void : return Keywords.cVOID ;
|
||||
case IToken.t_volatile : return Keywords.cVOLATILE;
|
||||
case IToken.t_wchar_t : return Keywords.cWCHAR_T ;
|
||||
case IToken.t_while : return Keywords.cWHILE ;
|
||||
case IToken.t_xor : return Keywords.cXOR ;
|
||||
case IToken.t_xor_eq : return Keywords.cXOR_EQ ;
|
||||
case IToken.t__Bool : return Keywords.c_BOOL ;
|
||||
case IToken.t__Complex : return Keywords.c_COMPLEX ;
|
||||
case IToken.t__Imaginary : return Keywords.c_IMAGINARY ;
|
||||
case IToken.t_restrict : return Keywords.cRESTRICT ;
|
||||
case IScanner.tPOUND: return Keywords.cpPOUND;
|
||||
case IScanner.tPOUNDPOUND: return Keywords.cpPOUNDPOUND;
|
||||
|
||||
default :
|
||||
// we should never get here!
|
||||
// assert false : getType();
|
||||
return "".toCharArray(); //$NON-NLS-1$
|
||||
}
|
||||
//return getImage().toCharArray(); //TODO - fix me!
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
|
|
Loading…
Add table
Reference in a new issue