1 /*============================================================================= 2 Copyright (c) 2001-2014 Joel de Guzman 3 4 Distributed under the Boost Software License, Version 1.0. (See accompanying 5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 =============================================================================*/ 7 #if !defined(BOOST_SPIRIT_X3_CALC7_COMPILER_HPP) 8 #define BOOST_SPIRIT_X3_CALC7_COMPILER_HPP 9 10 #include "ast.hpp" 11 12 namespace client 13 { 14 /////////////////////////////////////////////////////////////////////////// 15 // The Compiler 16 /////////////////////////////////////////////////////////////////////////// 17 struct compiler 18 { 19 typedef void result_type; 20 21 std::vector<int>& code; compilerclient::compiler22 compiler(std::vector<int>& code) 23 : code(code) {} 24 25 void operator()(ast::nil) const; 26 void operator()(unsigned int n) const; 27 void operator()(ast::operation const& x) const; 28 void operator()(ast::signed_ const& x) const; 29 void operator()(ast::expression const& x) const; 30 }; 31 } 32 33 #endif 34