2 types derived from CConst
Microsoft.CodeAnalysis.VisualBasic (2)
Preprocessor\CConst.vb (2)
178
Inherits
CConst
219
Inherits
CConst
3 instantiations of CConst
Microsoft.CodeAnalysis.VisualBasic (3)
Preprocessor\CConst.vb (3)
189
MyBase.
New
(id)
222
MyBase.
New
(id)
226
MyBase.
New
(id, args)
113 references to CConst
Microsoft.CodeAnalysis.VisualBasic (113)
Preprocessor\CConst.vb (5)
26
Public MustOverride Function WithError(id As ERRID) As
CConst
28
Friend Shared Function CreateChecked(value As Object) As
CConst
34
Friend Shared Function TryCreate(value As Object) As
CConst
213
Public Overrides Function WithError(id As ERRID) As
CConst
241
Public Overrides Function WithError(id As ERRID) As
CConst
Preprocessor\ExpressionEvaluator.vb (98)
17
Private ReadOnly _symbols As ImmutableDictionary(Of String,
CConst
)
112
Private Sub New(symbols As ImmutableDictionary(Of String,
CConst
))
117
Optional symbols As ImmutableDictionary(Of String,
CConst
) = Nothing) As
CConst
132
Optional symbols As ImmutableDictionary(Of String,
CConst
) = Nothing) As
CConst
143
Private Function EvaluateExpressionInternal(expr As ExpressionSyntax) As
CConst
224
Private Shared Function EvaluateLiteralExpression(expr As LiteralExpressionSyntax) As
CConst
232
Return
CConst
.Create(True)
235
Return
CConst
.Create(False)
239
Return
CConst
.Create(typedToken.Value)
243
Return
CConst
.Create(typedToken.Value)
247
Return
CConst
.Create(typedToken.Value)
251
Return
CConst
.CreateChecked(typedToken.ObjectValue)
255
Return
CConst
.CreateChecked(typedToken.ObjectValue)
258
Return
CConst
.CreateNothing()
262
Return
CConst
.Create(typedToken.Value)
270
Private Function EvaluateParenthesizedExpression(expr As ParenthesizedExpressionSyntax) As
CConst
274
Private Function EvaluateIdentifierNameExpression(expr As IdentifierNameSyntax) As
CConst
276
Return
CConst
.CreateNothing()
281
Dim value As
CConst
= Nothing
283
Return
CConst
.CreateNothing()
407
Private Function EvaluateTryCastExpression(expr As CastExpressionSyntax) As
CConst
438
Private Function EvaluateDirectCastExpression(expr As CastExpressionSyntax) As
CConst
467
Private Function EvaluateCTypeExpression(expr As CastExpressionSyntax) As
CConst
480
Private Function EvaluatePredefinedCastExpression(expr As PredefinedCastExpressionSyntax) As
CConst
541
Private Function EvaluateBinaryIfExpression(expr As BinaryConditionalExpressionSyntax) As
CConst
557
Private Function EvaluateTernaryIfExpression(expr As TernaryConditionalExpressionSyntax) As
CConst
568
Dim whenTrue As
CConst
= EvaluateExpressionInternal(expr.WhenTrue)
569
Dim whenFalse As
CConst
= EvaluateExpressionInternal(expr.WhenFalse)
605
Private Shared Function ConvertToBool(value As
CConst
, expr As ExpressionSyntax) As
CConst
616
Return
CConst
.Create(CBool(value.ValueAsObject))
626
Return
CConst
.Create(CBool(Nothing))
637
Private Shared Function ConvertToNumeric(value As
CConst
, toSpecialType As SpecialType, expr As ExpressionSyntax) As
CConst
646
value =
CConst
.Create(0)
665
Return
CConst
.CreateChecked(System.Convert.ChangeType(numericVal, toSpecialType.ToRuntimeType(), CultureInfo.InvariantCulture))
684
Private Shared Function ConvertNumericToNumeric(value As
CConst
, toSpecialType As SpecialType, expr As ExpressionSyntax) As
CConst
689
Return
CConst
.CreateChecked(System.Convert.ChangeType(value.ValueAsObject, toSpecialType.ToRuntimeType(), CultureInfo.InvariantCulture))
695
Private Shared Function Convert(value As
CConst
, toSpecialType As SpecialType, expr As ExpressionSyntax) As
CConst
725
Private Shared Function ConvertToChar(value As
CConst
, expr As ExpressionSyntax) As
CConst
748
Return
CConst
.Create(CChar(Nothing))
756
Return
CConst
.Create(ch)
763
Private Shared Function ConvertToDate(value As
CConst
, expr As ExpressionSyntax) As
CConst
789
Return
CConst
.Create(CDate(Nothing))
799
Private Shared Function ConvertToString(value As
CConst
, expr As ExpressionSyntax) As
CConst
819
Return
CConst
.Create(CStr(tv.Value))
826
Return
CConst
.Create(CStr(Nothing))
836
Private Shared Function ConvertToObject(value As
CConst
, expr As ExpressionSyntax) As
CConst
848
Private Function EvaluateUnaryExpression(expr As UnaryExpressionSyntax) As
CConst
866
Return
CConst
.Create(-Nothing)
870
Return
CConst
.Create(-(CShort(DirectCast(val, CConst(Of Boolean)).Value)))
872
Return
CConst
.Create(-(DirectCast(val, CConst(Of Byte)).Value))
874
Return
CConst
.Create(-(DirectCast(val, CConst(Of Decimal)).Value))
876
Return
CConst
.Create(-(DirectCast(val, CConst(Of Double)).Value))
878
Return
CConst
.Create(-(DirectCast(val, CConst(Of Int16)).Value))
880
Return
CConst
.Create(-(DirectCast(val, CConst(Of Int32)).Value))
882
Return
CConst
.Create(-(DirectCast(val, CConst(Of Int64)).Value))
884
Return
CConst
.Create(-(DirectCast(val, CConst(Of SByte)).Value))
886
Return
CConst
.Create(-(DirectCast(val, CConst(Of Single)).Value))
888
Return
CConst
.Create(-(DirectCast(val, CConst(Of UInt16)).Value))
890
Return
CConst
.Create(-(DirectCast(val, CConst(Of UInt32)).Value))
892
Return
CConst
.Create(-(DirectCast(val, CConst(Of UInt64)).Value))
899
Return
CConst
.Create(+(CShort(DirectCast(val, CConst(Of Boolean)).Value)))
905
Return
CConst
.Create(Not Nothing)
909
Return
CConst
.Create(Not (DirectCast(val, CConst(Of Boolean)).Value))
911
Return
CConst
.Create(Not (DirectCast(val, CConst(Of Byte)).Value))
913
Return
CConst
.Create(Not CLng(DirectCast(val, CConst(Of Decimal)).Value))
915
Return
CConst
.Create(Not CLng(DirectCast(val, CConst(Of Double)).Value))
917
Return
CConst
.Create(Not (DirectCast(val, CConst(Of Int16)).Value))
919
Return
CConst
.Create(Not (DirectCast(val, CConst(Of Int32)).Value))
921
Return
CConst
.Create(Not (DirectCast(val, CConst(Of Int64)).Value))
923
Return
CConst
.Create(Not (DirectCast(val, CConst(Of SByte)).Value))
925
Return
CConst
.Create(Not CLng(DirectCast(val, CConst(Of Single)).Value))
927
Return
CConst
.Create(Not (DirectCast(val, CConst(Of UInt16)).Value))
929
Return
CConst
.Create(Not (DirectCast(val, CConst(Of UInt32)).Value))
931
Return
CConst
.Create(Not (DirectCast(val, CConst(Of UInt64)).Value))
943
Private Shared Function IsNothing(val As
CConst
) As Boolean
947
Private Function EvaluateBinaryExpression(expr As BinaryExpressionSyntax) As
CConst
1104
left As
CConst
,
1105
right As
CConst
,
1106
expr As ExpressionSyntax) As
CConst
1158
Return
CConst
.Create(ComparisonSucceeds)
1276
Return Convert(
CConst
.Create(ResultValue), resultType, expr)
1307
Return
CConst
.Create(If(ComparisonSucceeds, True, False))
1405
Return Convert(
CConst
.Create(resultValue), resultType, expr)
1438
Return
CConst
.Create(ComparisonSucceeds)
1489
Return
CConst
.Create(ResultValue)
1500
Return
CConst
.Create(ResultString)
1534
Return
CConst
.Create(StringComparisonSucceeds)
1580
Return
CConst
.Create(OperationSucceeds)
Preprocessor\TypeHelpers.vb (1)
22
Friend Shared Function UncheckedCLng(v As
CConst
) As Long
Scanner\Directives.vb (5)
269
Private ReadOnly _symbols As ImmutableDictionary(Of String,
CConst
)
275
Friend Sub New(symbols As ImmutableDictionary(Of String,
CConst
))
281
Private Sub New(symbols As ImmutableDictionary(Of String,
CConst
),
294
Friend ReadOnly Property SymbolsMap As ImmutableDictionary(Of String,
CConst
)
300
Private Function SetSymbol(name As String, value As
CConst
) As PreprocessorState
Scanner\Scanner.vb (4)
150
Friend Shared Function GetPreprocessorConstants(options As VisualBasicParseOptions) As ImmutableDictionary(Of String,
CConst
)
152
Return ImmutableDictionary(Of String,
CConst
).Empty
155
Dim result = ImmutableDictionary.CreateBuilder(Of String,
CConst
)(IdentifierComparison.Comparer)
158
result(symbol.Key) =
CConst
.CreateChecked(symbol.Value)