00001 /* 00002 _ 00003 _(_)_ _ 00004 _ _ (_)@(_) _(_)_ 00005 | | ___ _ _ ___| |_ ___ _ __ ___ (_)\ (_)@(_) 00006 | | _____ / __| | | / __| __/ _ \ '_ ` _ \ | /(_) 00007 | |___ |_____| \__ \ |_| \__ \ || __/ | | | | | \|/ \|/ 00008 |_____| |___/\__, |___/\__\___|_| |_| |_| \\\|//\\\|/// 00009 ________________________ |___/ ________________________________________ 00010 | |\ 00011 | |_\ 00012 | File : Parser.hpp | 00013 | Created : 04-Dec-2011 | 00014 | By : atrilla | 00015 | | 00016 | L-system - Parallel string rewriting system | 00017 | | 00018 | Copyright (c) 2011 Alexandre Trilla | 00019 | | 00020 | ------------------------------------------------------------------- | 00021 | | 00022 | This file is part of L-system. | 00023 | | 00024 | L-system is free software: you can redistribute it and/or modify it | 00025 | under the terms of the MIT/X11 License as published by the | 00026 | Massachusetts Institute of Technology. See the MIT/X11 License for | 00027 | more details. | 00028 | | 00029 | You should have received a copy of the MIT/X11 License along with | 00030 | this source code distribution of L-system (see the COPYING | 00031 | file in the root directory). If not, see | 00032 | <http://www.opensource.org/licenses/mit-license>. | 00033 |________________________________________________________________________*/ 00034 00035 #ifndef PARSER_HPP 00036 #define PARSER_HPP 00037 00038 #include <string> 00039 #include <set> 00040 #include <map> 00041 #include <fstream> 00042 #include <vector> 00043 00044 using namespace std; 00045 00057 class Parser { 00058 public: 00063 Parser(); 00070 void parse(ifstream& file); 00077 set<char> getAlphabet() const; 00084 string getAxiom() const; 00091 multimap<char, string> getRules() const; 00098 int getIterations() const; 00105 map<char, string> getTurtle() const; 00112 string getReductionScale() const; 00119 vector<string> getInitPos() const; 00126 string getInitAng() const; 00127 private: 00131 set<char> theV; 00135 string theW; 00139 multimap<char, string> theP; 00143 int theNumIters; 00147 map<char, string> theTurtle; 00151 string theScale; 00155 vector<string> theInitPos; 00159 string theInitAng; 00160 }; 00161 00162 #endif 00163
 1.7.1
 1.7.1