<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>libdap++: parser.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.3 --> <div id="top"> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">libdap++ <span id="projectnumber">Updated for version 3.8.2</span></div> </td> </tr> </tbody> </table> </div> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> </div> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> initNavTree('parser_8h.html',''); </script> <div id="doc-content"> <div class="header"> <div class="headertitle"> <h1>parser.h</h1> </div> </div> <div class="contents"> <a href="parser_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <a name="l00002"></a>00002 <span class="comment">// -*- mode: c++; c-basic-offset:4 -*-</span> <a name="l00003"></a>00003 <a name="l00004"></a>00004 <span class="comment">// This file is part of libdap, A C++ implementation of the OPeNDAP Data</span> <a name="l00005"></a>00005 <span class="comment">// Access Protocol.</span> <a name="l00006"></a>00006 <a name="l00007"></a>00007 <span class="comment">// Copyright (c) 2002,2003 OPeNDAP, Inc.</span> <a name="l00008"></a>00008 <span class="comment">// Author: James Gallagher <jgallagher@opendap.org></span> <a name="l00009"></a>00009 <span class="comment">//</span> <a name="l00010"></a>00010 <span class="comment">// This library is free software; you can redistribute it and/or</span> <a name="l00011"></a>00011 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span> <a name="l00012"></a>00012 <span class="comment">// License as published by the Free Software Foundation; either</span> <a name="l00013"></a>00013 <span class="comment">// version 2.1 of the License, or (at your option) any later version.</span> <a name="l00014"></a>00014 <span class="comment">//</span> <a name="l00015"></a>00015 <span class="comment">// This library is distributed in the hope that it will be useful,</span> <a name="l00016"></a>00016 <span class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00017"></a>00017 <span class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span> <a name="l00018"></a>00018 <span class="comment">// Lesser General Public License for more details.</span> <a name="l00019"></a>00019 <span class="comment">//</span> <a name="l00020"></a>00020 <span class="comment">// You should have received a copy of the GNU Lesser General Public</span> <a name="l00021"></a>00021 <span class="comment">// License along with this library; if not, write to the Free Software</span> <a name="l00022"></a>00022 <span class="comment">// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span> <a name="l00023"></a>00023 <span class="comment">//</span> <a name="l00024"></a>00024 <span class="comment">// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.</span> <a name="l00025"></a>00025 <a name="l00026"></a>00026 <span class="comment">// (c) COPYRIGHT URI/MIT 1994-1999</span> <a name="l00027"></a>00027 <span class="comment">// Please read the full copyright statement in the file COPYRIGHT_URI.</span> <a name="l00028"></a>00028 <span class="comment">//</span> <a name="l00029"></a>00029 <span class="comment">// Authors:</span> <a name="l00030"></a>00030 <span class="comment">// jhrg,jimg James Gallagher <jgallagher@gso.uri.edu></span> <a name="l00031"></a>00031 <a name="l00032"></a>00032 <span class="comment">// Constants, types and function prototypes for use with the DAP parsers.</span> <a name="l00033"></a>00033 <span class="comment">//</span> <a name="l00034"></a>00034 <span class="comment">// jhrg 2/3/96</span> <a name="l00035"></a>00035 <a name="l00036"></a>00036 <span class="preprocessor">#ifndef _parser_h</span> <a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor">#define _parser_h</span> <a name="l00038"></a>00038 <span class="preprocessor"></span> <a name="l00039"></a>00039 <span class="preprocessor">#ifndef _error_h</span> <a name="l00040"></a>00040 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="Error_8h.html">Error.h</a>"</span> <a name="l00041"></a>00041 <span class="preprocessor">#endif</span> <a name="l00042"></a>00042 <span class="preprocessor"></span> <a name="l00043"></a><a class="code" href="parser_8h.html#a853b3bfad6d2b2ff693dce81182e0c2e">00043</a> <span class="preprocessor">#define YYDEBUG 1</span> <a name="l00044"></a>00044 <span class="preprocessor"></span><span class="preprocessor">#undef YYERROR_VERBOSE</span> <a name="l00045"></a><a class="code" href="parser_8h.html#ae29b9eafd525b0fd9b1ecba8c44e5dbb">00045</a> <span class="preprocessor"></span><span class="preprocessor">#define YY_NO_UNPUT 1</span> <a name="l00046"></a>00046 <span class="preprocessor"></span> <a name="l00047"></a><a class="code" href="parser_8h.html#abbd59523961c68f6a95e165f82aeed6e">00047</a> <span class="preprocessor">#define ID_MAX 256</span> <a name="l00048"></a>00048 <span class="preprocessor"></span> <a name="l00049"></a>00049 <span class="preprocessor">#ifndef TRUE</span> <a name="l00050"></a><a class="code" href="parser_8h.html#aa8cecfc5c5c054d2875c03e77b7be15d">00050</a> <span class="preprocessor"></span><span class="preprocessor">#define TRUE 1</span> <a name="l00051"></a><a class="code" href="parser_8h.html#aa93f0eb578d23995850d61f7d61c55c1">00051</a> <span class="preprocessor"></span><span class="preprocessor">#define FALSE 0</span> <a name="l00052"></a>00052 <span class="preprocessor"></span><span class="preprocessor">#endif</span> <a name="l00053"></a>00053 <span class="preprocessor"></span> <a name="l00054"></a>00054 <span class="keyword">namespace </span>libdap <a name="l00055"></a>00055 { <a name="l00056"></a>00056 <a name="l00068"></a><a class="code" href="structlibdap_1_1parser__arg.html">00068</a> <span class="keyword">struct </span><a class="code" href="structlibdap_1_1parser__arg.html" title="Pass parameters by reference to a parser.">parser_arg</a> <a name="l00069"></a>00069 { <a name="l00070"></a><a class="code" href="structlibdap_1_1parser__arg.html#a2d6b2caec66541320ce53f9a09dd041f">00070</a> <span class="keywordtype">void</span> *<a class="code" href="structlibdap_1_1parser__arg.html#a2d6b2caec66541320ce53f9a09dd041f">_object</a>; <span class="comment">// nominally a pointer to an object</span> <a name="l00071"></a><a class="code" href="structlibdap_1_1parser__arg.html#a912598a01de6e4754d574e6f44ff6175">00071</a> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a> *<a class="code" href="structlibdap_1_1parser__arg.html#a912598a01de6e4754d574e6f44ff6175">_error</a>; <span class="comment">// a pointer to an Error object</span> <a name="l00072"></a><a class="code" href="structlibdap_1_1parser__arg.html#a79ae292787f4b27d51eef39a6affc186">00072</a> <span class="keywordtype">int</span> <a class="code" href="structlibdap_1_1parser__arg.html#a79ae292787f4b27d51eef39a6affc186">_status</a>; <span class="comment">// parser status</span> <a name="l00073"></a>00073 <a name="l00074"></a><a class="code" href="structlibdap_1_1parser__arg.html#adff2d73194c4cf53b07e04b03ffbb2a3">00074</a> <a class="code" href="structlibdap_1_1parser__arg.html#adff2d73194c4cf53b07e04b03ffbb2a3">parser_arg</a>() : <a class="code" href="structlibdap_1_1parser__arg.html#a2d6b2caec66541320ce53f9a09dd041f">_object</a>(0), <a class="code" href="structlibdap_1_1parser__arg.html#a912598a01de6e4754d574e6f44ff6175">_error</a>(0), <a class="code" href="structlibdap_1_1parser__arg.html#a79ae292787f4b27d51eef39a6affc186">_status</a>(1) <a name="l00075"></a>00075 {} <a name="l00076"></a><a class="code" href="structlibdap_1_1parser__arg.html#a0accba0cdb65224a3711f763ba3aa26c">00076</a> <a class="code" href="structlibdap_1_1parser__arg.html#adff2d73194c4cf53b07e04b03ffbb2a3">parser_arg</a>(<span class="keywordtype">void</span> *obj) : <a class="code" href="structlibdap_1_1parser__arg.html#a2d6b2caec66541320ce53f9a09dd041f">_object</a>(obj), <a class="code" href="structlibdap_1_1parser__arg.html#a912598a01de6e4754d574e6f44ff6175">_error</a>(0), <a class="code" href="structlibdap_1_1parser__arg.html#a79ae292787f4b27d51eef39a6affc186">_status</a>(1) <a name="l00077"></a>00077 {} <a name="l00078"></a><a class="code" href="structlibdap_1_1parser__arg.html#ab54c9eb5fbb20a40c6ff98547cfc6b74">00078</a> <span class="keyword">virtual</span> <a class="code" href="structlibdap_1_1parser__arg.html#ab54c9eb5fbb20a40c6ff98547cfc6b74">~parser_arg</a>() <a name="l00079"></a>00079 { <a name="l00080"></a>00080 <span class="keywordflow">if</span> (<a class="code" href="structlibdap_1_1parser__arg.html#a912598a01de6e4754d574e6f44ff6175">_error</a>) { <a name="l00081"></a>00081 <span class="keyword">delete</span> <a class="code" href="structlibdap_1_1parser__arg.html#a912598a01de6e4754d574e6f44ff6175">_error</a>; <a class="code" href="structlibdap_1_1parser__arg.html#a912598a01de6e4754d574e6f44ff6175">_error</a> = 0; <a name="l00082"></a>00082 } <a name="l00083"></a>00083 } <a name="l00084"></a>00084 <a name="l00085"></a><a class="code" href="structlibdap_1_1parser__arg.html#a0a7751413e25e9bbf4056e173c9ddb4c">00085</a> <span class="keywordtype">void</span> *<a class="code" href="structlibdap_1_1parser__arg.html#a0a7751413e25e9bbf4056e173c9ddb4c">object</a>() <a name="l00086"></a>00086 { <a name="l00087"></a>00087 <span class="keywordflow">return</span> <a class="code" href="structlibdap_1_1parser__arg.html#a2d6b2caec66541320ce53f9a09dd041f">_object</a>; <a name="l00088"></a>00088 } <a name="l00089"></a><a class="code" href="structlibdap_1_1parser__arg.html#a34ebeb31383ed403bdcb51c1296e045c">00089</a> <span class="keywordtype">void</span> <a class="code" href="structlibdap_1_1parser__arg.html#a34ebeb31383ed403bdcb51c1296e045c">set_object</a>(<span class="keywordtype">void</span> *obj) <a name="l00090"></a>00090 { <a name="l00091"></a>00091 <a class="code" href="structlibdap_1_1parser__arg.html#a2d6b2caec66541320ce53f9a09dd041f">_object</a> = obj; <a name="l00092"></a>00092 } <a name="l00093"></a><a class="code" href="structlibdap_1_1parser__arg.html#aac907c4af9223d97d27ee38b4ebc1623">00093</a> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a> *<a class="code" href="structlibdap_1_1parser__arg.html#aac907c4af9223d97d27ee38b4ebc1623">error</a>() <a name="l00094"></a>00094 { <a name="l00095"></a>00095 <span class="keywordflow">return</span> <a class="code" href="structlibdap_1_1parser__arg.html#a912598a01de6e4754d574e6f44ff6175">_error</a>; <a name="l00096"></a>00096 } <a name="l00097"></a><a class="code" href="structlibdap_1_1parser__arg.html#a2cb138c323c70e10bc2dd88c620da8fb">00097</a> <span class="keywordtype">void</span> <a class="code" href="structlibdap_1_1parser__arg.html#a2cb138c323c70e10bc2dd88c620da8fb">set_error</a>(<a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a> *obj) <a name="l00098"></a>00098 { <a name="l00099"></a>00099 <a class="code" href="structlibdap_1_1parser__arg.html#a912598a01de6e4754d574e6f44ff6175">_error</a> = obj; <a name="l00100"></a>00100 } <a name="l00101"></a><a class="code" href="structlibdap_1_1parser__arg.html#a9d4f550e0ca6188501290d42382e85a2">00101</a> <span class="keywordtype">int</span> <a class="code" href="structlibdap_1_1parser__arg.html#a9d4f550e0ca6188501290d42382e85a2">status</a>() <a name="l00102"></a>00102 { <a name="l00103"></a>00103 <span class="keywordflow">return</span> <a class="code" href="structlibdap_1_1parser__arg.html#a79ae292787f4b27d51eef39a6affc186">_status</a>; <a name="l00104"></a>00104 } <a name="l00105"></a><a class="code" href="structlibdap_1_1parser__arg.html#af85c0af7b6334cf672679469eb7387a4">00105</a> <span class="keywordtype">void</span> <a class="code" href="structlibdap_1_1parser__arg.html#af85c0af7b6334cf672679469eb7387a4">set_status</a>(<span class="keywordtype">int</span> val = 0) <a name="l00106"></a>00106 { <a name="l00107"></a>00107 <a class="code" href="structlibdap_1_1parser__arg.html#a79ae292787f4b27d51eef39a6affc186">_status</a> = val; <a name="l00108"></a>00108 } <a name="l00109"></a>00109 }; <a name="l00110"></a>00110 <a name="l00130"></a>00130 <span class="keywordtype">void</span> <a class="code" href="namespacelibdap.html#abe3f160643e31cc5a43ab97b389a7d6f">parse_error</a>(parser_arg *arg, <span class="keyword">const</span> <span class="keywordtype">char</span> *s, <span class="keyword">const</span> <span class="keywordtype">int</span> line_num = 0, <a name="l00131"></a>00131 <span class="keyword">const</span> <span class="keywordtype">char</span> *context = 0); <a name="l00132"></a>00132 <span class="keywordtype">void</span> <a class="code" href="namespacelibdap.html#abe3f160643e31cc5a43ab97b389a7d6f">parse_error</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &msg, <span class="keyword">const</span> <span class="keywordtype">int</span> line_num, <a name="l00133"></a>00133 <span class="keyword">const</span> <span class="keywordtype">char</span> *context = 0); <a name="l00135"></a>00135 <a name="l00150"></a>00150 <span class="keywordtype">void</span> <a class="code" href="namespacelibdap.html#a88b0cc055e14caf84865c2d5730d4fb3" title="Save a string to a temporary variable during the parse.">save_str</a>(<span class="keywordtype">char</span> *dst, <span class="keyword">const</span> <span class="keywordtype">char</span> *src, <span class="keyword">const</span> <span class="keywordtype">int</span> line_num); <a name="l00151"></a>00151 <span class="keywordtype">void</span> <a class="code" href="namespacelibdap.html#a88b0cc055e14caf84865c2d5730d4fb3" title="Save a string to a temporary variable during the parse.">save_str</a>(<span class="keywordtype">string</span> &dst, <span class="keyword">const</span> <span class="keywordtype">char</span> *src, <span class="keyword">const</span> <span class="keywordtype">int</span>); <a name="l00152"></a>00152 <a name="l00153"></a>00153 <span class="keywordtype">bool</span> <a class="code" href="namespacelibdap.html#af6521dec3b141314aab525bccfaa7bbe">is_keyword</a>(<span class="keywordtype">string</span> <span class="keywordtype">id</span>, <span class="keyword">const</span> <span class="keywordtype">string</span> &keyword); <a name="l00154"></a>00154 <a name="l00166"></a>00166 <span class="keywordtype">int</span> <a class="code" href="namespacelibdap.html#a6159f969729b3625cfb42b97b76a29b6" title="Is the value a valid byte?">check_byte</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *val); <a name="l00167"></a>00167 <a name="l00175"></a>00175 <span class="keywordtype">int</span> <a class="code" href="namespacelibdap.html#a78501bb2d0a23568042d59281ed27072" title="Is the value a valid integer?">check_int16</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *val); <a name="l00176"></a>00176 <span class="keywordtype">int</span> <a class="code" href="namespacelibdap.html#a179d079ad6ee351b8944f44059e3e797">check_uint16</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *val); <a name="l00177"></a>00177 <span class="keywordtype">int</span> <a class="code" href="namespacelibdap.html#aa9db83b431346800f838b089fafb0066">check_int32</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *val); <a name="l00178"></a>00178 <span class="keywordtype">int</span> <a class="code" href="namespacelibdap.html#a754cae6f64ff4052f6e694184a68938c">check_uint32</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *val); <a name="l00179"></a>00179 <a name="l00184"></a>00184 <span class="keywordtype">int</span> <a class="code" href="namespacelibdap.html#a8e3daffef90939dcbb46fb6f50b9a40e" title="Is the value a valid float?">check_float32</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *val); <a name="l00185"></a>00185 <span class="keywordtype">int</span> <a class="code" href="namespacelibdap.html#a0004b07014e0ece91b7f363e805ceca1">check_float64</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *val); <a name="l00186"></a>00186 <a name="l00191"></a>00191 <span class="keywordtype">int</span> <a class="code" href="namespacelibdap.html#a0e96bac2251d066910b2647830b6959c" title="Is the value a valid URL?">check_url</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *val); <a name="l00192"></a>00192 <a name="l00193"></a>00193 } <span class="comment">// namespace libdap</span> <a name="l00194"></a>00194 <a name="l00195"></a>00195 <span class="preprocessor">#endif // _parser_h</span> <a name="l00196"></a>00196 <span class="preprocessor"></span> </pre></div></div> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="parser_8h.html">parser.h</a> </li> <li class="footer">Generated on Tue Feb 8 2011 for libdap++ by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </li> </ul> </div> </body> </html>