a00083.html 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
  5. <title>GTL - Graph Template Library: gml_scanner.h Source File</title>
  6. <link href="doxygen.css" rel="stylesheet" type="text/css">
  7. </head>
  8. <body>
  9. <p class="links">
  10. <a href="../index.html">Home</a> |
  11. Documentation |
  12. <a href="../register.html">Download</a> |
  13. <a href="../platforms.html">Platforms</a> |
  14. <a href="../refer.html">Projects</a> |
  15. <a href="../lists.html">Mailing Lists</a> |
  16. <a href="../history.html">Version History</a>
  17. </p>
  18. <!-- Generated by Doxygen 1.5.3 -->
  19. <div class="tabs">
  20. <ul>
  21. <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
  22. <li><a href="classes.html"><span>Classes</span></a></li>
  23. <li class="current"><a href="files.html"><span>Files</span></a></li>
  24. <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  25. </ul>
  26. </div>
  27. <h1>gml_scanner.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//==========================================================================</span>
  28. <a name="l00002"></a>00002 <span class="comment">//</span>
  29. <a name="l00003"></a>00003 <span class="comment">// gml_scanner.h </span>
  30. <a name="l00004"></a>00004 <span class="comment">//</span>
  31. <a name="l00005"></a>00005 <span class="comment">//==========================================================================</span>
  32. <a name="l00006"></a>00006 <span class="comment">// $Id: gml_scanner.h,v 1.11 2000/03/06 15:16:52 raitner Exp $</span>
  33. <a name="l00007"></a>00007
  34. <a name="l00008"></a>00008 <span class="preprocessor">#ifndef GTL_GML_SCANNER_H</span>
  35. <a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#define GTL_GML_SCANNER_H</span>
  36. <a name="l00010"></a>00010 <span class="preprocessor"></span>
  37. <a name="l00011"></a>00011 <span class="preprocessor">#include &lt;GTL/GTL.h&gt;</span>
  38. <a name="l00012"></a>00012
  39. <a name="l00013"></a>00013 <span class="preprocessor">#include &lt;cstdio&gt;</span>
  40. <a name="l00014"></a>00014
  41. <a name="l00015"></a>00015 __GTL_BEGIN_NAMESPACE
  42. <a name="l00016"></a>00016
  43. <a name="l00017"></a>00017 <span class="comment">/*</span>
  44. <a name="l00018"></a>00018 <span class="comment"> * start-size of buffers for reading strings. If too small it will be enlarged</span>
  45. <a name="l00019"></a>00019 <span class="comment"> * dynamically</span>
  46. <a name="l00020"></a>00020 <span class="comment"> */</span>
  47. <a name="l00021"></a>00021
  48. <a name="l00022"></a>00022 <span class="preprocessor">#define INITIAL_SIZE 1024</span>
  49. <a name="l00023"></a>00023 <span class="preprocessor"></span>
  50. <a name="l00024"></a>00024 GTL_EXTERN <span class="keyword">typedef</span> <span class="keyword">enum</span> {
  51. <a name="l00025"></a>00025 GML_KEY, GML_INT, GML_DOUBLE, GML_STRING, GML_L_BRACKET,
  52. <a name="l00026"></a>00026 GML_R_BRACKET, GML_END, GML_LIST, GML_ERROR
  53. <a name="l00027"></a>00027 } GML_value;
  54. <a name="l00028"></a>00028
  55. <a name="l00029"></a>00029
  56. <a name="l00033"></a>00033 GTL_EXTERN <span class="keyword">typedef</span> <span class="keyword">enum</span> {
  57. <a name="l00034"></a>00034 GML_UNEXPECTED, GML_SYNTAX, GML_PREMATURE_EOF, GML_TOO_MANY_DIGITS,
  58. <a name="l00035"></a>00035 GML_OPEN_BRACKET, GML_TOO_MANY_BRACKETS, GML_OK, GML_FILE_NOT_FOUND
  59. <a name="l00036"></a>00036 } GML_error_value;
  60. <a name="l00037"></a>00037
  61. <a name="l00038"></a>00038
  62. <a name="l00051"></a><a class="code" href="a00013.html">00051</a> <span class="keyword">struct </span>GTL_EXTERN <a class="code" href="a00013.html" title="Reason and position of an error in a GML file.">GML_error</a> {
  63. <a name="l00076"></a><a class="code" href="a00013.html#66fe2c5a3d2d40e77ff486007dfe7f76">00076</a> GML_error_value err_num;
  64. <a name="l00077"></a>00077
  65. <a name="l00083"></a><a class="code" href="a00013.html#4e9d11b6501f91a982af87f45962b7b3">00083</a> <span class="keywordtype">int</span> line;
  66. <a name="l00084"></a>00084
  67. <a name="l00088"></a><a class="code" href="a00013.html#0708757bcd78a82077a0577982f2c433">00088</a> <span class="keywordtype">int</span> column;
  68. <a name="l00089"></a>00089 };
  69. <a name="l00090"></a>00090
  70. <a name="l00091"></a>00091
  71. <a name="l00092"></a>00092 <span class="keyword">union </span>GTL_EXTERN GML_tok_val {
  72. <a name="l00093"></a>00093 <span class="keywordtype">long</span> integer;
  73. <a name="l00094"></a>00094 <span class="keywordtype">double</span> floating;
  74. <a name="l00095"></a>00095 <span class="keywordtype">char</span>* str;
  75. <a name="l00096"></a>00096 <span class="keyword">struct </span><a class="code" href="a00013.html" title="Reason and position of an error in a GML file.">GML_error</a> err;
  76. <a name="l00097"></a>00097 };
  77. <a name="l00098"></a>00098
  78. <a name="l00102"></a>00102 <span class="keyword">struct </span>GTL_EXTERN GML_token {
  79. <a name="l00103"></a>00103 GML_value kind;
  80. <a name="l00104"></a>00104 <span class="keyword">union </span>GML_tok_val value;
  81. <a name="l00105"></a>00105 };
  82. <a name="l00106"></a>00106
  83. <a name="l00107"></a>00107 <span class="comment">/*</span>
  84. <a name="l00108"></a>00108 <span class="comment"> * global variables</span>
  85. <a name="l00109"></a>00109 <span class="comment"> */</span>
  86. <a name="l00110"></a>00110
  87. <a name="l00111"></a>00111 GTL_EXTERN <span class="keyword">extern</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> GML_line;
  88. <a name="l00112"></a>00112 GTL_EXTERN <span class="keyword">extern</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> GML_column;
  89. <a name="l00113"></a>00113
  90. <a name="l00114"></a>00114 <span class="comment">/*</span>
  91. <a name="l00115"></a>00115 <span class="comment"> * if you are interested in the position where an error occured it is a good</span>
  92. <a name="l00116"></a>00116 <span class="comment"> * idea to set GML_line and GML_column back. </span>
  93. <a name="l00117"></a>00117 <span class="comment"> * This is what GML_init does.</span>
  94. <a name="l00118"></a>00118 <span class="comment"> */</span>
  95. <a name="l00119"></a>00119
  96. <a name="l00120"></a>00120 GTL_EXTERN <span class="keywordtype">void</span> GML_init ();
  97. <a name="l00121"></a>00121
  98. <a name="l00122"></a>00122 <span class="comment">/*</span>
  99. <a name="l00123"></a>00123 <span class="comment"> * returns the next token in file. If an error occured it will be stored in </span>
  100. <a name="l00124"></a>00124 <span class="comment"> * GML_token.</span>
  101. <a name="l00125"></a>00125 <span class="comment"> */</span>
  102. <a name="l00126"></a>00126
  103. <a name="l00127"></a>00127 GTL_EXTERN <span class="keyword">struct </span>GML_token GML_scanner (FILE*);
  104. <a name="l00128"></a>00128
  105. <a name="l00129"></a>00129 GTL_EXTERN <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* GML_table[];
  106. <a name="l00130"></a>00130
  107. <a name="l00131"></a>00131 __GTL_END_NAMESPACE
  108. <a name="l00132"></a>00132
  109. <a name="l00133"></a>00133 <span class="preprocessor">#endif // GTL_GML_SCANNER_H</span>
  110. <a name="l00134"></a>00134 <span class="preprocessor"></span>
  111. <a name="l00135"></a>00135 <span class="comment">//--------------------------------------------------------------------------</span>
  112. <a name="l00136"></a>00136 <span class="comment">// end of file</span>
  113. <a name="l00137"></a>00137 <span class="comment">//--------------------------------------------------------------------------</span>
  114. </pre></div> <p class="links">
  115. <a href="http://www.uni-passau.de/">University of Passau</a>
  116. &nbsp;-&nbsp;
  117. <a href="http://www.fmi.uni-passau.de/">FMI</a>
  118. &nbsp;-&nbsp;
  119. <a href="http://www.fmi.uni-passau.de/fmi/lehrstuehle/brandenburg/">Theoretical
  120. Computer Science</a>
  121. </p>
  122. <div class="copyright">
  123. Design &copy; 2002, 2003 <a href="mailto:raitner@fmi.uni-passau.de">Marcus Raitner</a>, University of Passau
  124. </div>
  125. </body>
  126. </html>