Browse Source

implemented ConditionalExpression and CastExpression

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/vbnet@5962 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Siegfried Pammer 16 years ago
parent
commit
82d17b482d
  1. 35
      src/Libraries/NRefactory/Project/Src/Parser/VBNet/Experimental/ExpressionFinder.atg
  2. 1305
      src/Libraries/NRefactory/Project/Src/Parser/VBNet/Experimental/Parser.cs

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

@ -373,8 +373,8 @@ Expression = @@ -373,8 +373,8 @@ Expression =
(. nextTokenIsPotentialStartOfXmlMode = true; .)
(
SimpleExpressionWithSuffix { BinaryOperator SimpleExpressionWithSuffix }
/* TODO: operators */
| NewExpression
| ConditionalExpression
)
.
@ -383,7 +383,7 @@ BinaryOperator = @@ -383,7 +383,7 @@ BinaryOperator =
| "=" | "<>" | "<" | ">" | "<=" | ">="
| "Like" | "&" | "And" | "AndAlso" | "Or" | "OrElse"
| "Xor" | "<<" | ">>" | "Is" | "IsNot"
| "^=" | "*=" | "/=" | "\\=" | "+=" | "-=" | "&=" | "To" | ":="
| "^=" | "*=" | "/=" | "\\=" | "+=" | "-=" | "&=" | "<<=" | ">>=" | "To" | ":="
.
UnaryOperator =
@ -396,6 +396,7 @@ SimpleExpressionWithSuffix = @@ -396,6 +396,7 @@ SimpleExpressionWithSuffix =
(
SimpleExpression { ExpressionSuffix }
| "TypeOf" SimpleExpressionWithSuffix "Is" TypeName
| CastExpression
).
SimpleExpression =
@ -427,6 +428,36 @@ ExpressionSuffix = @@ -427,6 +428,36 @@ ExpressionSuffix =
| ( "." | "!" ) IdentifierOrKeyword
.
CastExpression =
SimpleCastExpression | ("DirectCast" | "TryCast" | "CType") "(" Expression "," TypeName ")"
.
SimpleCastExpression =
(
"CBool" |
"CByte" |
"CChar" |
"CDate" |
"CDec" |
"CDbl" |
"CInt" |
"CLng" |
"CObj" |
"CSByte" |
"CShort" |
"CSng" |
"CStr" |
"CUInt" |
"CULng" |
"CUShort"
)
"(" Expression ")"
.
ConditionalExpression =
"If" "(" Expression "," Expression [ "," Expression ] ")"
.
XmlLiteral =
(. PushContext(Context.Xml, t); .)
{ XmlComment } XmlElement { XmlComment }

1305
src/Libraries/NRefactory/Project/Src/Parser/VBNet/Experimental/Parser.cs

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