Browse Source

Solving some LL(1) conflicts

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/vbnet@5946 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Daniel Grunwald 16 years ago
parent
commit
8a12d03745
  1. 31
      src/Libraries/NRefactory/Project/Src/Parser/VBNet/Experimental/ExpressionFinder.atg
  2. 2
      src/Libraries/NRefactory/Project/Src/Parser/VBNet/Experimental/Test/VBParserExperiment.csproj

31
src/Libraries/NRefactory/Project/Src/Parser/VBNet/Experimental/ExpressionFinder.atg

@ -307,6 +307,7 @@ MemberDeclaration = @@ -307,6 +307,7 @@ MemberDeclaration =
SubOrFunctionDeclaration |
ExternalMemberDeclaration |
EventMemberDeclaration |
CustomEventMemberDeclaration |
OperatorDeclaration
)
(. PopContext(); .)
@ -326,17 +327,20 @@ ExternalMemberDeclaration = @@ -326,17 +327,20 @@ ExternalMemberDeclaration =
.
EventMemberDeclaration =
[ "Custom" ] "Event" Identifier ( "As" TypeName | [ "(" [ ParameterList ] ")" ] )
[ "Implements" TypeName "." IdentifierOrKeyword { "," TypeName "." IdentifierOrKeyword } ]
"Event" Identifier ( "As" TypeName | [ "(" [ ParameterList ] ")" ] )
[ "Implements" TypeName /*"." IdentifierOrKeyword*/ { "," TypeName /*"." IdentifierOrKeyword*/ } ]
/* the TypeName production already allows the "." IdentifierOrKeyword syntax, so to avoid an ambiguous grammer we just leave that out */
StatementTerminator
[
{
{ AttributeBlock } ( "AddHandler" | "RemoveHandler" | "RaiseEvent" ) "(" ParameterList ")" EOL
Block
"End" ( "AddHandler" | "RemoveHandler" | "RaiseEvent" ) StatementTerminator
}
.
CustomEventMemberDeclaration =
"Custom" EventMemberDeclaration
{
{ AttributeBlock } ( "AddHandler" | "RemoveHandler" | "RaiseEvent" ) "(" ParameterList ")" EOL
Block
"End" ( "AddHandler" | "RemoveHandler" | "RaiseEvent" ) StatementTerminator
}
"End" "Event" StatementTerminator
]
.
OperatorDeclaration =
@ -346,7 +350,7 @@ OperatorDeclaration = @@ -346,7 +350,7 @@ OperatorDeclaration =
.
MemberVariableOrConstantDeclaration =
[ "Const" ] Identifier [ "As" TypeName ] [ "=" Expression ] StatementTerminator
[ "Const" ] IdentifierForFieldDeclaration [ "As" TypeName ] [ "=" Expression ] StatementTerminator
.
ParameterList =
@ -360,8 +364,7 @@ Parameter = @@ -360,8 +364,7 @@ Parameter =
Block =
(. PushContext(Context.Body, t); .)
StatementTerminator
{ StatementTerminator }
{ Statement { StatementTerminator } }
{ [ Statement] StatementTerminator }
(. PopContext(); .)
.
@ -429,7 +432,7 @@ Statement = @@ -429,7 +432,7 @@ Statement =
.
VariableDeclarationStatement =
( "Dim" | "Static" | "Const" ) Identifier [ "?" ] [ ( "(" { "," } ")" ) ] { "," Identifier [ "?" ] [ ( "(" { "," } ")" ) ] } [ "As" [ "New" ] TypeName [ "(" ")" ] ] [ "=" Expression ]
( "Dim" | "Static" | "Const" ) Identifier [ "?" ] [ ( "(" { "," } ")" ) ] { "," Identifier [ "?" ] [ ( "(" { "," } ")" ) ] } [ "As" [ "New" ] TypeName ] [ "=" Expression ]
.
WithOrLockStatement =
@ -445,7 +448,7 @@ RaiseEventStatement = @@ -445,7 +448,7 @@ RaiseEventStatement =
.
InvocationStatement =
[ "Call" ] Expression [ "(" [ ArgumentList ] ")" ] [ ( "=" | "^=" | "*=" | "/=" | "\\=" | "+=" | "-=" | "&=" | ">=" ) Expression ]
[ "Call" ] Expression [ ( "=" | "^=" | "*=" | "/=" | "\\=" | "+=" | "-=" | "&=" | ">=" ) Expression ]
.
ArgumentList =

2
src/Libraries/NRefactory/Project/Src/Parser/VBNet/Experimental/Test/VBParserExperiment.csproj

@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework">
<HintPath>..\..\..\..\..\..\..\..\..\bin\Tools\NUnit\nunit.framework.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\..\Tools\NUnit\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">

Loading…
Cancel
Save