38#ifndef __JSGF_INTERNAL_H__
39#define __JSGF_INTERNAL_H__
49#include <sphinxbase/fsg_model.h>
56#if defined(_WIN32) || defined(_WIN32_WCE)
122#define jsgf_atom_is_rule(atom) ((atom)->name[0] == '<')
124void jsgf_add_link(jsgf_t *grammar, jsgf_atom_t *atom,
int from,
int to);
125jsgf_atom_t *jsgf_atom_new(
char *name,
float weight);
126jsgf_atom_t *jsgf_kleene_new(jsgf_t *jsgf, jsgf_atom_t *atom,
int plus);
127jsgf_rule_t *jsgf_optional_new(jsgf_t *jsgf, jsgf_rhs_t *exp);
128jsgf_rule_t *jsgf_define_rule(jsgf_t *jsgf,
char *name, jsgf_rhs_t *rhs,
int is_public);
129jsgf_rule_t *jsgf_import_rule(jsgf_t *jsgf,
char *name);
131int jsgf_atom_free(jsgf_atom_t *atom);
132int jsgf_rule_free(jsgf_rule_t *rule);
133jsgf_rule_t *jsgf_rule_retain(jsgf_rule_t *rule);
Generic linked-lists maintenance.
Hash table implementation.
Fast integer logarithmic addition operations.
Miscellaneous useful string functions.
glist_t tags
Tags, if any (glist_t of char *)
float weight
Weight (default 1)
char * name
Rule or token name.
jsgf_atom_t * atom
Name, tags, weight.
glist_t atoms
Sequence of items.
jsgf_rhs_t * alt
Linked list of alternates.
char * name
Rule name (NULL for an alternation/grouping)
int is_public
Is this rule marked 'public'?
jsgf_rhs_t * rhs
Expansion.
int refcnt
Reference count.
int entry
The entry-state for this expansion.
jsgf_rule_t * rule
The rule being expanded.
char * locale
JSGF locale (default C)
glist_t rulestack
Stack of currently expanded rules.
int nstate
Number of generated states.
glist_t links
Generated FSG links.
hash_table_t * imports
Pointers to imported grammars.
glist_t searchpath
List of directories to search for grammars.
char * charset
JSGF charset (default UTF-8)
char * version
JSGF version (from header)
jsgf_t * parent
Parent grammar (if this is an imported one)
hash_table_t * rules
Defined or imported rules in this grammar.