-static void InternalDumpExpr (const ExprNode* Expr)
+static void InternalDumpExpr (const ExprNode* Expr, const ExprNode* (*ResolveSym) (const struct SymEntry*))
/* Dump an expression in RPN to stdout */
{
if (Expr == 0) {
return;
}
- InternalDumpExpr (Expr->Left);
- InternalDumpExpr (Expr->Right);
+ InternalDumpExpr (Expr->Left, ResolveSym);
+ InternalDumpExpr (Expr->Right, ResolveSym);
switch (Expr->Op) {
break;
case EXPR_SYMBOL:
- printf (" SYM");
+ if (ResolveSym && (Expr = ResolveSym (Expr->V.Sym)) != 0) {
+ printf (" SYM (");
+ InternalDumpExpr (Expr, ResolveSym);
+ printf (") ");
+ } else {
+ printf ("SYM ");
+ }
break;
case EXPR_SECTION:
-void DumpExpr (const ExprNode* Expr)
+void DumpExpr (const ExprNode* Expr, const ExprNode* (*ResolveSym) (const struct SymEntry*))
/* Dump an expression tree to stdout */
{
- InternalDumpExpr (Expr);
+ InternalDumpExpr (Expr, ResolveSym);
printf ("\n");
}
-void DumpExpr (const ExprNode* Expr);
+void DumpExpr (const ExprNode* Expr, const ExprNode* (*ResolveSym) (const struct SymEntry*));
/* Dump an expression tree to stdout */