00001 // cmdparser.h 00002 // 00003 // Parse Celestia command files and turn them into CommandSequences. 00004 // 00005 // Copyright (C) 2001 Chris Laurel <claurel@shatters.net> 00006 // 00007 // This program is free software; you can redistribute it and/or 00008 // modify it under the terms of the GNU General Public License 00009 // as published by the Free Software Foundation; either version 2 00010 // of the License, or (at your option) any later version. 00011 00012 #ifndef _CMDPARSER_H_ 00013 #define _CMDPARSER_H_ 00014 00015 #include <iostream> 00016 #include <celengine/parser.h> 00017 #include <celengine/command.h> 00018 00019 00020 class CommandParser 00021 { 00022 public: 00023 CommandParser(std::istream&); 00024 CommandParser(Tokenizer&); 00025 ~CommandParser(); 00026 00027 CommandSequence* parse(); 00028 const std::vector<std::string>* getErrors() const; 00029 00030 private: 00031 Command* parseCommand(); 00032 void error(const string); 00033 00034 Parser* parser; 00035 Tokenizer* tokenizer; 00036 std::vector<std::string> errorList; 00037 }; 00038 00039 #endif // _CMDPARSER_H_ 00040
1.4.1