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