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

Loading…
Cancel
Save