|
|
|
@ -11,7 +11,7 @@ using Roles = ICSharpCode.NRefactory.VB.AstNode.Roles;
@@ -11,7 +11,7 @@ using Roles = ICSharpCode.NRefactory.VB.AstNode.Roles;
|
|
|
|
|
|
|
|
|
|
COMPILER VB |
|
|
|
|
|
|
|
|
|
/* START AUTOGENERATED TOKENS SECTION */ |
|
|
|
|
#region AUTOGENERATED TOKENS SECTION |
|
|
|
|
TOKENS |
|
|
|
|
/* ----- terminal classes ----- */ |
|
|
|
|
/* EOF is 0 */ |
|
|
|
@ -24,16 +24,16 @@ TOKENS
@@ -24,16 +24,16 @@ TOKENS
|
|
|
|
|
LiteralSingle |
|
|
|
|
LiteralDecimal |
|
|
|
|
LiteralDate |
|
|
|
|
XmlOpenTag |
|
|
|
|
XmlCloseTag |
|
|
|
|
XmlStartInlineVB |
|
|
|
|
XmlEndInlineVB |
|
|
|
|
XmlCloseTagEmptyElement |
|
|
|
|
XmlOpenEndTag |
|
|
|
|
XmlContent |
|
|
|
|
XmlComment |
|
|
|
|
XmlCData |
|
|
|
|
XmlProcessingInstruction |
|
|
|
|
XmlOpenTag // < |
|
|
|
|
XmlCloseTag // > |
|
|
|
|
XmlStartInlineVB // <%= |
|
|
|
|
XmlEndInlineVB // %> |
|
|
|
|
XmlCloseTagEmptyElement // /> |
|
|
|
|
XmlOpenEndTag // </ |
|
|
|
|
XmlContent // ... |
|
|
|
|
XmlComment // <!-- ... --> |
|
|
|
|
XmlCData // <![CDATA[...]]> |
|
|
|
|
XmlProcessingInstruction |
|
|
|
|
|
|
|
|
|
/* ----- special character ----- */ |
|
|
|
|
"=" |
|
|
|
@ -256,7 +256,7 @@ TOKENS
@@ -256,7 +256,7 @@ TOKENS
|
|
|
|
|
"WriteOnly" |
|
|
|
|
"Xor" |
|
|
|
|
"GetXmlNamespace" |
|
|
|
|
/* END AUTOGENERATED TOKENS SECTION */ |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
PRODUCTIONS |
|
|
|
|
|
|
|
|
@ -269,14 +269,129 @@ VB =
@@ -269,14 +269,129 @@ VB =
|
|
|
|
|
Get(); |
|
|
|
|
.) |
|
|
|
|
{ StatementTerminator } |
|
|
|
|
{ OptionStatement<CompilationUnit.MemberRole> { StatementTerminator } } |
|
|
|
|
/* { ImportsStmt { StatementTerminator } } |
|
|
|
|
{ OptionStatement<CompilationUnit.MemberRole> { StatementTerminator } } |
|
|
|
|
/* { ImportsStatement<CompilationUnit.MemberRole> { StatementTerminator } } |
|
|
|
|
{ IF (IsGlobalAttrTarget()) GlobalAttributeSection { StatementTerminator } } |
|
|
|
|
{ NamespaceMemberDecl { StatementTerminator } } */ |
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
StatementTerminator = SYNC ( EOL<Roles.StatementTerminator> | ":"<Roles.StatementTerminator> ) . |
|
|
|
|
|
|
|
|
|
/* IdentifierOrKeyword<out string identifier> = ANY (. identifier = t.val; .) . |
|
|
|
|
|
|
|
|
|
// This production handles pseudo keywords that are needed in the grammar |
|
|
|
|
Identifier = |
|
|
|
|
IdentifierForFieldDeclaration |
|
|
|
|
| "Custom" |
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
IdentifierForFieldDeclaration = |
|
|
|
|
ident |
|
|
|
|
| "Aggregate" |
|
|
|
|
| "Ansi" |
|
|
|
|
| "Ascending" |
|
|
|
|
| "Assembly" |
|
|
|
|
| "Auto" |
|
|
|
|
| "Binary" |
|
|
|
|
| "By" |
|
|
|
|
| "Compare" |
|
|
|
|
| "Descending" |
|
|
|
|
| "Distinct" |
|
|
|
|
| "Equals" |
|
|
|
|
| "Explicit" |
|
|
|
|
| "From" |
|
|
|
|
| "Group" |
|
|
|
|
| "Infer" |
|
|
|
|
| "Into" |
|
|
|
|
| "Join" |
|
|
|
|
| "Key" |
|
|
|
|
| "Off" |
|
|
|
|
| "Order" |
|
|
|
|
| "Out" |
|
|
|
|
| "Preserve" |
|
|
|
|
| "Skip" |
|
|
|
|
| "Take" |
|
|
|
|
| "Text" |
|
|
|
|
| "Unicode" |
|
|
|
|
| "Until" |
|
|
|
|
| "Where" |
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
TypeName<out AstType type> = |
|
|
|
|
(. type = null; .) |
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
PrimitiveTypeName<out string type> |
|
|
|
|
(. type = String.Empty; .) = |
|
|
|
|
"Boolean" (. type = "System.Boolean"; .) |
|
|
|
|
| "Date" (. type = "System.DateTime"; .) |
|
|
|
|
| "Char" (. type = "System.Char"; .) |
|
|
|
|
| "String" (. type = "System.String"; .) |
|
|
|
|
| "Decimal" (. type = "System.Decimal"; .) |
|
|
|
|
| "Byte" (. type = "System.Byte"; .) |
|
|
|
|
| "Short" (. type = "System.Int16"; .) |
|
|
|
|
| "Integer" (. type = "System.Int32"; .) |
|
|
|
|
| "Long" (. type = "System.Int64"; .) |
|
|
|
|
| "Single" (. type = "System.Single"; .) |
|
|
|
|
| "Double" (. type = "System.Double"; .) |
|
|
|
|
| "UInteger" (. type = "System.UInt32"; .) |
|
|
|
|
| "ULong" (. type = "System.UInt64"; .) |
|
|
|
|
| "UShort" (. type = "System.UInt16"; .) |
|
|
|
|
| "SByte" (. type = "System.SByte"; .) |
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
ParameterModifier<ParamModifierList m> = |
|
|
|
|
"ByVal" (. m.Add(ParameterModifiers.In); .) |
|
|
|
|
| "ByRef" (. m.Add(ParameterModifiers.Ref); .) |
|
|
|
|
| "Optional" (. m.Add(ParameterModifiers.Optional); .) |
|
|
|
|
| "ParamArray" (. m.Add(ParameterModifiers.Params); .) |
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
TypeModifier<ModifierList m> = |
|
|
|
|
"Public" (. m.Add(Modifiers.Public, t.Location); .) |
|
|
|
|
| "Protected" (. m.Add(Modifiers.Protected, t.Location); .) |
|
|
|
|
| "Friend" (. m.Add(Modifiers.Internal, t.Location); .) |
|
|
|
|
| "Private" (. m.Add(Modifiers.Private, t.Location); .) |
|
|
|
|
| "Shared" (. m.Add(Modifiers.Static, t.Location); .) |
|
|
|
|
| "Shadows" (. m.Add(Modifiers.New, t.Location); .) |
|
|
|
|
| "MustInherit" (. m.Add(Modifiers.Abstract, t.Location); .) |
|
|
|
|
| "NotInheritable" (. m.Add(Modifiers.Sealed, t.Location); .) |
|
|
|
|
| "Partial" (. m.Add(Modifiers.Partial, t.Location); .) |
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
MemberModifier<ModifierList m> = |
|
|
|
|
"MustInherit" (.m.Add(Modifiers.Abstract, t.Location);.) |
|
|
|
|
| "Default" (.m.Add(Modifiers.Default, t.Location);.) |
|
|
|
|
| "Friend" (.m.Add(Modifiers.Internal, t.Location);.) |
|
|
|
|
| "Shadows" (.m.Add(Modifiers.New, t.Location);.) |
|
|
|
|
| "Overrides" (.m.Add(Modifiers.Override, t.Location);.) |
|
|
|
|
| "MustOverride" (.m.Add(Modifiers.Abstract, t.Location);.) |
|
|
|
|
| "Private" (.m.Add(Modifiers.Private, t.Location);.) |
|
|
|
|
| "Protected" (.m.Add(Modifiers.Protected, t.Location);.) |
|
|
|
|
| "Public" (.m.Add(Modifiers.Public, t.Location);.) |
|
|
|
|
| "NotInheritable" (.m.Add(Modifiers.Sealed, t.Location);.) |
|
|
|
|
| "NotOverridable" (.m.Add(Modifiers.Sealed, t.Location);.) |
|
|
|
|
| "Shared" (.m.Add(Modifiers.Static, t.Location);.) |
|
|
|
|
| "Overridable" (.m.Add(Modifiers.Virtual, t.Location);.) |
|
|
|
|
| "Overloads" (.m.Add(Modifiers.Overloads, t.Location);.) |
|
|
|
|
| "ReadOnly" (.m.Add(Modifiers.ReadOnly, t.Location);.) |
|
|
|
|
| "WriteOnly" (.m.Add(Modifiers.WriteOnly, t.Location);.) |
|
|
|
|
| "WithEvents" (.m.Add(Modifiers.WithEvents, t.Location);.) |
|
|
|
|
| "Dim" (.m.Add(Modifiers.Dim, t.Location);.) |
|
|
|
|
| "Partial" (.m.Add(Modifiers.Partial, t.Location);.) |
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
PropertyAccessorAccessModifier<out Modifiers m> = |
|
|
|
|
(. m = Modifiers.None; .) |
|
|
|
|
{ |
|
|
|
|
"Public" (. m |= Modifiers.Public; .) |
|
|
|
|
| "Protected" (. m |= Modifiers.Protected; .) |
|
|
|
|
| "Friend" (. m |= Modifiers.Internal; .) |
|
|
|
|
| "Private" (. m |= Modifiers.Private; .) |
|
|
|
|
} |
|
|
|
|
. |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
#region Global |
|
|
|
@ -304,6 +419,32 @@ BinaryText<OptionStatement os> =
@@ -304,6 +419,32 @@ BinaryText<OptionStatement os> =
|
|
|
|
|
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
#region ImportsStatement |
|
|
|
|
/* |
|
|
|
|
ImportsStatement<auto> = |
|
|
|
|
"Imports"<Roles.Keyword> ImportsClause { "," ImportsClause } StatementTerminator |
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
ImportsClause = |
|
|
|
|
AliasImportsClause<Ast.ImportsStatement.ImportsClauseRole> | |
|
|
|
|
MemberImportsClause<Ast.ImportsStatement.ImportsClauseRole> | |
|
|
|
|
XmlNamespaceImportsClause<Ast.ImportsStatement.ImportsClauseRole> . |
|
|
|
|
|
|
|
|
|
AliasImportsClause<auto> = |
|
|
|
|
// Type characters are not allowed in identifiers here |
|
|
|
|
Identifier (. result.Name = t.val; .) "=" TypeName<out alias> (. result.Alias = alias; .) |
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
MemberImportsClause<auto> = |
|
|
|
|
TypeName<out member> (. result.Member = member; .) |
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
XmlNamespaceImportsClause<auto> = |
|
|
|
|
XmlOpenTag<Roles.XmlOpenTag> ident<Roles.XmlIdentifier> "="<Roles.Assign> LiteralString<Roles.XmlLiteralString> XmlCloseTag<Roles.XmlCloseTag> |
|
|
|
|
. |
|
|
|
|
*/ |
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
END VB . |
|
|
|
|