00001 /* -*- Mode: c -*- */ 00002 /* 00003 * Copyright (C) 2005, The EROS Group, LLC. 00004 * All rights reserved. 00005 * 00006 * Redistribution and use in source and binary forms, with or 00007 * without modification, are permitted provided that the following 00008 * conditions are met: 00009 * 00010 * - Redistributions of source code must contain the above 00011 * copyright notice, this list of conditions, and the following 00012 * disclaimer. 00013 * 00014 * - Redistributions in binary form must reproduce the above 00015 * copyright notice, this list of conditions, and the following 00016 * disclaimer in the documentation and/or other materials 00017 * provided with the distribution. 00018 * 00019 * - Neither the names of the copyright holders nor the names of any 00020 * of any contributors may be used to endorse or promote products 00021 * derived from this software without specific prior written 00022 * permission. 00023 * 00024 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00025 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00026 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00027 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00028 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00029 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00030 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00031 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00032 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00033 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00034 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00035 */ 00036 00037 // ident name description 00038 PASS(none, "<none>", "<none>") 00039 PASS(parse, "parser", "Parsing") 00040 00041 // The parser-constructed AST tree contains at_mixfix nodes. These 00042 // will be converted to expression trees during symbol resolution, but 00043 // that processing has not yet happened. Any passes between here and 00044 // the symbol resolution phase need to be prepared to handle that. 00045 00046 // Simplify DefRepr declarations into annotated unions to reduce the 00047 // number of cases that need to be handled by later passes: 00048 PASS(reprSimp, "reprsimp", "Defrepr Simplification") 00049 00050 // Simplify redundant expression sequence wrappers. 00051 PASS(beginSimp, "beginsimp", "Some simplifications in the begining") 00052 00053 // Find method declarations within structure and object 00054 // definitions/declarations. Rewrite those by appending the 00055 // corresponding declaration forms just after the structure/object 00056 // definitions/declarations to ensure that type matching requirements 00057 // are met when the corresponding definition is encountered. 00058 PASS(methDecl, "methdecl", "Inject method function proclaims") 00059 00060 // We had originally planned to do MixFix processing in the symbol 00061 // resolution pass, but that doesn't work out well. There are 00062 // quasi-keywords and syntactic tokens '.', ',' and so forth that are 00063 // still marked as identifiers in the at_mixExpr children. We don't 00064 // want those to be touched by the resolver, so we need to clean up 00065 // the at_mixExpr nodes before we try to resolve. 00066 // 00067 // The introduction of mixfix caused me to change the processing of 00068 // AND and OR. The problem is that these they sit in the middle 00069 // of the infix expression precedence hierarchy. This makes it hard 00070 // to deal with them in the parser, where we no longer know the 00071 // precedence of operators. What we do now is gather them like any 00072 // other operator in the expr_infix production, and rewrite them into 00073 // primitive form as a special case. If we eventually add thunkification, 00074 // they will cease to be primitive, and we'll be able to eliminate the 00075 // special handling. 00076 PASS(mixfix, "mixfix", "MixFix Processing") 00077 00078 PASS(symresolve, "symresolve", "Symbol Resolution") 00079 00080 // Below here, MixFix nodes have been converted to normal expression 00081 // trees. The at_mixexpr node should not be encountered below this 00082 // point. The effect of Mixfix introduction, syntax introduction, and 00083 // syntax use forms has been processed and the corresponding AST nodes 00084 // removed. 00085 00086 PASS(typeCheck, "typecheck", "Type Checking") 00087 PASS(locCheck, "loccheck", "Location semantics Checking") 00088 PASS(reprCheck, "reprcheck", "Defrepr Consistency Checking") 00089 PASS(noAllocCheck, "noalloccheck", "No Dynamic Allocation -- Checking") 00090 PASS(initCheck, "initcheck", "Initialization Restriction Checking") 00091 PASS(HoistInstLam, "instlam", "Hoist instance lambdas") 00092 PASS(npass, "<npass>", "<none>") 00093 #undef PASS
1.4.7