tree
a68_lower_identifier (NODE_T *p, LOW_CTX_T ctx)
{
- if (TAG_TABLE (TAX (p)) == A68_STANDENV)
+ LOWERER_T lowerer = LOWERER (TAX (p));
+
+ if (lowerer != NO_LOWERER)
{
/* This identifier is defined in the standard prelude. Use its lowering
handler. */
- LOWERER_T lowerer = LOWERER (TAX (p));
return (*lowerer) (p, ctx);
}
else
return a68_lower_tree (SUB (p), ctx);
else
{
+ LOWERER_T lowerer = LOWERER (TAX (NEXT (SUB (p))));
+
/* If the operator is defined in the standard prelude, then use its lowering
code. */
- if (TAG_TABLE (TAX (NEXT (SUB (p)))) == A68_STANDENV)
+ if (lowerer != NO_LOWERER)
{
- LOWERER_T lowerer = LOWERER (TAX (NEXT (SUB (p))));
return (*lowerer) (p, ctx);
}
else
tree
a68_lower_monadic_formula (NODE_T *p, LOW_CTX_T ctx)
{
+ LOWERER_T lowerer = LOWERER (TAX (SUB (p)));
+
/* If the operator is defined in the standard prelude, then use its lowering
code. */
- if (TAG_TABLE (TAX (SUB (p))) == A68_STANDENV)
+ if (lowerer != NO_LOWERER)
{
- LOWERER_T lowerer = LOWERER (TAX (SUB (p)));
return (*lowerer) (p, ctx);
}
else
static void
add_a68_standenv (bool portable, int a, NODE_T* n, char *c, MOID_T *m,
- int p, LOWERER_T l = NO_LOWERER)
+ int p, LOWERER_T l = LOWERER_UNIMPL)
{
#define INSERT_TAG(l, n) \
do { \
/* Enter an identifier in standenv. */
static void
-a68_idf (bool portable, const char *n, MOID_T *m, LOWERER_T l = NO_LOWERER)
+a68_idf (bool portable, const char *n, MOID_T *m, LOWERER_T l = LOWERER_UNIMPL)
{
add_a68_standenv (portable, IDENTIFIER,
a68_some_node (TEXT (a68_add_token (&A68 (top_token), n))),
{
add_a68_standenv (true, PRIO_SYMBOL,
a68_some_node (TEXT (a68_add_token (&A68 (top_token), p))),
- NO_TEXT, NO_MOID, b, NO_LOWERER);
+ NO_TEXT, NO_MOID, b, LOWERER_UNIMPL);
}
/* Enter operator in standenv. */
static void
-a68_op (bool portable, const char *n, MOID_T *m, LOWERER_T l = NO_LOWERER)
+a68_op (bool portable, const char *n, MOID_T *m, LOWERER_T l = LOWERER_UNIMPL)
{
add_a68_standenv (portable, OP_SYMBOL,
a68_some_node (TEXT (a68_add_token (&A68 (top_token), n))),
/* Type of the lowerer routines defined in a68-low-prelude.cc. */
typedef tree (*LOWERER_T) (struct NODE_T *, struct LOW_CTX_T);
-#define NO_LOWERER a68_lower_unimplemented
+#define NO_LOWERER NULL
+#define LOWERER_UNIMPL a68_lower_unimplemented
struct GTY((chain_next ("%h.more"), chain_prev ("%h.less"))) KEYWORD_T
{