\doxysection{jsgf\+\_\+internal.\+h}
\label{jsgf__internal_8h_source}\index{src/libsphinxbase/lm/jsgf\_internal.h@{src/libsphinxbase/lm/jsgf\_internal.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\_INTERNAL\_H\_\_}}
\DoxyCodeLine{00039\ \textcolor{preprocessor}{\#define\ \_\_JSGF\_INTERNAL\_H\_\_}}
\DoxyCodeLine{00040\ }
\DoxyCodeLine{00045\ \textcolor{preprocessor}{\#define\ YY\_NO\_UNISTD\_H\ 1}}
\DoxyCodeLine{00046\ \textcolor{preprocessor}{\#include\ <stdio.h>}}
\DoxyCodeLine{00047\ }
\DoxyCodeLine{00048\ \textcolor{preprocessor}{\#include\ <sphinxbase/hash\_table.h>}}
\DoxyCodeLine{00049\ \textcolor{preprocessor}{\#include\ <sphinxbase/glist.h>}}
\DoxyCodeLine{00050\ \textcolor{preprocessor}{\#include\ <sphinxbase/fsg\_model.h>}}
\DoxyCodeLine{00051\ \textcolor{preprocessor}{\#include\ <sphinxbase/logmath.h>}}
\DoxyCodeLine{00052\ \textcolor{preprocessor}{\#include\ <sphinxbase/strfuncs.h>}}
\DoxyCodeLine{00053\ \textcolor{preprocessor}{\#include\ <sphinxbase/jsgf.h>}}
\DoxyCodeLine{00054\ }
\DoxyCodeLine{00055\ \textcolor{preprocessor}{\#ifdef\ \_\_cplusplus}}
\DoxyCodeLine{00056\ \textcolor{keyword}{extern}\ \textcolor{stringliteral}{"{}C"{}}\ \{}
\DoxyCodeLine{00057\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00058\ \textcolor{preprocessor}{\#if\ 0}}
\DoxyCodeLine{00059\ \textcolor{comment}{/*\ Fool\ Emacs.\ */}}
\DoxyCodeLine{00060\ \}}
\DoxyCodeLine{00061\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00062\ }
\DoxyCodeLine{00063\ \textcolor{preprocessor}{\#define\ YY\_NO\_INPUT\ }\textcolor{comment}{/*\ Silence\ a\ compiler\ warning.\ */}\textcolor{preprocessor}{}}
\DoxyCodeLine{00064\ }
\DoxyCodeLine{00065\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }jsgf\_rhs\_s\ jsgf\_rhs\_t;}
\DoxyCodeLine{00066\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }jsgf\_atom\_s\ jsgf\_atom\_t;}
\DoxyCodeLine{00067\ \textcolor{keyword}{typedef}\ \textcolor{keyword}{struct\ }jsgf\_link\_s\ jsgf\_link\_t;}
\DoxyCodeLine{00068\ }
\DoxyCodeLine{00069\ \textcolor{keyword}{struct\ }jsgf\_s\ \{}
\DoxyCodeLine{00070\ \ \ \ \ \textcolor{keywordtype}{char}\ *version;\ \ }
\DoxyCodeLine{00071\ \ \ \ \ \textcolor{keywordtype}{char}\ *charset;\ \ }
\DoxyCodeLine{00072\ \ \ \ \ \textcolor{keywordtype}{char}\ *locale;\ \ \ }
\DoxyCodeLine{00073\ \ \ \ \ \textcolor{keywordtype}{char}\ *name;\ \ \ \ \ }
\DoxyCodeLine{00075\ \ \ \ \ hash\_table\_t\ *rules;\ \ \ }
\DoxyCodeLine{00076\ \ \ \ \ hash\_table\_t\ *imports;\ }
\DoxyCodeLine{00077\ \ \ \ \ jsgf\_t\ *parent;\ \ \ \ \ \ \ \ }
\DoxyCodeLine{00078\ \ \ \ \ glist\_t\ searchpath;\ \ \ \ }
\DoxyCodeLine{00080\ \ \ \ \ \textcolor{comment}{/*\ Scratch\ variables\ for\ FSG\ conversion.\ */}}
\DoxyCodeLine{00081\ \ \ \ \ \textcolor{keywordtype}{int}\ nstate;\ \ \ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00082\ \ \ \ \ glist\_t\ links;\ \ \ \ \ }
\DoxyCodeLine{00083\ \ \ \ \ glist\_t\ rulestack;\ \ \ \ \ }
\DoxyCodeLine{00084\ \};}
\DoxyCodeLine{00085\ }
\DoxyCodeLine{00086\ \textcolor{keyword}{struct\ }jsgf\_rule\_s\ \{}
\DoxyCodeLine{00087\ \ \ \ \ \textcolor{keywordtype}{int}\ refcnt;\ \ \ \ \ \ }
\DoxyCodeLine{00088\ \ \ \ \ \textcolor{keywordtype}{char}\ *name;\ \ \ \ \ \ }
\DoxyCodeLine{00089\ \ \ \ \ \textcolor{keywordtype}{int}\ \textcolor{keyword}{public};\ \ \ \ \ \ }
\DoxyCodeLine{00090\ \ \ \ \ jsgf\_rhs\_t\ *rhs;\ }
\DoxyCodeLine{00092\ \ \ \ \ \textcolor{keywordtype}{int}\ entry;\ \ \ \ \ \ \ }
\DoxyCodeLine{00093\ \ \ \ \ \textcolor{keywordtype}{int}\ exit;\ \ \ \ \ \ \ \ }
\DoxyCodeLine{00094\ \};}
\DoxyCodeLine{00095\ }
\DoxyCodeLine{00096\ \textcolor{keyword}{struct\ }jsgf\_rhs\_s\ \{}
\DoxyCodeLine{00097\ \ \ \ \ glist\_t\ atoms;\ \ \ }
\DoxyCodeLine{00098\ \ \ \ \ jsgf\_rhs\_t\ *alt;\ }
\DoxyCodeLine{00099\ \};}
\DoxyCodeLine{00100\ }
\DoxyCodeLine{00101\ \textcolor{keyword}{struct\ }jsgf\_atom\_s\ \{}
\DoxyCodeLine{00102\ \ \ \ \ \textcolor{keywordtype}{char}\ *name;\ \ \ \ \ \ \ \ }
\DoxyCodeLine{00103\ \ \ \ \ glist\_t\ tags;\ \ \ \ \ \ }
\DoxyCodeLine{00104\ \ \ \ \ \textcolor{keywordtype}{float}\ weight;\ \ \ \ \ \ }
\DoxyCodeLine{00105\ \};}
\DoxyCodeLine{00106\ }
\DoxyCodeLine{00107\ \textcolor{keyword}{struct\ }jsgf\_link\_s\ \{}
\DoxyCodeLine{00108\ \ \ \ \ jsgf\_atom\_t\ *atom;\ }
\DoxyCodeLine{00109\ \ \ \ \ \textcolor{keywordtype}{int}\ from;\ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00110\ \ \ \ \ \textcolor{keywordtype}{int}\ to;\ \ \ \ \ \ \ \ \ \ \ \ }
\DoxyCodeLine{00111\ \};}
\DoxyCodeLine{00112\ }
\DoxyCodeLine{00113\ \textcolor{preprocessor}{\#define\ jsgf\_atom\_is\_rule(atom)\ ((atom)-\/>name[0]\ ==\ '<')}}
\DoxyCodeLine{00114\ }
\DoxyCodeLine{00115\ \textcolor{keywordtype}{void}\ jsgf\_add\_link(jsgf\_t\ *grammar,\ jsgf\_atom\_t\ *atom,\ \textcolor{keywordtype}{int}\ from,\ \textcolor{keywordtype}{int}\ to);}
\DoxyCodeLine{00116\ jsgf\_atom\_t\ *jsgf\_atom\_new(\textcolor{keywordtype}{char}\ *name,\ \textcolor{keywordtype}{float}\ weight);}
\DoxyCodeLine{00117\ jsgf\_atom\_t\ *jsgf\_kleene\_new(jsgf\_t\ *jsgf,\ jsgf\_atom\_t\ *atom,\ \textcolor{keywordtype}{int}\ plus);}
\DoxyCodeLine{00118\ jsgf\_rule\_t\ *jsgf\_optional\_new(jsgf\_t\ *jsgf,\ jsgf\_rhs\_t\ *exp);}
\DoxyCodeLine{00119\ jsgf\_rule\_t\ *jsgf\_define\_rule(jsgf\_t\ *jsgf,\ \textcolor{keywordtype}{char}\ *name,\ jsgf\_rhs\_t\ *rhs,\ \textcolor{keywordtype}{int}\ \textcolor{keyword}{public});}
\DoxyCodeLine{00120\ jsgf\_rule\_t\ *jsgf\_import\_rule(jsgf\_t\ *jsgf,\ \textcolor{keywordtype}{char}\ *name);}
\DoxyCodeLine{00121\ }
\DoxyCodeLine{00122\ \textcolor{keywordtype}{int}\ jsgf\_atom\_free(jsgf\_atom\_t\ *atom);}
\DoxyCodeLine{00123\ \textcolor{keywordtype}{int}\ jsgf\_rule\_free(jsgf\_rule\_t\ *rule);}
\DoxyCodeLine{00124\ jsgf\_rule\_t\ *jsgf\_rule\_retain(jsgf\_rule\_t\ *rule);}
\DoxyCodeLine{00125\ }
\DoxyCodeLine{00126\ \textcolor{preprocessor}{\#ifdef\ \_\_cplusplus}}
\DoxyCodeLine{00127\ \}}
\DoxyCodeLine{00128\ \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{00129\ }
\DoxyCodeLine{00130\ }
\DoxyCodeLine{00131\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{/*\ \_\_JSGF\_H\_\_\ */}\textcolor{preprocessor}{}}

\end{DoxyCode}
