Remove pointless parameter copying.

This commit is contained in:
2018-05-11 20:36:27 -07:00
parent 989774cec5
commit 3e8c814215
6 changed files with 30 additions and 36 deletions

View File

@@ -4,19 +4,17 @@
#include "table.h"
#include "tree.h"
#include "impl.h"
#include "libabacus.h"
struct libab_s;
struct libab_interpreter_s {
libab_ref type_num;
libab_ref base_table;
libab_impl* impl;
struct libab_s* ab;
};
typedef struct libab_interpreter_s libab_interpreter;
void libab_interpreter_init(libab_interpreter* intr,
libab_ref* table,
libab_ref* type_num,
libab_impl* impl);
void libab_interpreter_init(libab_interpreter* intr, struct libab_s* ab);
libab_result libab_interpreter_run(libab_interpreter* intr,
libab_tree* tree, libab_ref* into);
void libab_interpreter_free(libab_interpreter* intr);

View File

@@ -1,11 +1,11 @@
#ifndef LIBABACUS_H
#define LIBABACUS_H
#include "interpreter.h"
#include "custom.h"
#include "ht.h"
#include "lexer.h"
#include "parser.h"
#include "interpreter.h"
#include "result.h"
#include "table.h"
#include "impl.h"

View File

@@ -6,13 +6,15 @@
#include "table.h"
#include "tree.h"
struct libab_s;
/**
* The parser that is used by libabacus
* to store information for converting
* tokens into trees.
*/
struct libab_parser_s {
libab_ref base_table;
struct libab_s* ab;
};
typedef struct libab_parser_s libab_parser;
@@ -22,7 +24,7 @@ typedef struct libab_parser_s libab_parser;
* @param parser the parser to intialize.
* @param table the table of "reserved" entries like operators.
*/
void libab_parser_init(libab_parser* parser, libab_ref* table);
void libab_parser_init(libab_parser* parser, struct libab_s* ab);
/**
* Parses the given list of tokens into the given tree pointer.
* @param parser the parser to use for parsing text.