\doxysection{jsgf.\+h}
\label{jsgf_8h_source}\index{include/sphinxbase/jsgf.h@{include/sphinxbase/jsgf.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{/*\ -\/*-\/\ c-\/basic-\/offset:\ 4;\ indent-\/tabs-\/mode:\ nil\ -\/*-\/\ */}}
\DoxyCodeLine{00002\ \textcolor{comment}{/*\ ====================================================================}}
\DoxyCodeLine{00003\ \textcolor{comment}{\ *\ Copyright\ (c)\ 2007\ Carnegie\ Mellon\ University.\ \ All\ rights}}
\DoxyCodeLine{00004\ \textcolor{comment}{\ *\ reserved.}}
\DoxyCodeLine{00005\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00006\ \textcolor{comment}{\ *\ Redistribution\ and\ use\ in\ source\ and\ binary\ forms,\ with\ or\ without}}
\DoxyCodeLine{00007\ \textcolor{comment}{\ *\ modification,\ are\ permitted\ provided\ that\ the\ following\ conditions}}
\DoxyCodeLine{00008\ \textcolor{comment}{\ *\ are\ met:}}
\DoxyCodeLine{00009\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00010\ \textcolor{comment}{\ *\ 1.\ Redistributions\ of\ source\ code\ must\ retain\ the\ above\ copyright}}
\DoxyCodeLine{00011\ \textcolor{comment}{\ *\ \ \ \ notice,\ this\ list\ of\ conditions\ and\ the\ following\ disclaimer.\ }}
\DoxyCodeLine{00012\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00013\ \textcolor{comment}{\ *\ 2.\ Redistributions\ in\ binary\ form\ must\ reproduce\ the\ above\ copyright}}
\DoxyCodeLine{00014\ \textcolor{comment}{\ *\ \ \ \ notice,\ this\ list\ of\ conditions\ and\ the\ following\ disclaimer\ in}}
\DoxyCodeLine{00015\ \textcolor{comment}{\ *\ \ \ \ the\ documentation\ and/or\ other\ materials\ provided\ with\ the}}
\DoxyCodeLine{00016\ \textcolor{comment}{\ *\ \ \ \ distribution.}}
\DoxyCodeLine{00017\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00018\ \textcolor{comment}{\ *\ This\ work\ was\ supported\ in\ part\ by\ funding\ from\ the\ Defense\ Advanced\ }}
\DoxyCodeLine{00019\ \textcolor{comment}{\ *\ Research\ Projects\ Agency\ and\ the\ National\ Science\ Foundation\ of\ the\ }}
\DoxyCodeLine{00020\ \textcolor{comment}{\ *\ United\ States\ of\ America,\ and\ the\ CMU\ Sphinx\ Speech\ Consortium.}}
\DoxyCodeLine{00021\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00022\ \textcolor{comment}{\ *\ THIS\ SOFTWARE\ IS\ PROVIDED\ BY\ CARNEGIE\ MELLON\ UNIVERSITY\ \`{}\`{}AS\ IS''\ AND\ }}
\DoxyCodeLine{00023\ \textcolor{comment}{\ *\ ANY\ EXPRESSED\ OR\ IMPLIED\ WARRANTIES,\ INCLUDING,\ BUT\ NOT\ LIMITED\ TO,\ }}
\DoxyCodeLine{00024\ \textcolor{comment}{\ *\ THE\ IMPLIED\ WARRANTIES\ OF\ MERCHANTABILITY\ AND\ FITNESS\ FOR\ A\ PARTICULAR}}
\DoxyCodeLine{00025\ \textcolor{comment}{\ *\ PURPOSE\ ARE\ DISCLAIMED.\ \ IN\ NO\ EVENT\ SHALL\ CARNEGIE\ MELLON\ UNIVERSITY}}
\DoxyCodeLine{00026\ \textcolor{comment}{\ *\ NOR\ ITS\ EMPLOYEES\ BE\ LIABLE\ FOR\ ANY\ DIRECT,\ INDIRECT,\ INCIDENTAL,}}
\DoxyCodeLine{00027\ \textcolor{comment}{\ *\ SPECIAL,\ EXEMPLARY,\ OR\ CONSEQUENTIAL\ DAMAGES\ (INCLUDING,\ BUT\ NOT\ }}
\DoxyCodeLine{00028\ \textcolor{comment}{\ *\ LIMITED\ TO,\ PROCUREMENT\ OF\ SUBSTITUTE\ GOODS\ OR\ SERVICES;\ LOSS\ OF\ USE,\ }}
\DoxyCodeLine{00029\ \textcolor{comment}{\ *\ DATA,\ OR\ PROFITS;\ OR\ BUSINESS\ INTERRUPTION)\ HOWEVER\ CAUSED\ AND\ ON\ ANY\ }}
\DoxyCodeLine{00030\ \textcolor{comment}{\ *\ THEORY\ OF\ LIABILITY,\ WHETHER\ IN\ CONTRACT,\ STRICT\ LIABILITY,\ OR\ TORT\ }}
\DoxyCodeLine{00031\ \textcolor{comment}{\ *\ (INCLUDING\ NEGLIGENCE\ OR\ OTHERWISE)\ ARISING\ IN\ ANY\ WAY\ OUT\ OF\ THE\ USE\ }}
\DoxyCodeLine{00032\ \textcolor{comment}{\ *\ OF\ THIS\ SOFTWARE,\ EVEN\ IF\ ADVISED\ OF\ THE\ POSSIBILITY\ OF\ SUCH\ DAMAGE.}}
\DoxyCodeLine{00033\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00034\ \textcolor{comment}{\ *\ ====================================================================}}
\DoxyCodeLine{00035\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00036\ \textcolor{comment}{\ */}}
\DoxyCodeLine{00037\ }
\DoxyCodeLine{00038\ \textcolor{preprocessor}{\#ifndef\ \_\_JSGF\_H\_\_}}
\DoxyCodeLine{00039\ \textcolor{preprocessor}{\#define\ \_\_JSGF\_H\_\_}}
\DoxyCodeLine{00040\ }
\DoxyCodeLine{00048\ \textcolor{preprocessor}{\#include\ <stdio.h>}}
\DoxyCodeLine{00049\ }
\DoxyCodeLine{00050\ \textcolor{comment}{/*\ Win32/WinCE\ DLL\ gunk\ */}}
\DoxyCodeLine{00051\ \textcolor{preprocessor}{\#include\ <sphinxbase/sphinxbase\_export.h>}}
\DoxyCodeLine{00052\ \textcolor{preprocessor}{\#include\ <sphinxbase/hash\_table.h>}}
\DoxyCodeLine{00053\ \textcolor{preprocessor}{\#include\ <sphinxbase/fsg\_model.h>}}
\DoxyCodeLine{00054\ \textcolor{preprocessor}{\#include\ <sphinxbase/logmath.h>}}
\DoxyCodeLine{00055\ }
\DoxyCodeLine{00056\ \textcolor{preprocessor}{\#ifdef\ \_\_cplusplus}}
\DoxyCodeLine{00057\ \textcolor{keyword}{extern}\ \textcolor{stringliteral}{"{}C"{}}\ \{}
\DoxyCodeLine{00058\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00059\ \textcolor{preprocessor}{\#if\ 0}}
\DoxyCodeLine{00060\ \textcolor{comment}{/*\ Fool\ Emacs.\ */}}
\DoxyCodeLine{00061\ \}}
\DoxyCodeLine{00062\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00063\ }
\DoxyCodeLine{00064\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }jsgf\_s\ jsgf\_t;}
\DoxyCodeLine{00065\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }jsgf\_rule\_s\ jsgf\_rule\_t;}
\DoxyCodeLine{00066\ }
\DoxyCodeLine{00073\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00074\ jsgf\_t\ *jsgf\_grammar\_new(jsgf\_t\ *parent);}
\DoxyCodeLine{00075\ }
\DoxyCodeLine{00083\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00084\ jsgf\_t\ *jsgf\_parse\_file(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *filename,\ jsgf\_t\ *parent);}
\DoxyCodeLine{00085\ }
\DoxyCodeLine{00089\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00090\ \textcolor{keywordtype}{char}\ \textcolor{keyword}{const}\ *jsgf\_grammar\_name(jsgf\_t\ *jsgf);}
\DoxyCodeLine{00091\ }
\DoxyCodeLine{00095\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00096\ \textcolor{keywordtype}{void}\ jsgf\_grammar\_free(jsgf\_t\ *jsgf);}
\DoxyCodeLine{00097\ }
\DoxyCodeLine{00101\ \textcolor{keyword}{typedef}\ hash\_iter\_t\ jsgf\_rule\_iter\_t;}
\DoxyCodeLine{00102\ }
\DoxyCodeLine{00106\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00107\ jsgf\_rule\_iter\_t\ *jsgf\_rule\_iter(jsgf\_t\ *grammar);}
\DoxyCodeLine{00108\ }
\DoxyCodeLine{00112\ \textcolor{preprocessor}{\#define\ jsgf\_rule\_iter\_next(itor)\ hash\_table\_iter\_next(itor)}}
\DoxyCodeLine{00113\ }
\DoxyCodeLine{00117\ \textcolor{preprocessor}{\#define\ jsgf\_rule\_iter\_rule(itor)\ ((jsgf\_rule\_t\ *)(itor)-\/>ent-\/>val)}}
\DoxyCodeLine{00118\ }
\DoxyCodeLine{00122\ \textcolor{preprocessor}{\#define\ jsgf\_rule\_iter\_free(itor)\ hash\_table\_iter\_free(itor)}}
\DoxyCodeLine{00123\ }
\DoxyCodeLine{00127\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00128\ jsgf\_rule\_t\ *jsgf\_get\_rule(jsgf\_t\ *grammar,\ \textcolor{keywordtype}{char}\ \textcolor{keyword}{const}\ *name);}
\DoxyCodeLine{00129\ }
\DoxyCodeLine{00133\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00134\ \textcolor{keywordtype}{char}\ \textcolor{keyword}{const}\ *jsgf\_rule\_name(jsgf\_rule\_t\ *rule);}
\DoxyCodeLine{00135\ }
\DoxyCodeLine{00139\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00140\ \textcolor{keywordtype}{int}\ jsgf\_rule\_public(jsgf\_rule\_t\ *rule);}
\DoxyCodeLine{00141\ }
\DoxyCodeLine{00145\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00146\ fsg\_model\_t\ *jsgf\_build\_fsg(jsgf\_t\ *grammar,\ jsgf\_rule\_t\ *rule,}
\DoxyCodeLine{00147\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ logmath\_t\ *lmath,\ float32\ lw);}
\DoxyCodeLine{00148\ }
\DoxyCodeLine{00157\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00158\ fsg\_model\_t\ *jsgf\_build\_fsg\_raw(jsgf\_t\ *grammar,\ jsgf\_rule\_t\ *rule,}
\DoxyCodeLine{00159\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ logmath\_t\ *lmath,\ float32\ lw);}
\DoxyCodeLine{00160\ }
\DoxyCodeLine{00161\ }
\DoxyCodeLine{00167\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00168\ fsg\_model\_t\ *jsgf\_read\_file(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *file,\ logmath\_t\ *\ lmath,\ float32\ lw);}
\DoxyCodeLine{00169\ }
\DoxyCodeLine{00176\ SPHINXBASE\_EXPORT}
\DoxyCodeLine{00177\ \textcolor{keywordtype}{int}\ jsgf\_write\_fsg(jsgf\_t\ *grammar,\ jsgf\_rule\_t\ *rule,\ FILE\ *outfh);}
\DoxyCodeLine{00178\ }
\DoxyCodeLine{00179\ \textcolor{preprocessor}{\#ifdef\ \_\_cplusplus}}
\DoxyCodeLine{00180\ \}}
\DoxyCodeLine{00181\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00182\ }
\DoxyCodeLine{00183\ }
\DoxyCodeLine{00184\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{/*\ \_\_JSGF\_H\_\_\ */}\textcolor{preprocessor}{}}

\end{DoxyCode}
