From cdfae9c75b84e90650683b0b06d917167f45f6e3 Mon Sep 17 00:00:00 2001 From: Andrew Niefer Date: Fri, 17 Sep 2004 17:56:16 +0000 Subject: [PATCH] 74180 - [Scanner] Scanner doesn't distinguish C & C++ keywords --- .../parser/tests/CompleteParseASTTest.java | 7 + .../tests/scanner2/BaseScanner2Test.java | 7 + .../parser/tests/scanner2/Scanner2Test.java | 10 ++ .../cdt/core/parser/util/CharArrayIntMap.java | 7 + .../core/parser/util/CharArrayObjectMap.java | 14 +- .../cdt/core/parser/util/CharTable.java | 9 + .../cdt/core/parser/util/HashTable.java | 23 ++- .../cdt/core/parser/util/ObjectTable.java | 15 +- .../core/parser/scanner2/Scanner2.java | 169 +++++++++--------- 9 files changed, 155 insertions(+), 106 deletions(-) diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java index 7bec628c4c3..60aa6e71426 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java @@ -2081,4 +2081,11 @@ public class CompleteParseASTTest extends CompleteParseBaseTest parse( writer.toString(), false ); } } + + public void testBug74180() throws Exception + { + parse( "enum DHCPFOBoolean { false, true } additionalHB, more_payload; \n", true, ParserLanguage.C ); + assertTrue( callback.problems.isEmpty() ); + } } + diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner2/BaseScanner2Test.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner2/BaseScanner2Test.java index b5cff2cca91..143ebd18e7d 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner2/BaseScanner2Test.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner2/BaseScanner2Test.java @@ -58,6 +58,13 @@ public class BaseScanner2Test extends TestCase { scanner = createScanner( new CodeReader(input.toCharArray()), new ScannerInfo(), mode, ParserLanguage.CPP, requestor, null, null ); //$NON-NLS-1$ } + protected void initializeScanner( String input, ParserLanguage language ) throws ParserFactoryError + { + scanner = createScanner( new CodeReader(input.toCharArray()), + new ScannerInfo(), ParserMode.COMPLETE_PARSE, language, + new NullSourceElementRequestor( ParserMode.COMPLETE_PARSE ), null, null ); + } + protected void initializeScanner(String input) throws ParserFactoryError { initializeScanner( input, ParserMode.COMPLETE_PARSE ); diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner2/Scanner2Test.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner2/Scanner2Test.java index a282b71fdfa..58238c0932d 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner2/Scanner2Test.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/scanner2/Scanner2Test.java @@ -22,6 +22,7 @@ import org.eclipse.cdt.core.parser.ISourceElementRequestor; import org.eclipse.cdt.core.parser.IToken; import org.eclipse.cdt.core.parser.NullSourceElementRequestor; import org.eclipse.cdt.core.parser.ParserFactoryError; +import org.eclipse.cdt.core.parser.ParserLanguage; import org.eclipse.cdt.core.parser.ParserMode; import org.eclipse.cdt.core.parser.ast.IASTInclusion; import org.eclipse.cdt.internal.core.parser.QuickParseCallback; @@ -1818,4 +1819,13 @@ public class Scanner2Test extends BaseScanner2Test validateEOF(); } + public void testBug74180() throws Exception{ + initializeScanner( "true false", ParserLanguage.C ); //$NON-NLS-1$ + validateIdentifier( "true" ); //$NON-NLS-1$ + validateIdentifier( "false" ); //$NON-NLS-1$ + + initializeScanner( "true false", ParserLanguage.CPP ); //$NON-NLS-1$ + validateToken( IToken.t_true ); + validateToken( IToken.t_false); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharArrayIntMap.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharArrayIntMap.java index c76df8490bc..dd3a110ebbe 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharArrayIntMap.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharArrayIntMap.java @@ -36,6 +36,13 @@ public class CharArrayIntMap extends CharTable { for( int i = 0; i < capacity(); i++ ) valueTable[i] = undefined; } + public Object clone(){ + CharArrayIntMap newMap = (CharArrayIntMap) super.clone(); + newMap.valueTable = new int[ capacity() ]; + System.arraycopy(valueTable, 0, newMap.valueTable, 0, valueTable.length); + return newMap; + } + public int put(char[] key, int start, int length, int value) { int i = addIndex(key, start, length); int oldvalue = valueTable[i]; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharArrayObjectMap.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharArrayObjectMap.java index 276e10223a9..3e71dae4c7f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharArrayObjectMap.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharArrayObjectMap.java @@ -78,18 +78,10 @@ public class CharArrayObjectMap extends CharTable { } public Object clone(){ - int size = capacity(); - - CharArrayObjectMap newTable = new CharArrayObjectMap( size ); - + CharArrayObjectMap newTable = (CharArrayObjectMap) super.clone(); + newTable.valueTable = new Object[ capacity() ]; System.arraycopy(valueTable, 0, newTable.valueTable, 0, valueTable.length); - System.arraycopy(keyTable, 0, newTable.keyTable, 0, keyTable.length); - if( hashTable != null ) - System.arraycopy(hashTable, 0, newTable.hashTable, 0, hashTable.length); - if( nextTable != null ) - System.arraycopy(nextTable, 0, newTable.nextTable, 0, nextTable.length); - - newTable.currEntry = currEntry; + return newTable; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharTable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharTable.java index a4a33d8bde4..910a559c7ee 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharTable.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/CharTable.java @@ -38,6 +38,15 @@ public class CharTable extends HashTable { for( int i = 0; i < capacity(); i++ ) keyTable[i] = null; } + public Object clone(){ + CharTable newTable = (CharTable) super.clone(); + + int size = capacity(); + newTable.keyTable = new char[size][]; + System.arraycopy(keyTable, 0, newTable.keyTable, 0, keyTable.length); + + return newTable; + } protected final int hash(char[] source, int start, int length) { return CharArrayUtils.hash(source, start, length) & ((keyTable.length * 2) - 1); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/HashTable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/HashTable.java index 83fce9d140b..4ea3674c3f1 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/HashTable.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/HashTable.java @@ -16,7 +16,7 @@ import java.util.Comparator; /** * @author ddaoust */ -public class HashTable { +public class HashTable implements Cloneable{ protected static final int minHashSize = 2; protected int currEntry = -1; @@ -47,6 +47,27 @@ public class HashTable { } } + public Object clone(){ + HashTable newTable = null; + try { + newTable = (HashTable) super.clone(); + } catch ( CloneNotSupportedException e ) { + //shouldn't happen because object supports clone. + return null; + } + + int size = capacity(); + + if( hashTable != null ){ + newTable.hashTable = new int[ size*2 ]; + newTable.nextTable = new int[ size ]; + System.arraycopy(hashTable, 0, newTable.hashTable, 0, hashTable.length); + System.arraycopy(nextTable, 0, newTable.nextTable, 0, nextTable.length); + } + newTable.currEntry = currEntry; + return newTable; + } + protected void resize() { resize(capacity() << 1); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectTable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectTable.java index c5b64417076..1da17355b4a 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectTable.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ObjectTable.java @@ -31,25 +31,12 @@ public abstract class ObjectTable extends HashTable implements Cloneable{ } public Object clone(){ - ObjectTable newTable = null; - try { - newTable = (ObjectTable) super.clone(); - } catch ( CloneNotSupportedException e ) { - //shouldn't happen because object supports clone. - return null; - } + ObjectTable newTable = (ObjectTable) super.clone(); int size = capacity(); newTable.keyTable = new Object[ size ]; System.arraycopy(keyTable, 0, newTable.keyTable, 0, keyTable.length); - if( hashTable != null ){ - newTable.hashTable = new int[ size*2 ]; - newTable.nextTable = new int[ size ]; - System.arraycopy(hashTable, 0, newTable.hashTable, 0, hashTable.length); - System.arraycopy(nextTable, 0, newTable.nextTable, 0, nextTable.length); - } - newTable.currEntry = currEntry; return newTable; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/Scanner2.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/Scanner2.java index 94fb98f8942..943bb578ddc 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/Scanner2.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner2/Scanner2.java @@ -146,6 +146,11 @@ public class Scanner2 implements IScanner, IScannerData { this.log = log; this.workingCopies = workingCopies; + if( language == ParserLanguage.C ) + keywords = ckeywords; + else + keywords = cppkeywords; + if (reader.filename != null) fileCache.put(reader.filename, reader); @@ -2896,7 +2901,9 @@ public class Scanner2 implements IScanner, IScannerData { return 0; } - private static CharArrayIntMap keywords; + private final CharArrayIntMap keywords; + private static CharArrayIntMap ckeywords; + private static CharArrayIntMap cppkeywords; private static CharArrayIntMap ppKeywords; private static final int ppIf = 0; private static final int ppIfdef = 1; @@ -2914,93 +2921,95 @@ public class Scanner2 implements IScanner, IScannerData { private static final char[] SPACE = { ' ' }; static { - keywords = new CharArrayIntMap(IToken.tLAST, -1); + CharArrayIntMap words = new CharArrayIntMap(IToken.tLAST, -1); // Common keywords - keywords.put("auto".toCharArray(), IToken.t_auto); //$NON-NLS-1$ - keywords.put("break".toCharArray(), IToken.t_break); //$NON-NLS-1$ - keywords.put("case".toCharArray(), IToken.t_case); //$NON-NLS-1$ - keywords.put("char".toCharArray(), IToken.t_char); //$NON-NLS-1$ - keywords.put("const".toCharArray(), IToken.t_const); //$NON-NLS-1$ - keywords.put("continue".toCharArray(), IToken.t_continue); //$NON-NLS-1$ - keywords.put("default".toCharArray(), IToken.t_default); //$NON-NLS-1$ - keywords.put("do".toCharArray(), IToken.t_do); //$NON-NLS-1$ - keywords.put("double".toCharArray(), IToken.t_double); //$NON-NLS-1$ - keywords.put("else".toCharArray(), IToken.t_else); //$NON-NLS-1$ - keywords.put("enum".toCharArray(), IToken.t_enum); //$NON-NLS-1$ - keywords.put("extern".toCharArray(), IToken.t_extern); //$NON-NLS-1$ - keywords.put("float".toCharArray(), IToken.t_float); //$NON-NLS-1$ - keywords.put("for".toCharArray(), IToken.t_for); //$NON-NLS-1$ - keywords.put("goto".toCharArray(), IToken.t_goto); //$NON-NLS-1$ - keywords.put("if".toCharArray(), IToken.t_if); //$NON-NLS-1$ - keywords.put("inline".toCharArray(), IToken.t_inline); //$NON-NLS-1$ - keywords.put("int".toCharArray(), IToken.t_int); //$NON-NLS-1$ - keywords.put("long".toCharArray(), IToken.t_long); //$NON-NLS-1$ - keywords.put("register".toCharArray(), IToken.t_register); //$NON-NLS-1$ - keywords.put("return".toCharArray(), IToken.t_return); //$NON-NLS-1$ - keywords.put("short".toCharArray(), IToken.t_short); //$NON-NLS-1$ - keywords.put("signed".toCharArray(), IToken.t_signed); //$NON-NLS-1$ - keywords.put("sizeof".toCharArray(), IToken.t_sizeof); //$NON-NLS-1$ - keywords.put("static".toCharArray(), IToken.t_static); //$NON-NLS-1$ - keywords.put("struct".toCharArray(), IToken.t_struct); //$NON-NLS-1$ - keywords.put("switch".toCharArray(), IToken.t_switch); //$NON-NLS-1$ - keywords.put("typedef".toCharArray(), IToken.t_typedef); //$NON-NLS-1$ - keywords.put("union".toCharArray(), IToken.t_union); //$NON-NLS-1$ - keywords.put("unsigned".toCharArray(), IToken.t_unsigned); //$NON-NLS-1$ - keywords.put("void".toCharArray(), IToken.t_void); //$NON-NLS-1$ - keywords.put("volatile".toCharArray(), IToken.t_volatile); //$NON-NLS-1$ - keywords.put("while".toCharArray(), IToken.t_while); //$NON-NLS-1$ + words.put("auto".toCharArray(), IToken.t_auto); //$NON-NLS-1$ + words.put("break".toCharArray(), IToken.t_break); //$NON-NLS-1$ + words.put("case".toCharArray(), IToken.t_case); //$NON-NLS-1$ + words.put("char".toCharArray(), IToken.t_char); //$NON-NLS-1$ + words.put("const".toCharArray(), IToken.t_const); //$NON-NLS-1$ + words.put("continue".toCharArray(), IToken.t_continue); //$NON-NLS-1$ + words.put("default".toCharArray(), IToken.t_default); //$NON-NLS-1$ + words.put("do".toCharArray(), IToken.t_do); //$NON-NLS-1$ + words.put("double".toCharArray(), IToken.t_double); //$NON-NLS-1$ + words.put("else".toCharArray(), IToken.t_else); //$NON-NLS-1$ + words.put("enum".toCharArray(), IToken.t_enum); //$NON-NLS-1$ + words.put("extern".toCharArray(), IToken.t_extern); //$NON-NLS-1$ + words.put("float".toCharArray(), IToken.t_float); //$NON-NLS-1$ + words.put("for".toCharArray(), IToken.t_for); //$NON-NLS-1$ + words.put("goto".toCharArray(), IToken.t_goto); //$NON-NLS-1$ + words.put("if".toCharArray(), IToken.t_if); //$NON-NLS-1$ + words.put("inline".toCharArray(), IToken.t_inline); //$NON-NLS-1$ + words.put("int".toCharArray(), IToken.t_int); //$NON-NLS-1$ + words.put("long".toCharArray(), IToken.t_long); //$NON-NLS-1$ + words.put("register".toCharArray(), IToken.t_register); //$NON-NLS-1$ + words.put("return".toCharArray(), IToken.t_return); //$NON-NLS-1$ + words.put("short".toCharArray(), IToken.t_short); //$NON-NLS-1$ + words.put("signed".toCharArray(), IToken.t_signed); //$NON-NLS-1$ + words.put("sizeof".toCharArray(), IToken.t_sizeof); //$NON-NLS-1$ + words.put("static".toCharArray(), IToken.t_static); //$NON-NLS-1$ + words.put("struct".toCharArray(), IToken.t_struct); //$NON-NLS-1$ + words.put("switch".toCharArray(), IToken.t_switch); //$NON-NLS-1$ + words.put("typedef".toCharArray(), IToken.t_typedef); //$NON-NLS-1$ + words.put("union".toCharArray(), IToken.t_union); //$NON-NLS-1$ + words.put("unsigned".toCharArray(), IToken.t_unsigned); //$NON-NLS-1$ + words.put("void".toCharArray(), IToken.t_void); //$NON-NLS-1$ + words.put("volatile".toCharArray(), IToken.t_volatile); //$NON-NLS-1$ + words.put("while".toCharArray(), IToken.t_while); //$NON-NLS-1$ // ANSI C keywords - keywords.put("restrict".toCharArray(), IToken.t_restrict); //$NON-NLS-1$ - keywords.put("_Bool".toCharArray(), IToken.t__Bool); //$NON-NLS-1$ - keywords.put("_Complex".toCharArray(), IToken.t__Complex); //$NON-NLS-1$ - keywords.put("_Imaginary".toCharArray(), IToken.t__Imaginary); //$NON-NLS-1$ + ckeywords = (CharArrayIntMap) words.clone(); + ckeywords.put("restrict".toCharArray(), IToken.t_restrict); //$NON-NLS-1$ + ckeywords.put("_Bool".toCharArray(), IToken.t__Bool); //$NON-NLS-1$ + ckeywords.put("_Complex".toCharArray(), IToken.t__Complex); //$NON-NLS-1$ + ckeywords.put("_Imaginary".toCharArray(), IToken.t__Imaginary); //$NON-NLS-1$ // C++ Keywords - keywords.put("asm".toCharArray(), IToken.t_asm); //$NON-NLS-1$ - keywords.put("bool".toCharArray(), IToken.t_bool); //$NON-NLS-1$ - keywords.put("catch".toCharArray(), IToken.t_catch); //$NON-NLS-1$ - keywords.put("class".toCharArray(), IToken.t_class); //$NON-NLS-1$ - keywords.put("const_cast".toCharArray(), IToken.t_const_cast); //$NON-NLS-1$ - keywords.put("delete".toCharArray(), IToken.t_delete); //$NON-NLS-1$ - keywords.put("dynamic_cast".toCharArray(), IToken.t_dynamic_cast); //$NON-NLS-1$ - keywords.put("explicit".toCharArray(), IToken.t_explicit); //$NON-NLS-1$ - keywords.put("export".toCharArray(), IToken.t_export); //$NON-NLS-1$ - keywords.put("false".toCharArray(), IToken.t_false); //$NON-NLS-1$ - keywords.put("friend".toCharArray(), IToken.t_friend); //$NON-NLS-1$ - keywords.put("mutable".toCharArray(), IToken.t_mutable); //$NON-NLS-1$ - keywords.put("namespace".toCharArray(), IToken.t_namespace); //$NON-NLS-1$ - keywords.put("new".toCharArray(), IToken.t_new); //$NON-NLS-1$ - keywords.put("operator".toCharArray(), IToken.t_operator); //$NON-NLS-1$ - keywords.put("private".toCharArray(), IToken.t_private); //$NON-NLS-1$ - keywords.put("protected".toCharArray(), IToken.t_protected); //$NON-NLS-1$ - keywords.put("public".toCharArray(), IToken.t_public); //$NON-NLS-1$ - keywords.put("reinterpret_cast".toCharArray(), IToken.t_reinterpret_cast); //$NON-NLS-1$ - keywords.put("static_cast".toCharArray(), IToken.t_static_cast); //$NON-NLS-1$ - keywords.put("template".toCharArray(), IToken.t_template); //$NON-NLS-1$ - keywords.put("this".toCharArray(), IToken.t_this); //$NON-NLS-1$ - keywords.put("throw".toCharArray(), IToken.t_throw); //$NON-NLS-1$ - keywords.put("true".toCharArray(), IToken.t_true); //$NON-NLS-1$ - keywords.put("try".toCharArray(), IToken.t_try); //$NON-NLS-1$ - keywords.put("typeid".toCharArray(), IToken.t_typeid); //$NON-NLS-1$ - keywords.put("typename".toCharArray(), IToken.t_typename); //$NON-NLS-1$ - keywords.put("using".toCharArray(), IToken.t_using); //$NON-NLS-1$ - keywords.put("virtual".toCharArray(), IToken.t_virtual); //$NON-NLS-1$ - keywords.put("wchar_t".toCharArray(), IToken.t_wchar_t); //$NON-NLS-1$ + cppkeywords = words; + cppkeywords.put("asm".toCharArray(), IToken.t_asm); //$NON-NLS-1$ + cppkeywords.put("bool".toCharArray(), IToken.t_bool); //$NON-NLS-1$ + cppkeywords.put("catch".toCharArray(), IToken.t_catch); //$NON-NLS-1$ + cppkeywords.put("class".toCharArray(), IToken.t_class); //$NON-NLS-1$ + cppkeywords.put("const_cast".toCharArray(), IToken.t_const_cast); //$NON-NLS-1$ + cppkeywords.put("delete".toCharArray(), IToken.t_delete); //$NON-NLS-1$ + cppkeywords.put("dynamic_cast".toCharArray(), IToken.t_dynamic_cast); //$NON-NLS-1$ + cppkeywords.put("explicit".toCharArray(), IToken.t_explicit); //$NON-NLS-1$ + cppkeywords.put("export".toCharArray(), IToken.t_export); //$NON-NLS-1$ + cppkeywords.put("false".toCharArray(), IToken.t_false); //$NON-NLS-1$ + cppkeywords.put("friend".toCharArray(), IToken.t_friend); //$NON-NLS-1$ + cppkeywords.put("mutable".toCharArray(), IToken.t_mutable); //$NON-NLS-1$ + cppkeywords.put("namespace".toCharArray(), IToken.t_namespace); //$NON-NLS-1$ + cppkeywords.put("new".toCharArray(), IToken.t_new); //$NON-NLS-1$ + cppkeywords.put("operator".toCharArray(), IToken.t_operator); //$NON-NLS-1$ + cppkeywords.put("private".toCharArray(), IToken.t_private); //$NON-NLS-1$ + cppkeywords.put("protected".toCharArray(), IToken.t_protected); //$NON-NLS-1$ + cppkeywords.put("public".toCharArray(), IToken.t_public); //$NON-NLS-1$ + cppkeywords.put("reinterpret_cast".toCharArray(), IToken.t_reinterpret_cast); //$NON-NLS-1$ + cppkeywords.put("static_cast".toCharArray(), IToken.t_static_cast); //$NON-NLS-1$ + cppkeywords.put("template".toCharArray(), IToken.t_template); //$NON-NLS-1$ + cppkeywords.put("this".toCharArray(), IToken.t_this); //$NON-NLS-1$ + cppkeywords.put("throw".toCharArray(), IToken.t_throw); //$NON-NLS-1$ + cppkeywords.put("true".toCharArray(), IToken.t_true); //$NON-NLS-1$ + cppkeywords.put("try".toCharArray(), IToken.t_try); //$NON-NLS-1$ + cppkeywords.put("typeid".toCharArray(), IToken.t_typeid); //$NON-NLS-1$ + cppkeywords.put("typename".toCharArray(), IToken.t_typename); //$NON-NLS-1$ + cppkeywords.put("using".toCharArray(), IToken.t_using); //$NON-NLS-1$ + cppkeywords.put("virtual".toCharArray(), IToken.t_virtual); //$NON-NLS-1$ + cppkeywords.put("wchar_t".toCharArray(), IToken.t_wchar_t); //$NON-NLS-1$ // C++ operator alternative - keywords.put("and".toCharArray(), IToken.t_and); //$NON-NLS-1$ - keywords.put("and_eq".toCharArray(), IToken.t_and_eq); //$NON-NLS-1$ - keywords.put("bitand".toCharArray(), IToken.t_bitand); //$NON-NLS-1$ - keywords.put("bitor".toCharArray(), IToken.t_bitor); //$NON-NLS-1$ - keywords.put("compl".toCharArray(), IToken.t_compl); //$NON-NLS-1$ - keywords.put("not".toCharArray(), IToken.t_not); //$NON-NLS-1$ - keywords.put("not_eq".toCharArray(), IToken.t_not_eq); //$NON-NLS-1$ - keywords.put("or".toCharArray(), IToken.t_or); //$NON-NLS-1$ - keywords.put("or_eq".toCharArray(), IToken.t_or_eq); //$NON-NLS-1$ - keywords.put("xor".toCharArray(), IToken.t_xor); //$NON-NLS-1$ - keywords.put("xor_eq".toCharArray(), IToken.t_xor_eq); //$NON-NLS-1$ + cppkeywords.put("and".toCharArray(), IToken.t_and); //$NON-NLS-1$ + cppkeywords.put("and_eq".toCharArray(), IToken.t_and_eq); //$NON-NLS-1$ + cppkeywords.put("bitand".toCharArray(), IToken.t_bitand); //$NON-NLS-1$ + cppkeywords.put("bitor".toCharArray(), IToken.t_bitor); //$NON-NLS-1$ + cppkeywords.put("compl".toCharArray(), IToken.t_compl); //$NON-NLS-1$ + cppkeywords.put("not".toCharArray(), IToken.t_not); //$NON-NLS-1$ + cppkeywords.put("not_eq".toCharArray(), IToken.t_not_eq); //$NON-NLS-1$ + cppkeywords.put("or".toCharArray(), IToken.t_or); //$NON-NLS-1$ + cppkeywords.put("or_eq".toCharArray(), IToken.t_or_eq); //$NON-NLS-1$ + cppkeywords.put("xor".toCharArray(), IToken.t_xor); //$NON-NLS-1$ + cppkeywords.put("xor_eq".toCharArray(), IToken.t_xor_eq); //$NON-NLS-1$ // Preprocessor keywords ppKeywords = new CharArrayIntMap(16, -1);