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

/magnus/back_end/Group/include/EquationParser.h

Go to the documentation of this file.
00001 /*
00002  *   $Id: EquationParser.h,v 1.2 1996/11/06 00:56:44 paderin Exp $
00003  */
00004 
00005 // Copyright (C) 1995 The New York Group Theory Cooperative
00006 // See magnus/doc/COPYRIGHT for the full notice.
00007 
00008 // Contents: Definition of class EquationParser
00009 //
00010 // Principal Author: Roger Needham
00011 //
00012 // Status: in progress
00013 //
00014 // Revision History:
00015 //
00016 
00017 #ifndef _EQUATIONPARSER_H_
00018 #define _EQUATIONPARSER_H_
00019 
00020 
00021 #include "PresentationParser.h"
00022 
00023 
00024 // The grammar for an equation (see the Word grammar):
00025 //
00026 // <equation> ::= '(' <generator list>('|' | ';' | ':')<word>('='<word>)? ')'
00027 //
00028 
00029 // It seems expedient to require the end user to enter equations in a way
00030 // similar to presentations, so that the existing parsers can be used.
00031 
00032 
00033 //---------------------------------------------------------------------------//
00034 //-------------------------- EquationParser ---------------------------------//
00035 //---------------------------------------------------------------------------//
00036 
00037 class EquationParser : protected PresentationParser
00038 {
00039 public:
00040 
00041   /////////////////////////////////////////////////////////////////////////
00042   //                                                                     //
00043   // Constructors:                                                       //
00044   //                                                                     //
00045   /////////////////////////////////////////////////////////////////////////
00046 
00047   EquationParser(istream &istr) : PresentationParser(istr) { }
00048   // Initialize the parser with the istream from which to read.
00049 
00050   // Destructor supplied by compiler.
00051 
00052   // The following two methods should be redefined
00053 
00054   virtual Word parseRelator( const VectorOf<Chars>&, Chars& );
00055   virtual void getToken( );
00056 
00057 
00058   /////////////////////////////////////////////////////////////////////////
00059   //                                                                     //
00060   // Parsing Methods:                                                    //
00061   //                                                                     //
00062   /////////////////////////////////////////////////////////////////////////
00063 
00064   Word parseEquation( const VectorOf<Chars>& names,
00065                                                          VectorOf<Chars>& new_names,
00066                                                          Chars& errMesg
00067                                                          );
00068   // Reads an equation and returns it as a word. The new vector of print
00069   // names (generators first, then variables) is returned in new_names.
00070   // As usual, if there is a parse error, the description is returned in
00071   // errMesg.
00072 
00073 };
00074 
00075 #endif

Generated at Tue Jun 19 09:49:36 2001 for Magnus Classes by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001