summaryrefslogtreecommitdiff
path: root/src/reader.h
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2022-01-04 11:51:58 +0800
committerJSDurand <mmemmew@gmail.com>2022-01-04 11:51:58 +0800
commit55dc897da6e81f2a26cfc7e66ac942824773498b (patch)
treefce0d7d57832907c991d551833bf5eecde947dd2 /src/reader.h
parent53b8b6ffab5a968db75e9babddf4e2dbb2c688a3 (diff)
temporary commit
Now we can read grammars from a file. But we need to check if it works for reading strings still.
Diffstat (limited to 'src/reader.h')
-rw-r--r--src/reader.h30
1 files changed, 3 insertions, 27 deletions
diff --git a/src/reader.h b/src/reader.h
index 77e7b84..65ee7ef 100644
--- a/src/reader.h
+++ b/src/reader.h
@@ -1,34 +1,10 @@
#ifndef INPUT_H
#define INPUT_H
+#include "str.h"
+#include "utf8.h"
#include "grammar.h"
-/* The class of a general reader, which can read a grammar, either
- from a file, or elsewhere, such as from an Emacs buffer, the
- standard input, or even from some other places.
-
- The only expectation, or requirement, of such a reader is to
- provide a function with a variable number and type of arguments
- which returns a grammar. Then the package provides a function to
- properly read a grammar, according to the specifications of the
- reader. */
-
-typedef Grammar *(*reader_func_t)(List *args);
-
-typedef struct Reader_s Reader;
-
-/* contructor */
-
-/* Build a reader and assign to *reader. It is expected to be
- allocated before this function. */
-void build_reader(Reader *reader, reader_func_t func, List *args);
-
-/* destructor */
-
-/* Does not free READER.
-
- FLAG is passed to destroy_list, which see. */
-void destroy_reader(Reader *reader, int flag);
-
+Grammar *read_grammar_from_bnf(str *s);
#endif