mirror of
https://github.com/cc65/cc65.git
synced 2025-02-27 14:29:52 +00:00
Allow dumping of symbol expressions
git-svn-id: svn://svn.cc65.org/cc65/trunk@2639 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
4555fdcad1
commit
e87bec47d7
@ -46,14 +46,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
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 */
|
/* Dump an expression in RPN to stdout */
|
||||||
{
|
{
|
||||||
if (Expr == 0) {
|
if (Expr == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
InternalDumpExpr (Expr->Left);
|
InternalDumpExpr (Expr->Left, ResolveSym);
|
||||||
InternalDumpExpr (Expr->Right);
|
InternalDumpExpr (Expr->Right, ResolveSym);
|
||||||
|
|
||||||
switch (Expr->Op) {
|
switch (Expr->Op) {
|
||||||
|
|
||||||
@ -63,7 +63,13 @@ static void InternalDumpExpr (const ExprNode* Expr)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case EXPR_SYMBOL:
|
case EXPR_SYMBOL:
|
||||||
printf (" SYM");
|
if (ResolveSym && (Expr = ResolveSym (Expr->V.Sym)) != 0) {
|
||||||
|
printf (" SYM (");
|
||||||
|
InternalDumpExpr (Expr, ResolveSym);
|
||||||
|
printf (") ");
|
||||||
|
} else {
|
||||||
|
printf ("SYM ");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EXPR_SECTION:
|
case EXPR_SECTION:
|
||||||
@ -206,10 +212,10 @@ static void InternalDumpExpr (const ExprNode* Expr)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void DumpExpr (const ExprNode* Expr)
|
void DumpExpr (const ExprNode* Expr, const ExprNode* (*ResolveSym) (const struct SymEntry*))
|
||||||
/* Dump an expression tree to stdout */
|
/* Dump an expression tree to stdout */
|
||||||
{
|
{
|
||||||
InternalDumpExpr (Expr);
|
InternalDumpExpr (Expr, ResolveSym);
|
||||||
printf ("\n");
|
printf ("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ struct ExprNode {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void DumpExpr (const ExprNode* Expr);
|
void DumpExpr (const ExprNode* Expr, const ExprNode* (*ResolveSym) (const struct SymEntry*));
|
||||||
/* Dump an expression tree to stdout */
|
/* Dump an expression tree to stdout */
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user