예제 #1
0
        public virtual T RunParser <T>(string source, Document doc) where T : IAst
        {
            var type      = typeof(T);
            var parserObj = default(Object);

            if (!BuilderInstances.TryGetValue(type, out parserObj))
            {
                throw new ElideException("Unable to find parser for '{0}'.", type);
            }

            var parser = (ICodeParser <T>)parserObj;

            parser.App = App;
            return(RunParser(source, doc, parser));
        }
예제 #2
0
        public virtual T RunBuilder <T>(string source, Document doc, BuildOptions options, params ExtendedOption[] extOptions) where T : ICompiledAssembly
        {
            var type       = typeof(T);
            var builderObj = default(Object);

            if (!BuilderInstances.TryGetValue(type, out builderObj))
            {
                throw new ElideException("Unable to find builder for '{0}'.", type);
            }

            var builder = (ICodeBuilder <T>)builderObj;

            builder.App = App;
            return(RunBuilder(source, doc, options, builder, extOptions));
        }