Browse Source

VB.NET tokens for QueryExpression

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@3383 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Markus Palme 18 years ago
parent
commit
d5333fe80f
  1. 4
      src/Libraries/NRefactory/Project/Src/Lexer/BuildKeywords.pl
  2. 16
      src/Libraries/NRefactory/Project/Src/Lexer/VBNet/KeywordList.txt
  3. 14
      src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Keywords.cs
  4. 358
      src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Tokens.cs
  5. 3897
      src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs
  6. 55
      src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG
  7. 85
      src/Libraries/NRefactory/Test/Lexer/VBNet/LexerTests.cs

4
src/Libraries/NRefactory/Project/Src/Lexer/BuildKeywords.pl

@ -16,7 +16,7 @@ close(DAT); @@ -16,7 +16,7 @@ close(DAT);
print "done.\n";
#analyse infile
print "starting analysation ... this could take a few minutes.\n";
print "starting analysis... this could take a few seconds.\n";
foreach (@raw_data) {
if ($_=~/^\s*\$(\w+)\s*=\s*(\S+)\s*$/) {
@ -135,7 +135,7 @@ sub write_keywordfile @@ -135,7 +135,7 @@ sub write_keywordfile
sub write_token {
$formattedString = sprintf("%-20s", ucfirst $tokenName);
if (($tokenName eq "GetType") or ($tokenName eq "equals")) {
if (($tokenName eq "GetType") or ($tokenName eq "equals") or ($tokenName eq "Equals")) {
print DAT "\t\tnew public const int $formattedString = $tokenValue;\n";
} else {
print DAT "\t\tpublic const int $formattedString = $tokenValue;\n";

16
src/Libraries/NRefactory/Project/Src/Lexer/VBNet/KeywordList.txt

@ -66,16 +66,19 @@ ConcatStringAssign = "&=" @@ -66,16 +66,19 @@ ConcatStringAssign = "&="
# Keywordlist
"AddHandler"
"AddressOf"
"Aggregate"
"Alias"
"And"
"AndAlso"
"Ansi"
"As"
"Ascending"
"Assembly"
"Auto"
"Binary"
"Boolean"
"ByRef"
"By"
"Byte"
"ByVal"
"Call"
@ -109,8 +112,10 @@ ConcatStringAssign = "&=" @@ -109,8 +112,10 @@ ConcatStringAssign = "&="
"Declare"
"Default"
"Delegate"
"Descending"
"Dim"
"DirectCast"
"Distinct"
"Do"
"Double"
"Each"
@ -119,6 +124,7 @@ ConcatStringAssign = "&=" @@ -119,6 +124,7 @@ ConcatStringAssign = "&="
"End"
"EndIf"
"Enum"
"Equals"
"Erase"
"Error"
"Event"
@ -128,12 +134,14 @@ ConcatStringAssign = "&=" @@ -128,12 +134,14 @@ ConcatStringAssign = "&="
"Finally"
"For"
"Friend"
"From"
"Function"
"Get"
"GetType"
"Global"
"GoSub"
"GoTo"
"Group"
"Handles"
"If"
"Implements"
@ -143,9 +151,11 @@ ConcatStringAssign = "&=" @@ -143,9 +151,11 @@ ConcatStringAssign = "&="
"Inherits"
"Integer"
"Interface"
"Into"
"Is"
"IsNot"
# Note: IsTrue and IsFalse are 'NOT' keywords they're only valid in Operator declarations (like get/set/value are no C# 'keywords')
"Join"
"Let"
"Lib"
"Like"
@ -174,6 +184,7 @@ ConcatStringAssign = "&=" @@ -174,6 +184,7 @@ ConcatStringAssign = "&="
"Option"
"Optional"
"Or"
"Order"
"OrElse"
"Overloads"
"Overridable"
@ -200,6 +211,7 @@ ConcatStringAssign = "&=" @@ -200,6 +211,7 @@ ConcatStringAssign = "&="
"Shared"
"Short"
"Single"
"Skip"
"Static"
"Step"
"Stop"
@ -208,6 +220,7 @@ ConcatStringAssign = "&=" @@ -208,6 +220,7 @@ ConcatStringAssign = "&="
"Structure"
"Sub"
"SyncLock"
"Take"
"Text"
"Then"
"Throw"
@ -225,6 +238,7 @@ ConcatStringAssign = "&=" @@ -225,6 +238,7 @@ ConcatStringAssign = "&="
"Variant"
"Wend"
"When"
"Where"
"While"
"Widening"
"With"
@ -237,4 +251,4 @@ Null("Nothing") @@ -237,4 +251,4 @@ Null("Nothing")
BlockSucc("Case", "Catch", "Else", "ElseIf", "End", "Finally", "Loop", "Next")
# List of keywords that are valid identifiers, must be the same as the "Identifier" production in VBNET.ATG
IdentifierTokens("Text", "Binary", "Compare", "Assembly", "Ansi", "Auto", "Preserve", "Unicode", "Until", "Explicit", "Off")
IdentifierTokens("Text", "Binary", "Compare", "Assembly", "Ansi", "Auto", "Preserve", "Unicode", "Until", "Off", "Explicit", "Infer", "From", "Join", "Equals", "Distinct", "Where", "Take", "Skip", "Order", "By", "Ascending", "Descending", "Group", "Into", "Aggregate")

14
src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Keywords.cs

@ -8,16 +8,19 @@ namespace ICSharpCode.NRefactory.Parser.VB @@ -8,16 +8,19 @@ namespace ICSharpCode.NRefactory.Parser.VB
static readonly string[] keywordList = {
"ADDHANDLER",
"ADDRESSOF",
"AGGREGATE",
"ALIAS",
"AND",
"ANDALSO",
"ANSI",
"AS",
"ASCENDING",
"ASSEMBLY",
"AUTO",
"BINARY",
"BOOLEAN",
"BYREF",
"BY",
"BYTE",
"BYVAL",
"CALL",
@ -51,8 +54,10 @@ namespace ICSharpCode.NRefactory.Parser.VB @@ -51,8 +54,10 @@ namespace ICSharpCode.NRefactory.Parser.VB
"DECLARE",
"DEFAULT",
"DELEGATE",
"DESCENDING",
"DIM",
"DIRECTCAST",
"DISTINCT",
"DO",
"DOUBLE",
"EACH",
@ -61,6 +66,7 @@ namespace ICSharpCode.NRefactory.Parser.VB @@ -61,6 +66,7 @@ namespace ICSharpCode.NRefactory.Parser.VB
"END",
"ENDIF",
"ENUM",
"EQUALS",
"ERASE",
"ERROR",
"EVENT",
@ -70,12 +76,14 @@ namespace ICSharpCode.NRefactory.Parser.VB @@ -70,12 +76,14 @@ namespace ICSharpCode.NRefactory.Parser.VB
"FINALLY",
"FOR",
"FRIEND",
"FROM",
"FUNCTION",
"GET",
"GETTYPE",
"GLOBAL",
"GOSUB",
"GOTO",
"GROUP",
"HANDLES",
"IF",
"IMPLEMENTS",
@ -85,8 +93,10 @@ namespace ICSharpCode.NRefactory.Parser.VB @@ -85,8 +93,10 @@ namespace ICSharpCode.NRefactory.Parser.VB
"INHERITS",
"INTEGER",
"INTERFACE",
"INTO",
"IS",
"ISNOT",
"JOIN",
"LET",
"LIB",
"LIKE",
@ -115,6 +125,7 @@ namespace ICSharpCode.NRefactory.Parser.VB @@ -115,6 +125,7 @@ namespace ICSharpCode.NRefactory.Parser.VB
"OPTION",
"OPTIONAL",
"OR",
"ORDER",
"ORELSE",
"OVERLOADS",
"OVERRIDABLE",
@ -140,6 +151,7 @@ namespace ICSharpCode.NRefactory.Parser.VB @@ -140,6 +151,7 @@ namespace ICSharpCode.NRefactory.Parser.VB
"SHARED",
"SHORT",
"SINGLE",
"SKIP",
"STATIC",
"STEP",
"STOP",
@ -148,6 +160,7 @@ namespace ICSharpCode.NRefactory.Parser.VB @@ -148,6 +160,7 @@ namespace ICSharpCode.NRefactory.Parser.VB
"STRUCTURE",
"SUB",
"SYNCLOCK",
"TAKE",
"TEXT",
"THEN",
"THROW",
@ -165,6 +178,7 @@ namespace ICSharpCode.NRefactory.Parser.VB @@ -165,6 +178,7 @@ namespace ICSharpCode.NRefactory.Parser.VB
"VARIANT",
"WEND",
"WHEN",
"WHERE",
"WHILE",
"WIDENING",
"WITH",

358
src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Tokens.cs

@ -56,171 +56,185 @@ namespace ICSharpCode.NRefactory.Parser.VB @@ -56,171 +56,185 @@ namespace ICSharpCode.NRefactory.Parser.VB
// ----- keywords -----
public const int AddHandler = 43;
public const int AddressOf = 44;
public const int Alias = 45;
public const int And = 46;
public const int AndAlso = 47;
public const int Ansi = 48;
public const int As = 49;
public const int Assembly = 50;
public const int Auto = 51;
public const int Binary = 52;
public const int Boolean = 53;
public const int ByRef = 54;
public const int Byte = 55;
public const int ByVal = 56;
public const int Call = 57;
public const int Case = 58;
public const int Catch = 59;
public const int CBool = 60;
public const int CByte = 61;
public const int CChar = 62;
public const int CDate = 63;
public const int CDbl = 64;
public const int CDec = 65;
public const int Char = 66;
public const int CInt = 67;
public const int Class = 68;
public const int CLng = 69;
public const int CObj = 70;
public const int Compare = 71;
public const int Const = 72;
public const int Continue = 73;
public const int CSByte = 74;
public const int CShort = 75;
public const int CSng = 76;
public const int CStr = 77;
public const int CType = 78;
public const int CUInt = 79;
public const int CULng = 80;
public const int CUShort = 81;
public const int Custom = 82;
public const int Date = 83;
public const int Decimal = 84;
public const int Declare = 85;
public const int Default = 86;
public const int Delegate = 87;
public const int Dim = 88;
public const int DirectCast = 89;
public const int Do = 90;
public const int Double = 91;
public const int Each = 92;
public const int Else = 93;
public const int ElseIf = 94;
public const int End = 95;
public const int EndIf = 96;
public const int Enum = 97;
public const int Erase = 98;
public const int Error = 99;
public const int Event = 100;
public const int Exit = 101;
public const int Explicit = 102;
public const int False = 103;
public const int Finally = 104;
public const int For = 105;
public const int Friend = 106;
public const int Function = 107;
public const int Get = 108;
new public const int GetType = 109;
public const int Global = 110;
public const int GoSub = 111;
public const int GoTo = 112;
public const int Handles = 113;
public const int If = 114;
public const int Implements = 115;
public const int Imports = 116;
public const int In = 117;
public const int Infer = 118;
public const int Inherits = 119;
public const int Integer = 120;
public const int Interface = 121;
public const int Is = 122;
public const int IsNot = 123;
public const int Let = 124;
public const int Lib = 125;
public const int Like = 126;
public const int Long = 127;
public const int Loop = 128;
public const int Me = 129;
public const int Mod = 130;
public const int Module = 131;
public const int MustInherit = 132;
public const int MustOverride = 133;
public const int MyBase = 134;
public const int MyClass = 135;
public const int Namespace = 136;
public const int Narrowing = 137;
public const int New = 138;
public const int Next = 139;
public const int Not = 140;
public const int Nothing = 141;
public const int NotInheritable = 142;
public const int NotOverridable = 143;
public const int Object = 144;
public const int Of = 145;
public const int Off = 146;
public const int On = 147;
public const int Operator = 148;
public const int Option = 149;
public const int Optional = 150;
public const int Or = 151;
public const int OrElse = 152;
public const int Overloads = 153;
public const int Overridable = 154;
public const int Overrides = 155;
public const int ParamArray = 156;
public const int Partial = 157;
public const int Preserve = 158;
public const int Private = 159;
public const int Property = 160;
public const int Protected = 161;
public const int Public = 162;
public const int RaiseEvent = 163;
public const int ReadOnly = 164;
public const int ReDim = 165;
public const int Rem = 166;
public const int RemoveHandler = 167;
public const int Resume = 168;
public const int Return = 169;
public const int SByte = 170;
public const int Select = 171;
public const int Set = 172;
public const int Shadows = 173;
public const int Shared = 174;
public const int Short = 175;
public const int Single = 176;
public const int Static = 177;
public const int Step = 178;
public const int Stop = 179;
public const int Strict = 180;
public const int String = 181;
public const int Structure = 182;
public const int Sub = 183;
public const int SyncLock = 184;
public const int Text = 185;
public const int Then = 186;
public const int Throw = 187;
public const int To = 188;
public const int True = 189;
public const int Try = 190;
public const int TryCast = 191;
public const int TypeOf = 192;
public const int UInteger = 193;
public const int ULong = 194;
public const int Unicode = 195;
public const int Until = 196;
public const int UShort = 197;
public const int Using = 198;
public const int Variant = 199;
public const int Wend = 200;
public const int When = 201;
public const int While = 202;
public const int Widening = 203;
public const int With = 204;
public const int WithEvents = 205;
public const int WriteOnly = 206;
public const int Xor = 207;
public const int Aggregate = 45;
public const int Alias = 46;
public const int And = 47;
public const int AndAlso = 48;
public const int Ansi = 49;
public const int As = 50;
public const int Ascending = 51;
public const int Assembly = 52;
public const int Auto = 53;
public const int Binary = 54;
public const int Boolean = 55;
public const int ByRef = 56;
public const int By = 57;
public const int Byte = 58;
public const int ByVal = 59;
public const int Call = 60;
public const int Case = 61;
public const int Catch = 62;
public const int CBool = 63;
public const int CByte = 64;
public const int CChar = 65;
public const int CDate = 66;
public const int CDbl = 67;
public const int CDec = 68;
public const int Char = 69;
public const int CInt = 70;
public const int Class = 71;
public const int CLng = 72;
public const int CObj = 73;
public const int Compare = 74;
public const int Const = 75;
public const int Continue = 76;
public const int CSByte = 77;
public const int CShort = 78;
public const int CSng = 79;
public const int CStr = 80;
public const int CType = 81;
public const int CUInt = 82;
public const int CULng = 83;
public const int CUShort = 84;
public const int Custom = 85;
public const int Date = 86;
public const int Decimal = 87;
public const int Declare = 88;
public const int Default = 89;
public const int Delegate = 90;
public const int Descending = 91;
public const int Dim = 92;
public const int DirectCast = 93;
public const int Distinct = 94;
public const int Do = 95;
public const int Double = 96;
public const int Each = 97;
public const int Else = 98;
public const int ElseIf = 99;
public const int End = 100;
public const int EndIf = 101;
public const int Enum = 102;
new public const int Equals = 103;
public const int Erase = 104;
public const int Error = 105;
public const int Event = 106;
public const int Exit = 107;
public const int Explicit = 108;
public const int False = 109;
public const int Finally = 110;
public const int For = 111;
public const int Friend = 112;
public const int From = 113;
public const int Function = 114;
public const int Get = 115;
new public const int GetType = 116;
public const int Global = 117;
public const int GoSub = 118;
public const int GoTo = 119;
public const int Group = 120;
public const int Handles = 121;
public const int If = 122;
public const int Implements = 123;
public const int Imports = 124;
public const int In = 125;
public const int Infer = 126;
public const int Inherits = 127;
public const int Integer = 128;
public const int Interface = 129;
public const int Into = 130;
public const int Is = 131;
public const int IsNot = 132;
public const int Join = 133;
public const int Let = 134;
public const int Lib = 135;
public const int Like = 136;
public const int Long = 137;
public const int Loop = 138;
public const int Me = 139;
public const int Mod = 140;
public const int Module = 141;
public const int MustInherit = 142;
public const int MustOverride = 143;
public const int MyBase = 144;
public const int MyClass = 145;
public const int Namespace = 146;
public const int Narrowing = 147;
public const int New = 148;
public const int Next = 149;
public const int Not = 150;
public const int Nothing = 151;
public const int NotInheritable = 152;
public const int NotOverridable = 153;
public const int Object = 154;
public const int Of = 155;
public const int Off = 156;
public const int On = 157;
public const int Operator = 158;
public const int Option = 159;
public const int Optional = 160;
public const int Or = 161;
public const int Order = 162;
public const int OrElse = 163;
public const int Overloads = 164;
public const int Overridable = 165;
public const int Overrides = 166;
public const int ParamArray = 167;
public const int Partial = 168;
public const int Preserve = 169;
public const int Private = 170;
public const int Property = 171;
public const int Protected = 172;
public const int Public = 173;
public const int RaiseEvent = 174;
public const int ReadOnly = 175;
public const int ReDim = 176;
public const int Rem = 177;
public const int RemoveHandler = 178;
public const int Resume = 179;
public const int Return = 180;
public const int SByte = 181;
public const int Select = 182;
public const int Set = 183;
public const int Shadows = 184;
public const int Shared = 185;
public const int Short = 186;
public const int Single = 187;
public const int Skip = 188;
public const int Static = 189;
public const int Step = 190;
public const int Stop = 191;
public const int Strict = 192;
public const int String = 193;
public const int Structure = 194;
public const int Sub = 195;
public const int SyncLock = 196;
public const int Take = 197;
public const int Text = 198;
public const int Then = 199;
public const int Throw = 200;
public const int To = 201;
public const int True = 202;
public const int Try = 203;
public const int TryCast = 204;
public const int TypeOf = 205;
public const int UInteger = 206;
public const int ULong = 207;
public const int Unicode = 208;
public const int Until = 209;
public const int UShort = 210;
public const int Using = 211;
public const int Variant = 212;
public const int Wend = 213;
public const int When = 214;
public const int Where = 215;
public const int While = 216;
public const int Widening = 217;
public const int With = 218;
public const int WithEvents = 219;
public const int WriteOnly = 220;
public const int Xor = 221;
public const int MaxToken = 208;
public const int MaxToken = 222;
static BitArray NewSet(params int[] values)
{
BitArray bitArray = new BitArray(MaxToken);
@ -231,7 +245,7 @@ namespace ICSharpCode.NRefactory.Parser.VB @@ -231,7 +245,7 @@ namespace ICSharpCode.NRefactory.Parser.VB
}
public static BitArray Null = NewSet(Nothing);
public static BitArray BlockSucc = NewSet(Case, Catch, Else, ElseIf, End, Finally, Loop, Next);
public static BitArray IdentifierTokens = NewSet(Text, Binary, Compare, Assembly, Ansi, Auto, Preserve, Unicode, Until, Explicit, Off);
public static BitArray IdentifierTokens = NewSet(Text, Binary, Compare, Assembly, Ansi, Auto, Preserve, Unicode, Until, Off, Explicit, Infer, From, Join, Equals, Distinct, Where, Take, Skip, Order, By, Ascending, Descending, Group, Into, Aggregate);
static string[] tokenList = new string[] {
// ----- terminal classes -----
@ -282,16 +296,19 @@ namespace ICSharpCode.NRefactory.Parser.VB @@ -282,16 +296,19 @@ namespace ICSharpCode.NRefactory.Parser.VB
// ----- keywords -----
"AddHandler",
"AddressOf",
"Aggregate",
"Alias",
"And",
"AndAlso",
"Ansi",
"As",
"Ascending",
"Assembly",
"Auto",
"Binary",
"Boolean",
"ByRef",
"By",
"Byte",
"ByVal",
"Call",
@ -325,8 +342,10 @@ namespace ICSharpCode.NRefactory.Parser.VB @@ -325,8 +342,10 @@ namespace ICSharpCode.NRefactory.Parser.VB
"Declare",
"Default",
"Delegate",
"Descending",
"Dim",
"DirectCast",
"Distinct",
"Do",
"Double",
"Each",
@ -335,6 +354,7 @@ namespace ICSharpCode.NRefactory.Parser.VB @@ -335,6 +354,7 @@ namespace ICSharpCode.NRefactory.Parser.VB
"End",
"EndIf",
"Enum",
"Equals",
"Erase",
"Error",
"Event",
@ -344,12 +364,14 @@ namespace ICSharpCode.NRefactory.Parser.VB @@ -344,12 +364,14 @@ namespace ICSharpCode.NRefactory.Parser.VB
"Finally",
"For",
"Friend",
"From",
"Function",
"Get",
"GetType",
"Global",
"GoSub",
"GoTo",
"Group",
"Handles",
"If",
"Implements",
@ -359,8 +381,10 @@ namespace ICSharpCode.NRefactory.Parser.VB @@ -359,8 +381,10 @@ namespace ICSharpCode.NRefactory.Parser.VB
"Inherits",
"Integer",
"Interface",
"Into",
"Is",
"IsNot",
"Join",
"Let",
"Lib",
"Like",
@ -389,6 +413,7 @@ namespace ICSharpCode.NRefactory.Parser.VB @@ -389,6 +413,7 @@ namespace ICSharpCode.NRefactory.Parser.VB
"Option",
"Optional",
"Or",
"Order",
"OrElse",
"Overloads",
"Overridable",
@ -414,6 +439,7 @@ namespace ICSharpCode.NRefactory.Parser.VB @@ -414,6 +439,7 @@ namespace ICSharpCode.NRefactory.Parser.VB
"Shared",
"Short",
"Single",
"Skip",
"Static",
"Step",
"Stop",
@ -422,6 +448,7 @@ namespace ICSharpCode.NRefactory.Parser.VB @@ -422,6 +448,7 @@ namespace ICSharpCode.NRefactory.Parser.VB
"Structure",
"Sub",
"SyncLock",
"Take",
"Text",
"Then",
"Throw",
@ -439,6 +466,7 @@ namespace ICSharpCode.NRefactory.Parser.VB @@ -439,6 +466,7 @@ namespace ICSharpCode.NRefactory.Parser.VB
"Variant",
"Wend",
"When",
"Where",
"While",
"Widening",
"With",

3897
src/Libraries/NRefactory/Project/Src/Parser/VBNet/Parser.cs

File diff suppressed because it is too large Load Diff

55
src/Libraries/NRefactory/Project/Src/Parser/VBNet/VBNET.ATG

@ -60,16 +60,19 @@ TOKENS @@ -60,16 +60,19 @@ TOKENS
/* ----- keywords ----- */
"AddHandler"
"AddressOf"
"Aggregate"
"Alias"
"And"
"AndAlso"
"Ansi"
"As"
"Ascending"
"Assembly"
"Auto"
"Binary"
"Boolean"
"ByRef"
"By"
"Byte"
"ByVal"
"Call"
@ -103,8 +106,10 @@ TOKENS @@ -103,8 +106,10 @@ TOKENS
"Declare"
"Default"
"Delegate"
"Descending"
"Dim"
"DirectCast"
"Distinct"
"Do"
"Double"
"Each"
@ -113,6 +118,7 @@ TOKENS @@ -113,6 +118,7 @@ TOKENS
"End"
"EndIf"
"Enum"
"Equals"
"Erase"
"Error"
"Event"
@ -122,12 +128,14 @@ TOKENS @@ -122,12 +128,14 @@ TOKENS
"Finally"
"For"
"Friend"
"From"
"Function"
"Get"
"GetType"
"Global"
"GoSub"
"GoTo"
"Group"
"Handles"
"If"
"Implements"
@ -137,8 +145,10 @@ TOKENS @@ -137,8 +145,10 @@ TOKENS
"Inherits"
"Integer"
"Interface"
"Into"
"Is"
"IsNot"
"Join"
"Let"
"Lib"
"Like"
@ -167,6 +177,7 @@ TOKENS @@ -167,6 +177,7 @@ TOKENS
"Option"
"Optional"
"Or"
"Order"
"OrElse"
"Overloads"
"Overridable"
@ -192,6 +203,7 @@ TOKENS @@ -192,6 +203,7 @@ TOKENS
"Shared"
"Short"
"Single"
"Skip"
"Static"
"Step"
"Stop"
@ -200,6 +212,7 @@ TOKENS @@ -200,6 +212,7 @@ TOKENS
"Structure"
"Sub"
"SyncLock"
"Take"
"Text"
"Then"
"Throw"
@ -217,6 +230,7 @@ TOKENS @@ -217,6 +230,7 @@ TOKENS
"Variant"
"Wend"
"When"
"Where"
"While"
"Widening"
"With"
@ -2965,35 +2979,38 @@ Qualident<out string qualident> @@ -2965,35 +2979,38 @@ Qualident<out string qualident>
/* This production handles pseudo keywords that are needed in the grammar */
Identifier =
ident
| "Text"
| "Binary"
| "Compare"
IdentifierForFieldDeclaration
| "Custom"
| "Assembly"
| "Ansi"
| "Auto"
| "Preserve"
| "Unicode"
| "Until"
| "Off"
| "Explicit"
.
IdentifierForFieldDeclaration =
ident
| "Text"
| "Binary"
| "Compare"
| "Assembly"
| "Aggregate"
| "Ansi"
| "Ascending"
| "Assembly"
| "Auto"
| "Binary"
| "By"
| "Compare"
| "Descending"
| "Distinct"
| "Equals"
| "Explicit"
| "From"
| "Group"
| "Infer"
| "Into"
| "Join"
| "Off"
| "Order"
| "Preserve"
| "Skip"
| "Take"
| "Text"
| "Unicode"
| "Until"
| "Off"
| "Explicit"
| "Infer"
| "Where"
.
/* 2.2 */

85
src/Libraries/NRefactory/Test/Lexer/VBNet/LexerTests.cs

@ -260,6 +260,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB @@ -260,6 +260,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB
Assert.AreEqual(Tokens.AddressOf, lexer.NextToken().kind);
}
[Test()]
public void TestAggregate()
{
ILexer lexer = GenerateLexer(new StringReader("Aggregate"));
Assert.AreEqual(Tokens.Aggregate, lexer.NextToken().kind);
}
[Test()]
public void TestAlias()
{
ILexer lexer = GenerateLexer(new StringReader("Alias"));
@ -290,6 +296,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB @@ -290,6 +296,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB
Assert.AreEqual(Tokens.As, lexer.NextToken().kind);
}
[Test()]
public void TestAscending()
{
ILexer lexer = GenerateLexer(new StringReader("Ascending"));
Assert.AreEqual(Tokens.Ascending, lexer.NextToken().kind);
}
[Test()]
public void TestAssembly()
{
ILexer lexer = GenerateLexer(new StringReader("Assembly"));
@ -320,6 +332,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB @@ -320,6 +332,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB
Assert.AreEqual(Tokens.ByRef, lexer.NextToken().kind);
}
[Test()]
public void TestBy()
{
ILexer lexer = GenerateLexer(new StringReader("By"));
Assert.AreEqual(Tokens.By, lexer.NextToken().kind);
}
[Test()]
public void TestByte()
{
ILexer lexer = GenerateLexer(new StringReader("Byte"));
@ -518,6 +536,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB @@ -518,6 +536,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB
Assert.AreEqual(Tokens.Delegate, lexer.NextToken().kind);
}
[Test()]
public void TestDescending()
{
ILexer lexer = GenerateLexer(new StringReader("Descending"));
Assert.AreEqual(Tokens.Descending, lexer.NextToken().kind);
}
[Test()]
public void TestDim()
{
ILexer lexer = GenerateLexer(new StringReader("Dim"));
@ -530,6 +554,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB @@ -530,6 +554,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB
Assert.AreEqual(Tokens.DirectCast, lexer.NextToken().kind);
}
[Test()]
public void TestDistinct()
{
ILexer lexer = GenerateLexer(new StringReader("Distinct"));
Assert.AreEqual(Tokens.Distinct, lexer.NextToken().kind);
}
[Test()]
public void TestDo()
{
ILexer lexer = GenerateLexer(new StringReader("Do"));
@ -578,6 +608,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB @@ -578,6 +608,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB
Assert.AreEqual(Tokens.Enum, lexer.NextToken().kind);
}
[Test()]
public void TestEquals()
{
ILexer lexer = GenerateLexer(new StringReader("Equals"));
Assert.AreEqual(Tokens.Equals, lexer.NextToken().kind);
}
[Test()]
public void TestErase()
{
ILexer lexer = GenerateLexer(new StringReader("Erase"));
@ -632,6 +668,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB @@ -632,6 +668,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB
Assert.AreEqual(Tokens.Friend, lexer.NextToken().kind);
}
[Test()]
public void TestFrom()
{
ILexer lexer = GenerateLexer(new StringReader("From"));
Assert.AreEqual(Tokens.From, lexer.NextToken().kind);
}
[Test()]
public void TestFunction()
{
ILexer lexer = GenerateLexer(new StringReader("Function"));
@ -668,6 +710,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB @@ -668,6 +710,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB
Assert.AreEqual(Tokens.GoTo, lexer.NextToken().kind);
}
[Test()]
public void TestGroup()
{
ILexer lexer = GenerateLexer(new StringReader("Group"));
Assert.AreEqual(Tokens.Group, lexer.NextToken().kind);
}
[Test()]
public void TestHandles()
{
ILexer lexer = GenerateLexer(new StringReader("Handles"));
@ -722,6 +770,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB @@ -722,6 +770,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB
Assert.AreEqual(Tokens.Interface, lexer.NextToken().kind);
}
[Test()]
public void TestInto()
{
ILexer lexer = GenerateLexer(new StringReader("Into"));
Assert.AreEqual(Tokens.Into, lexer.NextToken().kind);
}
[Test()]
public void TestIs()
{
ILexer lexer = GenerateLexer(new StringReader("Is"));
@ -734,6 +788,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB @@ -734,6 +788,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB
Assert.AreEqual(Tokens.IsNot, lexer.NextToken().kind);
}
[Test()]
public void TestJoin()
{
ILexer lexer = GenerateLexer(new StringReader("Join"));
Assert.AreEqual(Tokens.Join, lexer.NextToken().kind);
}
[Test()]
public void TestLet()
{
ILexer lexer = GenerateLexer(new StringReader("Let"));
@ -902,6 +962,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB @@ -902,6 +962,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB
Assert.AreEqual(Tokens.Or, lexer.NextToken().kind);
}
[Test()]
public void TestOrder()
{
ILexer lexer = GenerateLexer(new StringReader("Order"));
Assert.AreEqual(Tokens.Order, lexer.NextToken().kind);
}
[Test()]
public void TestOrElse()
{
ILexer lexer = GenerateLexer(new StringReader("OrElse"));
@ -985,7 +1051,6 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB @@ -985,7 +1051,6 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB
ILexer lexer = GenerateLexer(new StringReader("ReDim"));
Assert.AreEqual(Tokens.ReDim, lexer.NextToken().kind);
}
[Test()]
public void TestRemoveHandler()
{
@ -1047,6 +1112,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB @@ -1047,6 +1112,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB
Assert.AreEqual(Tokens.Single, lexer.NextToken().kind);
}
[Test()]
public void TestSkip()
{
ILexer lexer = GenerateLexer(new StringReader("Skip"));
Assert.AreEqual(Tokens.Skip, lexer.NextToken().kind);
}
[Test()]
public void TestStatic()
{
ILexer lexer = GenerateLexer(new StringReader("Static"));
@ -1095,6 +1166,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB @@ -1095,6 +1166,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB
Assert.AreEqual(Tokens.SyncLock, lexer.NextToken().kind);
}
[Test()]
public void TestTake()
{
ILexer lexer = GenerateLexer(new StringReader("Take"));
Assert.AreEqual(Tokens.Take, lexer.NextToken().kind);
}
[Test()]
public void TestText()
{
ILexer lexer = GenerateLexer(new StringReader("Text"));
@ -1197,6 +1274,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB @@ -1197,6 +1274,12 @@ namespace ICSharpCode.NRefactory.Tests.Lexer.VB
Assert.AreEqual(Tokens.When, lexer.NextToken().kind);
}
[Test()]
public void TestWhere()
{
ILexer lexer = GenerateLexer(new StringReader("Where"));
Assert.AreEqual(Tokens.Where, lexer.NextToken().kind);
}
[Test()]
public void TestWhile()
{
ILexer lexer = GenerateLexer(new StringReader("While"));

Loading…
Cancel
Save