84 value = ids.Count + 1;
269 switch (
node.NodeType)
416 if (
string.IsNullOrEmpty(
node.Name))
429 Out(
$".Lambda {GetLambdaName(node)}<{node.Type}>");
510 Out(
$".Constant<{node.Type}>({value})");
547 Out(
".RuntimeVariables");
554 if (instance !=
null)
635 switch (
node.NodeType)
731 if (
node.Object !=
null)
735 else if (
node.Method.DeclaringType !=
null)
737 Out(
node.Method.DeclaringType.ToString());
741 Out(
"<UnknownType>");
753 Out(
".NewArray " +
node.Type.GetElementType().ToString());
758 Out(
".NewArray " +
node.Type.ToString(),
Flow.Space);
766 Out(
".New " +
node.Type.ToString());
837 switch (
node.NodeType)
846 Out(
node.TypeOperand.ToString());
852 switch (
node.NodeType)
855 Out(
"(" +
node.Type.ToString() +
")");
858 Out(
"#(" +
node.Type.ToString() +
")");
879 if (
node.Operand ==
null)
911 switch (
node.NodeType)
933 if (
node.Type !=
node.GetExpression(
node.ExpressionCount - 1).Type)
935 Out(
$"<{node.Type}>");
945 Out(
".Default(" +
node.Type.ToString() +
")");
973 if (
node.ContinueLabel !=
null)
982 if (
node.BreakLabel !=
null)
1014 if (
node.DefaultBody !=
null)
1016 Out(
".Default:",
Flow.NewLine);
1030 Out(
Flow.NewLine,
"} .Catch (" +
node.Test.ToString());
1031 if (
node.Variable !=
null)
1036 if (
node.Filter !=
null)
1055 if (
node.Finally !=
null)
1062 else if (
node.Fault !=
null)
1075 if (
node.Indexer !=
null)
1089 Out(
$".Extension<{node.GetType()}>");
1103 Out(
$".DebugInfo({node.Document.FileName}: {node.StartLine}, {node.StartColumn} - {node.EndLine}, {node.EndColumn})");
1114 if (
string.IsNullOrEmpty(target.
Name))
1123 Out(
$".Lambda {GetLambdaName(lambda)}<{lambda.Type}>");
1134 if (
string.IsNullOrEmpty(
lambda.Name))
1143 foreach (
char c
in name)
1145 if (
char.IsWhiteSpace(c))
1155 return "'" + name +
"'";
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)
void Add(TKey key, TValue value)
static Exception Unreachable
virtual void Write(char value)
override Expression VisitConditional(ConditionalExpression node)
string GetLambdaName(LambdaExpression lambda)
override Expression VisitTry(TryExpression node)
string GetLabelTargetName(LabelTarget target)
static bool ContainsWhiteSpace(string name)
Dictionary< LabelTarget, int > _labelIds
override Expression VisitNewArray(NewArrayExpression node)
override Expression VisitDefault(DefaultExpression node)
void DumpLabel(LabelTarget target)
override ElementInit VisitElementInit(ElementInit node)
override Expression VisitLabel(LabelExpression node)
static int GetId< T >(T e, ref Dictionary< T, int > ids)
static bool NeedsParentheses(Expression parent, Expression child)
override Expression VisitMemberInit(MemberInitExpression node)
void VisitExpressions< T >(char open, IReadOnlyList< T > expressions)
override Expression VisitNew(NewExpression node)
override MemberListBinding VisitMemberListBinding(MemberListBinding binding)
static string GetDisplayName(string name)
Queue< LambdaExpression > _lambdas
static int GetOperatorPrecedence(Expression node)
override Expression VisitDebugInfo(DebugInfoExpression node)
Dictionary< ParameterExpression, int > _paramIds
DebugViewWriter(TextWriter file)
override CatchBlock VisitCatchBlock(CatchBlock node)
override Expression VisitSwitch(SwitchExpression node)
override Expression VisitExtension(Expression node)
override Expression VisitInvocation(InvocationExpression node)
int GetLabelTargetId(LabelTarget target)
void WriteLambda(LambdaExpression lambda)
override Expression VisitMember(MemberExpression node)
void WriteTo(Expression node)
void Out(Flow before, string s)
override SwitchCase VisitSwitchCase(SwitchCase node)
static void WriteTo(Expression node, TextWriter writer)
override Expression VisitBlock(BlockExpression node)
override Expression VisitLoop(LoopExpression node)
override Expression VisitConstant(ConstantExpression node)
override MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding)
override Expression VisitMethodCall(MethodCallExpression node)
int GetLambdaId(LambdaExpression le)
void Out(Flow before, string s, Flow after)
Dictionary< LambdaExpression, int > _lambdaIds
void ParenthesizedVisit(Expression parent, Expression nodeToVisit)
void OutMember(Expression node, Expression instance, MemberInfo member)
void VisitDeclarations(IReadOnlyList< ParameterExpression > expressions)
override MemberAssignment VisitMemberAssignment(MemberAssignment assignment)
static string GetConstantValueSuffix(Type type)
int GetParamId(ParameterExpression p)
override Expression VisitRuntimeVariables(RuntimeVariablesExpression node)
override Expression VisitIndex(IndexExpression node)
static string QuoteName(string name)
void Out(string s, Flow after)
override Expression VisitLambda< T >(Expression< T > node)
override Expression VisitGoto(GotoExpression node)
override Expression VisitUnary(UnaryExpression node)
override Expression VisitBinary(BinaryExpression node)
readonly Stack< int > _stack
override Expression VisitListInit(ListInitExpression node)
static bool IsSimpleExpression(Expression node)
override Expression VisitTypeBinary(TypeBinaryExpression node)
override Expression VisitParameter(ParameterExpression node)
Flow CheckBreak(Flow flow)
virtual ? Expression Visit(Expression? node)
virtual MemberBinding VisitMemberBinding(MemberBinding node)
virtual ExpressionType NodeType
static byte Max(byte val1, byte val2)
override string ToString()