2 * FML interpreter. Europagate, 1995
5 * Revision 1.2 1995/02/07 16:09:23 adam
6 * The \ character is no longer INCLUDED when terminating a token.
7 * Major changes in tokenization routines. Bug fixes in expressions
8 * with lists (fml_sub0).
10 * Revision 1.1.1.1 1995/02/06 13:48:10 adam
11 * First version of the FML interpreter. It's slow and memory isn't
12 * freed properly. In particular, the FML nodes aren't released yet.
18 #define FML_MAX_TOKEN 2048
20 #define FML_ATOM_BUF 12
28 struct fml_atom *next;
29 char buf[FML_ATOM_BUF];
32 struct fml_node *fml_tokenize (Fml fml);
33 struct fml_node *fml_node_alloc (Fml fml);
34 struct fml_atom *fml_atom_alloc (Fml fml, char *str);
35 int fml_atom_str (struct fml_atom *a, char *str);
36 void fml_atom_strx (struct fml_atom *a, char *str, int max);
37 int fml_atom_val (struct fml_atom *a);
38 struct fml_node *fml_mk_list (Fml fml, struct fml_node *fn);
39 void fml_node_delete (Fml fml, struct fml_node *fn);
40 struct fml_node *fml_node_copy (Fml fml, struct fml_node *fn);
54 struct fml_atom *atom;
55 char sbuf[FML_ATOM_BUF*4];
60 struct fml_node *args;
61 struct fml_node *body;
62 struct fml_node *(*binary)(Fml fml, struct fml_node *l,
64 struct fml_node *(*prefix)(Fml fml, struct fml_node **lp,
68 struct fml_sym_tab *fml_sym_open (void);
69 void fml_sym_close (struct fml_sym_tab **tabp);
70 struct fml_sym_info *fml_sym_add (struct fml_sym_tab *tab, const char *s);
71 struct fml_sym_info *fml_sym_add_local (struct fml_sym_tab *tab,const char *s);
73 struct fml_sym_info *fml_sym_lookup (struct fml_sym_tab *tab, const char *s);
74 struct fml_sym_info *fml_sym_lookup_local (struct fml_sym_tab *tab,
76 void fml_sym_push (struct fml_sym_tab *tab);
77 void fml_sym_pop (struct fml_sym_tab *tab, void(*ph)(struct fml_sym_info *i));
79 void fml_pr_list (struct fml_node *p);
90 #define FML_CBINARY 10
91 #define FML_CPREFIX 11