inter-pass.hxx

Go to the documentation of this file.
00001 #ifndef INTER_PASS_HXX
00002 #define INTER_PASS_HXX
00003 
00004 /**************************************************************************
00005  *
00006  * Copyright (C) 2008, Johns Hopkins University.
00007  * All rights reserved.
00008  *
00009  * Redistribution and use in source and binary forms, with or
00010  * without modification, are permitted provided that the following
00011  * conditions are met:
00012  *
00013  *   - Redistributions of source code must contain the above
00014  *     copyright notice, this list of conditions, and the following
00015  *     disclaimer.
00016  *
00017  *   - Redistributions in binary form must reproduce the above
00018  *     copyright notice, this list of conditions, and the following
00019  *     disclaimer in the documentation and/or other materials
00020  *     provided with the distribution.
00021  *
00022  *   - Neither the names of the copyright holders nor the names of any
00023  *     of any contributors may be used to endorse or promote products
00024  *     derived from this software without specific prior written
00025  *     permission.
00026  *
00027  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00028  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00029  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00030  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00031  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00032  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00033  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00034  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00035  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00036  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00037  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00038  *
00039  **************************************************************************/
00040 
00041 #include "UocInfo.hxx"
00042 #include "AST.hxx"
00043 #include "Type.hxx"
00044 
00047 
00049 enum ResolutionMode {
00051   NULL_MODE   = 0x0u,
00056   DEF_MODE    = 0x1u,
00061   USE_MODE    = 0x2u,
00066   DECL_MODE   = 0x3u,
00068   LOCAL_MODE  = 0x4u,
00070   TYPE_MODE   = 0x5u
00071 };
00072 
00073 #define CHKERR(noerr, exp) \
00074   do {                           \
00075     bool ans = (exp);           \
00076     if (ans == false)           \
00077       (noerr) = false;           \
00078   }while (0)
00079 
00080 #define BE_CHKERR(noerr, exp)         \
00081   do {                                 \
00082     bool ans = (exp);                 \
00083     assert(ans);                 \
00084     if (ans == false)                 \
00085       (noerr) = false;                 \
00086   }while (0)
00087 
00088 // Final expression of a let
00089 #define FEXPR(let) (let)->child(1)
00090 // Identifier in a identPattern let
00091 #define IDENT(let) (let)->child(0)->child(0)
00092 
00093 // Ignore identifier at the following positions:
00094 // at_uswitch *ident* expr sw_legs ow
00095 // at_try expr *ident* sw_legs ow
00096 #define IGNORE(ast) ((size_t)(((ast)->astType == at_uswitch)?0:1))
00097 
00098 void BitcP(std::ostream& out,
00099            const boost::shared_ptr<AST> ast,
00100            bool showTypes);
00101 
00102 void addDecl(boost::shared_ptr<AST> decl);
00103 extern void fatal();
00104 
00105 #endif /* INTER_PASS_HXX */

Generated on Fri Feb 10 07:59:20 2012 for BitC Compiler by  doxygen 1.4.7