Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

parser.h

Go to the documentation of this file.
00001 /*
00002  *  Part of rvglue source code,
00003  *  Copyright (C) 2000 Alexander Kroeller (alilein@gmx.de)
00004  *
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018  */
00019 
00020 /*
00021  * $Id: parser.h,v 1.1 2000/05/03 08:46:47 ali Exp ali $
00022  *
00023  * $Log: parser.h,v $
00024  * Revision 1.1  2000/05/03 08:46:47  ali
00025  * Initial revision
00026  *
00027  *
00028  */
00029 #ifndef __PARSER_H
00030 #define __PARSER_H
00031 
00032 #include <stdarg.h>
00033 
00034 #define PT_EOF     1
00035 #define PT_WHITE   2
00036 #define PT_BBEGIN  3
00037 #define PT_BEND    4
00038 #define PT_TEXT    5
00039 #define PT_CBEGIN  6
00040 #define PT_CEND    7
00041 #define PT_LINECOM 8
00042 
00043 
00045 #define MAX_TOK_LENGTH 50
00046 
00047 
00049 class Parser
00050 {
00051 public:
00056   Parser(const char *_fname);
00057 
00062   ~Parser();
00063 
00064 
00073   void error(int errnum, const char *args, ...);
00074 
00076   void print(const char *args, ...);
00077 
00079   void printcurtok(void);
00080 
00085   int curtok;
00086 
00088   char tok_text[MAX_TOK_LENGTH];
00089 
00091   void gentoken(void);
00092 
00101   bool eatOpen(bool force);
00102 
00103 
00112   bool eatClose(bool force);
00113 
00114 
00121   int  eatNumber(void);
00122 
00123   
00132   bool eatSNumber(int &);
00133 
00134 private:
00135   int gchar(void);
00136   void push(void);
00137   int type(int);
00138 
00139   void skipwhite(void);
00140 
00145   void vprint(const char *args, va_list ap);
00146 
00147 private:
00148   char *fname;
00149   FILE *f;
00150   int lineno, curch;
00151 };
00152 
00153 #endif

Generated at Mon Jul 2 16:54:58 2001 for rvtmod/rvglue by doxygen1.2.0 written by Dimitri van Heesch, © 1997-2000