コード例 #1
0
        static Source TranslateExpression(Elm.Expression expression)
        {
            var cql    = Modeler.BuildSource("cql.scaly");
            var source = new Source
            {
                FileName = "",
                Usings   = new List <Namespace> {
                    new Namespace {
                        Path = "CQL"
                    }
                },
                Sources = new List <Source> {
                    cql
                },
            };

            if (source.Functions == null)
            {
                source.Functions = new List <Function>();
            }
            var main = Modeler.BuildSource("main.scaly").Functions[0];

            main.Routine.Operation = CompileExpression(expression);
            main.Source            = source;
            source.Functions.Add(main);
            return(source);
        }