Browse Source

Use new parser generator feature that automatically identifies the paths where (. nextTokenIsPotentialStartOfXmlMode = true; .) needs to be inserted.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/vbnet@5979 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Daniel Grunwald 16 years ago
parent
commit
17da69ef9f
  1. 26
      src/Libraries/NRefactory/Project/Src/Parser/VBNet/Experimental/ExpressionFinder.atg

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

@ -370,7 +370,6 @@ StatementTerminatorAndBlock = @@ -370,7 +370,6 @@ StatementTerminatorAndBlock =
.
Expression =
(. nextTokenIsPotentialStartOfXmlMode = true; .)
(
SimpleExpressionWithSuffix { BinaryOperator SimpleExpressionWithSuffix }
| ConditionalExpression
@ -390,7 +389,6 @@ UnaryOperator = @@ -390,7 +389,6 @@ UnaryOperator =
.
SimpleExpressionWithSuffix =
(. nextTokenIsPotentialStartOfXmlMode = true; .)
{ UnaryOperator }
(
SimpleExpression { ExpressionSuffix }
@ -399,7 +397,6 @@ SimpleExpressionWithSuffix = @@ -399,7 +397,6 @@ SimpleExpressionWithSuffix =
).
SimpleExpression =
(. nextTokenIsPotentialStartOfXmlMode = true; .)
( Literal
| ( "(" Expression ")" )
| Identifier
@ -424,7 +421,7 @@ CollectionInitializer = @@ -424,7 +421,7 @@ CollectionInitializer =
.
ExpressionSuffix =
"(" (. nextTokenIsPotentialStartOfXmlMode = true; .) ( "Of" TypeName { "," TypeName } ")" | ArgumentList ")" )
"(" ( "Of" TypeName { "," TypeName } ")" | ArgumentList ")" )
| ( "." | "!" ) IdentifierOrKeyword
.
@ -458,7 +455,10 @@ ConditionalExpression = @@ -458,7 +455,10 @@ ConditionalExpression =
"If" "(" Expression "," Expression [ "," Expression ] ")"
.
XmlLiteral =
/* semantic action in front of = will be inserted on all paths that possibly lead to XmlLiteral */
XmlLiteral
(. nextTokenIsPotentialStartOfXmlMode = true; .)
=
(. PushContext(Context.Xml, t); .)
{ XmlComment } XmlElement { XmlComment }
(. PopContext(); .)
@ -569,10 +569,10 @@ MultilineIfRemainder = @@ -569,10 +569,10 @@ MultilineIfRemainder =
SelectStatement =
"Select" [ "Case" ] Expression StatementTerminator
{
"Case" (. nextTokenIsPotentialStartOfXmlMode = true; .) (
"Case" (
"Else" |
( [ "Is" ] ComparisonOperator SimpleExpressionWithSuffix | Expression )
{ "," (. nextTokenIsPotentialStartOfXmlMode = true; .) ( [ "Is" ] ComparisonOperator SimpleExpressionWithSuffix | Expression ) }
{ "," ( [ "Is" ] ComparisonOperator SimpleExpressionWithSuffix | Expression ) }
)
StatementTerminatorAndBlock
}
@ -603,19 +603,19 @@ DoBottomLoopStatement = @@ -603,19 +603,19 @@ DoBottomLoopStatement =
.
ForStatement =
"For" (. nextTokenIsPotentialStartOfXmlMode = true; .) ( ForLoopStatement | ForEachLoopStatement )
"For" ( ForLoopStatement | ForEachLoopStatement )
.
ForLoopStatement =
ForLoopVariable "=" Expression /* "To" is binary operator */ [ "Step" Expression ]
StatementTerminatorAndBlock
"Next" (. nextTokenIsPotentialStartOfXmlMode = true; .) [ Expression { "," Expression } ]
"Next" [ Expression { "," Expression } ]
.
ForEachLoopStatement =
"Each" ForLoopVariable "In" Expression
StatementTerminatorAndBlock
"Next" (. nextTokenIsPotentialStartOfXmlMode = true; .) [ Expression { "," Expression } ]
"Next" [ Expression { "," Expression } ]
.
ForLoopVariable =
@ -623,12 +623,12 @@ ForLoopVariable = @@ -623,12 +623,12 @@ ForLoopVariable =
.
ErrorHandlingStatement =
[ "On" ] "Error" (. nextTokenIsPotentialStartOfXmlMode = true; .) ( Expression | "GoTo" ( LiteralInteger | Identifier ) | "Resume" "Next" )
[ "On" ] "Error" ( Expression | "GoTo" ( LiteralInteger | Identifier ) | "Resume" "Next" )
| "Resume" ( "Next" | LiteralInteger | Identifier )
.
ThrowStatement =
"Throw" (. nextTokenIsPotentialStartOfXmlMode = true; .) [ Expression ]
"Throw" [ Expression ]
.
TryStatement =
@ -653,7 +653,7 @@ BranchStatement = @@ -653,7 +653,7 @@ BranchStatement =
| "Continue" ( "Do" | "For" | "While" )
| "Stop"
/*| "End" HACK End-Statements are not passed to EF-Parser from Lexer */
| "Return" (. nextTokenIsPotentialStartOfXmlMode = true; .) [ Expression ]
| "Return" [ Expression ]
.
ReDimStatement =

Loading…
Cancel
Save