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);
print "done.\n"; print "done.\n";
#analyse infile #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) { foreach (@raw_data) {
if ($_=~/^\s*\$(\w+)\s*=\s*(\S+)\s*$/) { if ($_=~/^\s*\$(\w+)\s*=\s*(\S+)\s*$/) {
@ -135,7 +135,7 @@ sub write_keywordfile
sub write_token { sub write_token {
$formattedString = sprintf("%-20s", ucfirst $tokenName); $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"; print DAT "\t\tnew public const int $formattedString = $tokenValue;\n";
} else { } else {
print DAT "\t\tpublic const int $formattedString = $tokenValue;\n"; print DAT "\t\tpublic const int $formattedString = $tokenValue;\n";

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

@ -66,16 +66,19 @@ ConcatStringAssign = "&="
# Keywordlist # Keywordlist
"AddHandler" "AddHandler"
"AddressOf" "AddressOf"
"Aggregate"
"Alias" "Alias"
"And" "And"
"AndAlso" "AndAlso"
"Ansi" "Ansi"
"As" "As"
"Ascending"
"Assembly" "Assembly"
"Auto" "Auto"
"Binary" "Binary"
"Boolean" "Boolean"
"ByRef" "ByRef"
"By"
"Byte" "Byte"
"ByVal" "ByVal"
"Call" "Call"
@ -109,8 +112,10 @@ ConcatStringAssign = "&="
"Declare" "Declare"
"Default" "Default"
"Delegate" "Delegate"
"Descending"
"Dim" "Dim"
"DirectCast" "DirectCast"
"Distinct"
"Do" "Do"
"Double" "Double"
"Each" "Each"
@ -119,6 +124,7 @@ ConcatStringAssign = "&="
"End" "End"
"EndIf" "EndIf"
"Enum" "Enum"
"Equals"
"Erase" "Erase"
"Error" "Error"
"Event" "Event"
@ -128,12 +134,14 @@ ConcatStringAssign = "&="
"Finally" "Finally"
"For" "For"
"Friend" "Friend"
"From"
"Function" "Function"
"Get" "Get"
"GetType" "GetType"
"Global" "Global"
"GoSub" "GoSub"
"GoTo" "GoTo"
"Group"
"Handles" "Handles"
"If" "If"
"Implements" "Implements"
@ -143,9 +151,11 @@ ConcatStringAssign = "&="
"Inherits" "Inherits"
"Integer" "Integer"
"Interface" "Interface"
"Into"
"Is" "Is"
"IsNot" "IsNot"
# Note: IsTrue and IsFalse are 'NOT' keywords they're only valid in Operator declarations (like get/set/value are no C# 'keywords') # Note: IsTrue and IsFalse are 'NOT' keywords they're only valid in Operator declarations (like get/set/value are no C# 'keywords')
"Join"
"Let" "Let"
"Lib" "Lib"
"Like" "Like"
@ -174,6 +184,7 @@ ConcatStringAssign = "&="
"Option" "Option"
"Optional" "Optional"
"Or" "Or"
"Order"
"OrElse" "OrElse"
"Overloads" "Overloads"
"Overridable" "Overridable"
@ -200,6 +211,7 @@ ConcatStringAssign = "&="
"Shared" "Shared"
"Short" "Short"
"Single" "Single"
"Skip"
"Static" "Static"
"Step" "Step"
"Stop" "Stop"
@ -208,6 +220,7 @@ ConcatStringAssign = "&="
"Structure" "Structure"
"Sub" "Sub"
"SyncLock" "SyncLock"
"Take"
"Text" "Text"
"Then" "Then"
"Throw" "Throw"
@ -225,6 +238,7 @@ ConcatStringAssign = "&="
"Variant" "Variant"
"Wend" "Wend"
"When" "When"
"Where"
"While" "While"
"Widening" "Widening"
"With" "With"
@ -237,4 +251,4 @@ Null("Nothing")
BlockSucc("Case", "Catch", "Else", "ElseIf", "End", "Finally", "Loop", "Next") 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 # 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
static readonly string[] keywordList = { static readonly string[] keywordList = {
"ADDHANDLER", "ADDHANDLER",
"ADDRESSOF", "ADDRESSOF",
"AGGREGATE",
"ALIAS", "ALIAS",
"AND", "AND",
"ANDALSO", "ANDALSO",
"ANSI", "ANSI",
"AS", "AS",
"ASCENDING",
"ASSEMBLY", "ASSEMBLY",
"AUTO", "AUTO",
"BINARY", "BINARY",
"BOOLEAN", "BOOLEAN",
"BYREF", "BYREF",
"BY",
"BYTE", "BYTE",
"BYVAL", "BYVAL",
"CALL", "CALL",
@ -51,8 +54,10 @@ namespace ICSharpCode.NRefactory.Parser.VB
"DECLARE", "DECLARE",
"DEFAULT", "DEFAULT",
"DELEGATE", "DELEGATE",
"DESCENDING",
"DIM", "DIM",
"DIRECTCAST", "DIRECTCAST",
"DISTINCT",
"DO", "DO",
"DOUBLE", "DOUBLE",
"EACH", "EACH",
@ -61,6 +66,7 @@ namespace ICSharpCode.NRefactory.Parser.VB
"END", "END",
"ENDIF", "ENDIF",
"ENUM", "ENUM",
"EQUALS",
"ERASE", "ERASE",
"ERROR", "ERROR",
"EVENT", "EVENT",
@ -70,12 +76,14 @@ namespace ICSharpCode.NRefactory.Parser.VB
"FINALLY", "FINALLY",
"FOR", "FOR",
"FRIEND", "FRIEND",
"FROM",
"FUNCTION", "FUNCTION",
"GET", "GET",
"GETTYPE", "GETTYPE",
"GLOBAL", "GLOBAL",
"GOSUB", "GOSUB",
"GOTO", "GOTO",
"GROUP",
"HANDLES", "HANDLES",
"IF", "IF",
"IMPLEMENTS", "IMPLEMENTS",
@ -85,8 +93,10 @@ namespace ICSharpCode.NRefactory.Parser.VB
"INHERITS", "INHERITS",
"INTEGER", "INTEGER",
"INTERFACE", "INTERFACE",
"INTO",
"IS", "IS",
"ISNOT", "ISNOT",
"JOIN",
"LET", "LET",
"LIB", "LIB",
"LIKE", "LIKE",
@ -115,6 +125,7 @@ namespace ICSharpCode.NRefactory.Parser.VB
"OPTION", "OPTION",
"OPTIONAL", "OPTIONAL",
"OR", "OR",
"ORDER",
"ORELSE", "ORELSE",
"OVERLOADS", "OVERLOADS",
"OVERRIDABLE", "OVERRIDABLE",
@ -140,6 +151,7 @@ namespace ICSharpCode.NRefactory.Parser.VB
"SHARED", "SHARED",
"SHORT", "SHORT",
"SINGLE", "SINGLE",
"SKIP",
"STATIC", "STATIC",
"STEP", "STEP",
"STOP", "STOP",
@ -148,6 +160,7 @@ namespace ICSharpCode.NRefactory.Parser.VB
"STRUCTURE", "STRUCTURE",
"SUB", "SUB",
"SYNCLOCK", "SYNCLOCK",
"TAKE",
"TEXT", "TEXT",
"THEN", "THEN",
"THROW", "THROW",
@ -165,6 +178,7 @@ namespace ICSharpCode.NRefactory.Parser.VB
"VARIANT", "VARIANT",
"WEND", "WEND",
"WHEN", "WHEN",
"WHERE",
"WHILE", "WHILE",
"WIDENING", "WIDENING",
"WITH", "WITH",

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

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

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

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

Loading…
Cancel
Save