view src/preprocess.h @ 157:15825a4a3580

preprocess: Implement preprocessing with hacks for REPL
author Lewin Bormann <lbo@spheniscida.de>
date Tue, 03 Sep 2019 15:36:03 +0200
parents d320f32169ee
children 3ec2b2edb977
line wrap: on
line source

#ifndef src_preprocess_h
#define src_preprocess_h

#include "types.h"

/**
 * @file preprocess.h
 * @brief Preprocess a parsed expression tree.
 * @addtogroup frontend
 * @{
 */

/**
 * @brief Apply preprocessing stages, listed as individual functions below.
 */
void ypreprocess(yexpr_t* expr);

/**
 * @brief Replace IDs that reference a built-in by built-in expressions.
 *
 * Run order: 1
 */
void ypreprocess_resolve_builtins(yexpr_t* expr);

/**
 * @brief Replace symbolic IDs with per-scope-unique numeric IDs.
 *
 * Run order: 2
 */
void ypreprocess_refs(yexpr_t* expr);

void ypreprocess_refs_repl(yexpr_t* repl_expr, yvec_t** scope_stack);
/**
 * @}
 */

#endif