00001 /* 00002 * File: basic_dfa_spec.cc 00003 * $Id: basic_dfa_spec.cc,v 1.2 2002/07/09 03:04:58 alec Exp $ 00004 * 00005 * Author: Alec Panoviciu (alecu@email.com) 00006 * 00007 * Comments: 00008 * 00009 * Revision history: 00010 * 00011 * $Log: basic_dfa_spec.cc,v $ 00012 * Revision 1.2 2002/07/09 03:04:58 alec 00013 * OWN_STRINGS bu*beep*it finally vanished 00014 * gcc 3.1&mingw - related cleanups 00015 * 00016 * Revision 1.1 2002/05/01 16:34:01 alec 00017 * *** empty log message *** 00018 * 00019 */ 00020 00021 /* 00022 Copyright (C) 2002 Alexandru Panoviciu (alecu@email.com) 00023 00024 This program is free software; you can redistribute it and/or modify 00025 it under the terms of the GNU General Public License as published by 00026 the Free Software Foundation; either version 2 of the License, or 00027 (at your option) any later version. 00028 00029 This program is distributed in the hope that it will be useful, 00030 but WITHOUT ANY WARRANTY; without even the implied warranty of 00031 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00032 GNU General Public License for more details. 00033 00034 You should have received a copy of the GNU General Public License 00035 along with this program; if not, write to the Free Software 00036 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00037 00038 */ 00039 00040 00041 #include "basic_dfa_spec.hh" 00042 00043 #ifdef DEBUG 00044 00045 #include <iostream> 00046 00047 void BasicDfaSpec::dump (ostream &os) 00048 { 00049 os << "DFA : " << name << endl; 00050 00051 for (int i = 0; i < states.size(); i++) { 00052 os << "State #" << i << ": "; 00053 states[i].dump(os); 00054 } 00055 } 00056 00057 void BasicDfaSpec::State::dump(ostream &os) 00058 { 00059 if (isFinal) os << "(Final =>" << tokId << ") " << endl; 00060 else os << endl; 00061 00062 for (int i = 0; i < transitions.size(); i++) 00063 os << "\t\t\'" << transitions[i].on << "\' -> " << transitions[i].to << endl; 00064 } 00065 00066 #endif