// // This file is part of Mipsy, a tiny MIPS simulator // Copyright (C) 2003 Benoit Perrot // // Mipsy is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // Mipsy is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // #include "parse/asm-parse.hh" // Export parsed file name. char *filename = 0; // Define exported parse functions. namespace parse { // Display the results of intermediate steps. int trace_scan_p = 0; int trace_parse_p = 0; // Authorize unlimited registers. bool unlimited_regs_p = false; // Fill delay slot of native branch instructions with NOP. bool fill_delay_slot_p = false; // Parse a MIPS asm file, return the corresponding abstract syntax. ::inst::Program* parse (const std::string &fname) { yy::Parser parser = yy::Parser (trace_parse_p, yy::Location ()); yy::program_builder.reset(fill_delay_slot_p); scan_open (fname); parser.parse (); scan_close (); return ::yy::program_builder.get(); } } // namespace parse