Browse Source

implemented properties in EF Parser;

allow multiple member variable/constant declarations per statement

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/vbnet@6163 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Siegfried Pammer 16 years ago
parent
commit
0471aa9cc8
  1. 2
      src/AddIns/BackendBindings/VBNetBinding/Test/CodeCompletionTests.cs
  2. 38
      src/Libraries/NRefactory/Project/Src/Lexer/VBNet/ExpressionFinder.atg
  3. 1652
      src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Parser.cs

2
src/AddIns/BackendBindings/VBNetBinding/Test/CodeCompletionTests.cs

@ -28,7 +28,7 @@ namespace ICSharpCode.VBNetBinding.Tests @@ -28,7 +28,7 @@ namespace ICSharpCode.VBNetBinding.Tests
ContainsAll(list.Items.Select(item => item.Text).ToArray(),
"Class", "Delegate", "Friend", "Imports", "Module",
"Namespace", "Option", "Private", "Protected", "Public",
"Shadows", "Structure", "Interface", "Enum");
"Shadows", "Structure", "Interface", "Enum", "Partial");
}
);
}

38
src/Libraries/NRefactory/Project/Src/Lexer/VBNet/ExpressionFinder.atg

@ -397,6 +397,7 @@ MemberDeclaration = @@ -397,6 +397,7 @@ MemberDeclaration =
ExternalMemberDeclaration |
EventMemberDeclaration |
CustomEventMemberDeclaration |
PropertyDeclaration |
OperatorDeclaration
)
(. PopContext(); .)
@ -433,6 +434,29 @@ CustomEventMemberDeclaration = @@ -433,6 +434,29 @@ CustomEventMemberDeclaration =
"End" "Event" StatementTerminator
.
PropertyDeclaration =
"Property"
(. 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*/ } ]
[ "=" Expression ] StatementTerminator
(. PopContext(); .) { EXPECTEDCONFLICT("<") AttributeBlock }
{ EXPECTEDCONFLICT("Public", "Protected", "Private", "Friend") AccessModifier
// HACK : OnEachPossiblePath cannot detect that this might be the end of an auto property
// so we need to simulate it
(.OnEachPossiblePath: SetIdentifierExpected(la); .) }
[ (. PushContext(Context.Member, la, t); .)
( "Get" | "Set" ) [ "(" [ ParameterList ] ")" ]
StatementTerminatorAndBlock
"End" ( "Get" | "Set" ) StatementTerminator
[ { AttributeBlock } { AccessModifier } ( "Get" | "Set" ) [ "(" [ ParameterList ] ")" ]
StatementTerminatorAndBlock
"End" ( "Get" | "Set" ) StatementTerminator ]
"End" "Property" StatementTerminator ]
.
OperatorDeclaration =
"Operator" (. PushContext(Context.Identifier, la, t); .) (.OnEachPossiblePath: SetIdentifierExpected(la); .) ANY (. PopContext(); .) "(" ParameterList ")" [ "As" { AttributeBlock } (. PushContext(Context.Type, la, t); .) TypeName (. PopContext(); .) ]
StatementTerminatorAndBlock
@ -440,8 +464,14 @@ OperatorDeclaration = @@ -440,8 +464,14 @@ OperatorDeclaration =
.
MemberVariableOrConstantDeclaration =
MemberVariableOrConstantDeclarator { "," MemberVariableOrConstantDeclarator } StatementTerminator
.
MemberVariableOrConstantDeclarator =
[ "Const" ]
(. PushContext(Context.Identifier, la, t); .) (.OnEachPossiblePath: SetIdentifierExpected(la); .) IdentifierForFieldDeclaration (. PopContext(); .) [ "As" (. PushContext(Context.Type, la, t); .) TypeName (. PopContext(); .) ] [ "=" Expression ] StatementTerminator
(. PushContext(Context.Identifier, la, t); .) (.OnEachPossiblePath: SetIdentifierExpected(la); .) IdentifierForFieldDeclaration (. PopContext(); .)
[ "As" ( NewExpression | (. PushContext(Context.Type, la, t); .) TypeName (. PopContext(); .) ) ]
[ "=" Expression ]
.
ParameterList =
@ -1209,7 +1239,8 @@ AccessModifier = @@ -1209,7 +1239,8 @@ AccessModifier =
TypeModifier =
AccessModifier |
"Shadows"
"Shadows" |
"Partial"
.
MemberModifier =
@ -1225,6 +1256,9 @@ MemberModifier = @@ -1225,6 +1256,9 @@ MemberModifier =
"MustOverride" |
"Widening" |
"Narrowing" |
"ReadOnly" |
"WriteOnly" |
"Default" |
"Dim"
.

1652
src/Libraries/NRefactory/Project/Src/Lexer/VBNet/Parser.cs

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save