|
|
|
|
@ -278,7 +278,7 @@ ImportsStatement =
@@ -278,7 +278,7 @@ ImportsStatement =
|
|
|
|
|
"Imports" (. PushContext(Context.Importable, la, t); .) |
|
|
|
|
(. nextTokenIsStartOfImportsOrAccessExpression = true; .) |
|
|
|
|
( |
|
|
|
|
( "Global" | Identifier | PrimitiveTypeName ) { TypeSuffix } [ ( "." | "=" ) TypeName ] |
|
|
|
|
( "Global" | Identifier | PrimitiveTypeName ) { TypeSuffix } [ ( "." | "=" ) (. PushContext(Context.Type, la, t); .) TypeName (. PopContext(); .) ] |
|
|
|
|
| XmlOpenTag Identifier "=" LiteralString XmlCloseTag |
|
|
|
|
) |
|
|
|
|
(. PopContext(); .) |
|
|
|
|
@ -328,14 +328,24 @@ ClassOrModuleOrStructureTypeDeclaration =
@@ -328,14 +328,24 @@ ClassOrModuleOrStructureTypeDeclaration =
|
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
EnumTypeDeclaration = |
|
|
|
|
"Enum" Identifier [ "As" TypeName ] StatementTerminator |
|
|
|
|
{ { AttributeBlock } Identifier [ "=" Expression ] StatementTerminator } |
|
|
|
|
(. PushContext(Context.TypeDeclaration, la, t); .) |
|
|
|
|
"Enum" (. PushContext(Context.Identifier, la, t); .) (.OnEachPossiblePath: SetIdentifierExpected(la); .) Identifier (. PopContext(); .) |
|
|
|
|
[ "As" (. PushContext(Context.Type, la, t); .) TypeName (. PopContext(); .) ] StatementTerminator |
|
|
|
|
{ |
|
|
|
|
{ AttributeBlock } |
|
|
|
|
(. PushContext(Context.Identifier, la, t); .) (.OnEachPossiblePath: SetIdentifierExpected(la); .) Identifier (. PopContext(); .) |
|
|
|
|
[ "=" Expression ] |
|
|
|
|
StatementTerminator |
|
|
|
|
} |
|
|
|
|
"End" "Enum" StatementTerminator |
|
|
|
|
(. PopContext(); .) |
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
InterfaceDeclaration = |
|
|
|
|
"Interface" Identifier [ "(" "Of" GenericTypeParameterDeclaration ")" ] StatementTerminator |
|
|
|
|
[ (. PushContext(Context.Type, la, t); .) "Inherits" TypeName (. PopContext(); .) { "," (. PushContext(Context.Type, la, t); .) TypeName (. PopContext(); .) } StatementTerminator ] |
|
|
|
|
(. PushContext(Context.TypeDeclaration, la, t); .) |
|
|
|
|
"Interface" (. PushContext(Context.Identifier, la, t); .) (.OnEachPossiblePath: SetIdentifierExpected(la); .) Identifier (. PopContext(); .) |
|
|
|
|
[ "(" "Of" GenericTypeParameterDeclaration ")" ] StatementTerminator |
|
|
|
|
[ "Inherits" (. PushContext(Context.Type, la, t); .) TypeName (. PopContext(); .) { "," (. PushContext(Context.Type, la, t); .) TypeName (. PopContext(); .) } StatementTerminator ] |
|
|
|
|
{ |
|
|
|
|
{ AttributeBlock } (.OnEachPossiblePath: isMissingModifier = true; .) |
|
|
|
|
{ TypeOrMemberModifier (. isMissingModifier = false; .) } (. isMissingModifier = false; .) |
|
|
|
|
@ -343,7 +353,8 @@ InterfaceDeclaration =
@@ -343,7 +353,8 @@ InterfaceDeclaration =
|
|
|
|
|
| InterfaceDeclaration | InterfaceMemberDeclaration ) |
|
|
|
|
} |
|
|
|
|
(. isMissingModifier = false; .) |
|
|
|
|
"End" "Interface" StatementTerminator |
|
|
|
|
"End" "Interface" StatementTerminator |
|
|
|
|
(. PopContext(); .) |
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
InterfaceMemberDeclaration = |
|
|
|
|
@ -355,11 +366,15 @@ TypeOrMemberModifier =
@@ -355,11 +366,15 @@ TypeOrMemberModifier =
|
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
InterfaceEvent = |
|
|
|
|
"Event" Identifier [ "As" TypeName | "(" [ ParameterList ] ")" ] StatementTerminator |
|
|
|
|
"Event" (. PushContext(Context.Identifier, la, t); .) (.OnEachPossiblePath: SetIdentifierExpected(la); .) Identifier (. PopContext(); .) |
|
|
|
|
[ "As" (. PushContext(Context.Type, la, t); .) TypeName (. PopContext(); .) | "(" [ ParameterList ] ")" ] |
|
|
|
|
StatementTerminator |
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
InterfaceProperty = |
|
|
|
|
"Property" Identifier [ "(" [ ParameterList ] ")" ] [ "As" { AttributeBlock } TypeName ] StatementTerminator |
|
|
|
|
"Property" (. PushContext(Context.Identifier, la, t); .) (.OnEachPossiblePath: SetIdentifierExpected(la); .) Identifier (. PopContext(); .) |
|
|
|
|
[ "(" [ ParameterList ] ")" ] [ "As" (. PushContext(Context.Type, la, t); .) { AttributeBlock } TypeName (. PopContext(); .) ] |
|
|
|
|
StatementTerminator |
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
InterfaceSubOrFunction = |
|
|
|
|
@ -386,7 +401,7 @@ GenericTypeParameterDeclaration =
@@ -386,7 +401,7 @@ GenericTypeParameterDeclaration =
|
|
|
|
|
DelegateTypeDeclaration = |
|
|
|
|
"Delegate" ("Sub" | "Function") |
|
|
|
|
(. PushContext(Context.Identifier, la, t); .) (.OnEachPossiblePath: SetIdentifierExpected(la); .) ANY (. PopContext(); .) |
|
|
|
|
[ "(" [ ParameterList ] ")" ] [ "As" (. PushContext(Context.Type, la, t); .) TypeName (. PopContext(); .) ] StatementTerminator |
|
|
|
|
{ "(" [ "Of" GenericTypeParameterDeclaration | ParameterList ] ")" } [ "As" (. PushContext(Context.Type, la, t); .) TypeName (. PopContext(); .) ] StatementTerminator |
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
MemberDeclaration = |
|
|
|
|
@ -419,7 +434,7 @@ ExternalMemberDeclaration =
@@ -419,7 +434,7 @@ ExternalMemberDeclaration =
|
|
|
|
|
|
|
|
|
|
EventMemberDeclaration = |
|
|
|
|
"Event" (. PushContext(Context.Identifier, la, t); .) (.OnEachPossiblePath: SetIdentifierExpected(la); .) Identifier (. PopContext(); .) ( "As" (. PushContext(Context.Type, la, t); .) TypeName (. PopContext(); .) | [ "(" [ ParameterList ] ")" ] ) |
|
|
|
|
[ "Implements" TypeName /*"." IdentifierOrKeyword*/ { "," TypeName /*"." IdentifierOrKeyword*/ } ] |
|
|
|
|
[ "Implements" (. PushContext(Context.Type, la, t); .) TypeName (. PopContext(); .) /*"." IdentifierOrKeyword*/ { "," (. PushContext(Context.Type, la, t); .) TypeName (. PopContext(); .) /*"." IdentifierOrKeyword*/ } ] |
|
|
|
|
/* the TypeName production already allows the "." IdentifierOrKeyword syntax, so to avoid an ambiguous grammer we just leave that out */ |
|
|
|
|
StatementTerminator |
|
|
|
|
. |
|
|
|
|
@ -439,7 +454,7 @@ PropertyDeclaration =
@@ -439,7 +454,7 @@ PropertyDeclaration =
|
|
|
|
|
(. PushContext(Context.Identifier, la, t); .) (.OnEachPossiblePath: SetIdentifierExpected(la); .) Identifier (. PopContext(); .) |
|
|
|
|
[ "(" [ ParameterList ] ")" ] |
|
|
|
|
[ "As" { AttributeBlock } ( NewExpression | (. PushContext(Context.Type, la, t); .) TypeName (. PopContext(); .) ) ] |
|
|
|
|
[ "Implements" TypeName /*"." IdentifierOrKeyword*/ { "," TypeName /*"." IdentifierOrKeyword*/ } ] |
|
|
|
|
[ "Implements" (. PushContext(Context.Type, la, t); .) TypeName (. PopContext(); .) /*"." IdentifierOrKeyword*/ { "," (. PushContext(Context.Type, la, t); .) TypeName (. PopContext(); .) /*"." IdentifierOrKeyword*/ } ] |
|
|
|
|
[ "=" Expression ] StatementTerminator |
|
|
|
|
(. PopContext(); .) { EXPECTEDCONFLICT("<") AttributeBlock } |
|
|
|
|
{ EXPECTEDCONFLICT("Public", "Protected", "Private", "Friend") AccessModifier |
|
|
|
|
@ -470,7 +485,7 @@ MemberVariableOrConstantDeclaration =
@@ -470,7 +485,7 @@ MemberVariableOrConstantDeclaration =
|
|
|
|
|
MemberVariableOrConstantDeclarator = |
|
|
|
|
[ "Const" ] |
|
|
|
|
(. PushContext(Context.Identifier, la, t); .) (.OnEachPossiblePath: SetIdentifierExpected(la); .) IdentifierForFieldDeclaration (. PopContext(); .) |
|
|
|
|
[ "As" (. PushContext(Context.Type, la, t); .) ( NewExpression | TypeName ) (. PopContext(); .) ] |
|
|
|
|
[ "As" (. PushContext(Context.Type, la, t); .) ( NewExpression | (. PushContext(Context.Type, la, t); .) TypeName (. PopContext(); .) ) (. PopContext(); .) ] |
|
|
|
|
[ "=" Expression ] |
|
|
|
|
. |
|
|
|
|
|
|
|
|
|
@ -800,7 +815,7 @@ PrimitiveTypeName =
@@ -800,7 +815,7 @@ PrimitiveTypeName =
|
|
|
|
|
|
|
|
|
|
TypeName = ( "Global" | Identifier | PrimitiveTypeName | "?" /* used for ? = completion */ ) { TypeSuffix } { "." IdentifierOrKeyword { TypeSuffix } } . |
|
|
|
|
|
|
|
|
|
TypeSuffix = "(" ( "Of" [ TypeName ] { "," [ TypeName ] } | [ ArgumentList ] ) ")" . |
|
|
|
|
TypeSuffix = "(" ( "Of" [ (. PushContext(Context.Type, la, t); .) TypeName (. PopContext(); .) ] { "," [ (. PushContext(Context.Type, la, t); .) TypeName (. PopContext(); .) ] } | [ ArgumentList ] ) ")" . |
|
|
|
|
|
|
|
|
|
IdentifierOrKeyword = ident |
|
|
|
|
| "AddHandler" |
|
|
|
|
@ -1141,7 +1156,9 @@ TryStatement =
@@ -1141,7 +1156,9 @@ TryStatement =
|
|
|
|
|
StatementTerminatorAndBlock |
|
|
|
|
{ |
|
|
|
|
"Catch" |
|
|
|
|
[ (. PushContext(Context.Identifier, la, t); .) (.OnEachPossiblePath: SetIdentifierExpected(la); .) Identifier (. PopContext(); .) [ "As" (. PushContext(Context.Type, la, t); .) TypeName (. PopContext(); .) ] ] |
|
|
|
|
[ (. PushContext(Context.Identifier, la, t); .) (.OnEachPossiblePath: SetIdentifierExpected(la); .) Identifier (. PopContext(); .) |
|
|
|
|
[ "As" (. PushContext(Context.Type, la, t); .) TypeName (. PopContext(); .) ] |
|
|
|
|
] |
|
|
|
|
[ "When" Expression ] |
|
|
|
|
StatementTerminatorAndBlock |
|
|
|
|
} |
|
|
|
|
|