예제 #1
0
        public static BoundBlockStatement Lower(BoundStatement statement)
        {
            var lowerer = new Lowerer();
            var result  = lowerer.RewriteStatement(statement);

            return(Flatten(result));
        }
예제 #2
0
파일: Lowerer.cs 프로젝트: Juptian/Vivian
        public static BoundBlockStatement Lower(Symbol symbol, BoundStatement statement)
        {
            if (!(symbol is FunctionSymbol || symbol is ClassSymbol))
            {
                throw new Exception($"Symbol of type {symbol.Kind} not expected in Lowerer.");
            }

            var lowerer = new Lowerer();
            var result  = lowerer.RewriteStatement(statement);

            return(RemoveDeadCode(Flatten(symbol, result)));
        }