\hypertarget{classParser}{
\section{Parser Class Reference}
\label{classParser}\index{Parser@{Parser}}
}


A lex/yacc wrapper which parses a configuration and returns nodes.  




{\ttfamily \#include $<$parser.hh$>$}

Inheritance diagram for Parser:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classParser}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classParser_a920ecede85465d5917f1fb05a829a37a}{
typedef vector$<$ \hyperlink{classNode}{Node} $\ast$ $>$ {\bfseries Nodes}}
\label{classParser_a920ecede85465d5917f1fb05a829a37a}

\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
Nodes $\ast$ \hyperlink{classParser_a2cb80aff77cb9f568bf288c6bf56cebc}{parse} (const Term::BLOCKS \&block, const string \&text)
\item 
string \hyperlink{classParser_ac502e3dc294db01b41250198848aa4c7}{last\_\-error} ()
\begin{DoxyCompactList}\small\item\em This should be called if parse returns null. \item\end{DoxyCompactList}\item 
\hypertarget{classParser_ad68fd46ef6e4169eccb3ed979b18e74e}{
int {\bfseries parse} (const string \&str) const }
\label{classParser_ad68fd46ef6e4169eccb3ed979b18e74e}

\item 
\hypertarget{classParser_a173ad89b7c613a3a9064446f4eaf7508}{
bool {\bfseries add\_\-command} (\hyperlink{classCommand}{Command} $\ast$command)}
\label{classParser_a173ad89b7c613a3a9064446f4eaf7508}

\item 
\hypertarget{classParser_a92d288f7edccf6ca3d0724f780b24a3f}{
bool {\bfseries add\_\-argtype} (\hyperlink{classArgumentParser}{ArgumentParser} $\ast$arg)}
\label{classParser_a92d288f7edccf6ca3d0724f780b24a3f}

\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classParser_ab97bde33857b5c71ba78c2093fb2d68c}{
\hyperlink{classArgumentParser}{ArgumentParser} $\ast$ {\bfseries get\_\-argument\_\-parser} (const string \&name) const }
\label{classParser_ab97bde33857b5c71ba78c2093fb2d68c}

\item 
\hypertarget{classParser_a8ab37b0dfe0e8a7e201a8d1e2987cdc4}{
int {\bfseries split\_\-into\_\-words} (const string \&str, vector$<$ string $>$ \&words) const }
\label{classParser_a8ab37b0dfe0e8a7e201a8d1e2987cdc4}

\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classParser_a453caef828b6ae3bef46043a5b8493de}{
string {\bfseries \_\-last\_\-error}}
\label{classParser_a453caef828b6ae3bef46043a5b8493de}

\item 
\hypertarget{classParser_aa84f6f912d5c3253b39ef94e92ab3254}{
char {\bfseries \_\-separator}}
\label{classParser_aa84f6f912d5c3253b39ef94e92ab3254}

\item 
\hypertarget{classParser_addc1bee7197a2cbf36f2a884e7cd2897}{
map$<$ string, \hyperlink{classCommand}{Command} $\ast$ $>$ {\bfseries \_\-templates}}
\label{classParser_addc1bee7197a2cbf36f2a884e7cd2897}

\item 
\hypertarget{classParser_a7e7a9d3353328a4e1163c645ab441476}{
map$<$ string, \hyperlink{classArgumentParser}{ArgumentParser} $\ast$ $>$ {\bfseries \_\-argtypes}}
\label{classParser_a7e7a9d3353328a4e1163c645ab441476}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
A lex/yacc wrapper which parses a configuration and returns nodes. This class parses a raw user configuration and returns a vector of nodes.

Each node will normally relate to a single statement. The vector of nodes reflects all \hyperlink{protocolthe-p}{the} statements present. 

\subsection{Member Function Documentation}
\hypertarget{classParser_ac502e3dc294db01b41250198848aa4c7}{
\index{Parser@{Parser}!last\_\-error@{last\_\-error}}
\index{last\_\-error@{last\_\-error}!Parser@{Parser}}
\subsubsection[{last\_\-error}]{\setlength{\rightskip}{0pt plus 5cm}string Parser::last\_\-error (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{classParser_ac502e3dc294db01b41250198848aa4c7}


This should be called if parse returns null. 

If parse is successful, \hyperlink{protocolthe-p}{the} value of last\_\-error is undefined.

\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} last error of \hyperlink{protocolthe-p}{the} parse. 
\end{DoxyReturn}
\hypertarget{classParser_a2cb80aff77cb9f568bf288c6bf56cebc}{
\index{Parser@{Parser}!parse@{parse}}
\index{parse@{parse}!Parser@{Parser}}
\subsubsection[{parse}]{\setlength{\rightskip}{0pt plus 5cm}Parser::Nodes $\ast$ Parser::parse (
\begin{DoxyParamCaption}
\item[{const Term::BLOCKS \&}]{block, }
\item[{const string \&}]{text}
\end{DoxyParamCaption}
)}}
\label{classParser_a2cb80aff77cb9f568bf288c6bf56cebc}

\begin{DoxyParams}{Parameters}
{\em block} & \hyperlink{protocolthe-p}{the} term block which is being parsed \mbox{[}action/src/dest\mbox{]}. \\
\hline
{\em text} & \hyperlink{classConfiguration}{Configuration} to parse. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\hyperlink{protocolthe-p}{the} parse-\/tree of \hyperlink{protocolthe-p}{the} configuration. Null on error. 
\end{DoxyReturn}


The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
/home/greearb/git/xorp.ct.github/xorp/policy/parser.hh\item 
/home/greearb/git/xorp.ct.github/xorp/rib/parser.hh\item 
/home/greearb/git/xorp.ct.github/xorp/policy/parser.cc\item 
/home/greearb/git/xorp.ct.github/xorp/rib/parser.cc\end{DoxyCompactItemize}
