Skip to content

Commit c077f22

Browse files
committed
AST WIP
1 parent 8dc1a23 commit c077f22

5 files changed

Lines changed: 210 additions & 205 deletions

File tree

include/ps_compiler.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@ extern "C"
4444

4545
/**
4646
* @brief Initialize compiler and children objects
47-
* @param range_check enable range checking for values
48-
* @param bool_eval *FUTURE* enable short circuit boolean evaluation
49-
* @param io_check *FUTURE* enable I/O error checking
47+
* @param system pre-initialized system symbol table
48+
* @param range_check enable range checking for values
49+
* @param bool_eval *FUTURE* enable short circuit boolean evaluation
50+
* @param io_check *FUTURE* enable I/O error checking
5051
* @return NULL if no free memory (errno = ENOMEM)
5152
*/
52-
ps_compiler *ps_compiler_alloc(bool range_check, bool bool_eval, bool io_check);
53+
ps_compiler *ps_compiler_alloc(ps_symbol_table *system, bool range_check, bool bool_eval, bool io_check);
5354

5455
/** @brief Release compiler and children objects */
5556
ps_compiler *ps_compiler_free(ps_compiler *compiler);

include/ps_interpreter.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ extern "C"
4343
bool range_check; /** @brief Range checking for integer and real values */
4444
bool bool_eval; /** @brief *FUTURE* Short circuit boolean evaluation */
4545
bool io_check; /** @brief *FUTURE* stop or set IOResult on I/O error */
46-
ps_environment
47-
*environments[PS_INTERPRETER_ENVIRONMENTS]; /** @brief Environments with enough levels for some recursion */
46+
ps_symbol_table *system; /** @brief Built-in types, constants, variables, procedures and functions */
4847
} /*__attribute__((__packed__))*/ ps_interpreter;
4948

5049
#define PS_INTERPRETER_SIZEOF sizeof(ps_interpreter)

0 commit comments

Comments
 (0)