From 0b8d5c1f3a2bbcf6d7ed09194be13a0260c47023 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Tue, 22 Jun 2010 22:03:39 +0000 Subject: [PATCH] Changed ExpressionFinder grammar to suppress the remaining LL(1) warnings git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/vbnet@5987 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../VBNet/Experimental/ExpressionFinder.atg | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Libraries/NRefactory/Project/Src/Parser/VBNet/Experimental/ExpressionFinder.atg b/src/Libraries/NRefactory/Project/Src/Parser/VBNet/Experimental/ExpressionFinder.atg index 721fee92b1..c305bd26b3 100644 --- a/src/Libraries/NRefactory/Project/Src/Parser/VBNet/Experimental/ExpressionFinder.atg +++ b/src/Libraries/NRefactory/Project/Src/Parser/VBNet/Experimental/ExpressionFinder.atg @@ -260,7 +260,9 @@ ExpressionFinder = (. PushContext(Context.Global, t); .) { OptionStatement } { ImportsStatement } - { AttributeBlock } + { EXPECTEDCONFLICT("<") AttributeBlock } /* Expected LL(1) conflict: we can't tell global attributes */ + /* from those on types. */ + /* This isn't a problem, we can just treat all as global attributes */ { NamespaceMemberDeclaration } (. PopContext(); .) . @@ -463,12 +465,12 @@ LambdaExpression = . SubLambdaExpression = - "Sub" [ "(" [ ParameterList ] ")" ] - ( Statement | StatementTerminatorAndBlock "End" "Sub" ) + "Sub" "(" [ ParameterList ] ")" + ( GREEDY Statement | StatementTerminatorAndBlock "End" "Sub" ) . FunctionLambdaExpression = - "Function" [ "(" [ ParameterList ] ")" ] + "Function" "(" [ ParameterList ] ")" ( Expression | [ "As" TypeName ] StatementTerminatorAndBlock "End" "Function" ) . @@ -532,7 +534,7 @@ Statement = | WithOrLockStatement | AddOrRemoveHandlerStatement | RaiseEventStatement - | IfStatement + | EXPECTEDCONFLICT("If") IfStatement /* prefer if-statement to if-expression */ | SelectStatement | WhileStatement | DoLoopStatement @@ -675,7 +677,9 @@ BranchStatement = . ReDimStatement = - "ReDim" [ "Preserve" ] Expression + "ReDim" + [ EXPECTEDCONFLICT("Preserve") "Preserve" ] /* Preserve is context-dependend keyword */ + Expression . EraseStatement =