+ case AST_EXP_GLOBAL_IDENTIFIER:
+ {
+ const char *name;
+
+ /*
+ * We currently only support $ctx (context) and $app
+ * identifiers.
+ */
+ if (strncmp(node->u.expression.u.identifier,
+ "$ctx.", strlen("$ctx.")) != 0
+ && strncmp(node->u.expression.u.identifier,
+ "$app.", strlen("$app.")) != 0) {
+ fprintf(stderr, "[error] %s: \"%s\" global identifier is unknown. Only \"$ctx\" and \"$app\" are currently implemented.\n", __func__, node->u.expression.u.identifier);
+ return NULL;
+ }
+ name = strchr(node->u.expression.u.identifier, '.');
+ if (!name) {
+ fprintf(stderr, "[error] %s: Expecting '.'\n", __func__);
+ return NULL;
+ }
+ name++; /* Skip . */
+ if (!strlen(name)) {
+ fprintf(stderr, "[error] %s: Expecting a context name, e.g. \'$ctx.name\'.\n", __func__);
+ return NULL;
+ }
+ switch (node->u.expression.pre_op) {
+ case AST_LINK_UNKNOWN:
+ return make_op_load_get_context_ref(node->u.expression.u.identifier,
+ side);
+ case AST_LINK_BRACKET:
+ return make_op_load_get_context_ref_index(node->u.expression.u.identifier,
+ node->u.expression.next,