Example #1
0
        void Start()
        {
            foreach (var name in SGA.MembAC(typeof(Transform), "p", SuggestionTree.MembK.Any()).Select(mi => mi.Name))
            {
                Debug.Log(name);
            }

            // ----------------------------------------

            var GE = new GrammarEntry()
            {
                StartProd      = TestGrammar.StartProd,
                TR_constructor = (nn) => new StartTU((TestGrammar.StartNode)nn)
            };
            var TLHS = new TranslateLHS()
            {
                preCH_LHS = null,
                scope     = new CH_closedScope()
            };
            var compilat = TranslateEntry.TranslateFully(">> :Transform ..position ", GE, TLHS);
            var MM       = new MemMapper();
            var res      = Evaluate.Eval(compilat, MM);

            Analyz0r.A.JsonifyEval(compilat, MM);
            Analyz0r.A.JsonifyCompilat(compilat);
            Debug.Log("DIIIIIIIIIIIIIIIInGs" + string.Join("--", res.values.Select(_ => _.ToString()).ToArray()));
        }
Example #2
0
    public static Column Eval(string strExpr, GrammarEntry GE, TranslateLHS trans_LHS, MemMapper MM, out CH_closedScope scope_out)
    {
        var compilat = TranslateEntry.TranslateFully(strExpr, GE, trans_LHS);

        scope_out = compilat.deltaScope.close();

        #if todo_fixme             // external refs in the scopes still need implementation ( done . todo plug this shit in )
        foreach (var sc_ref in compilat.ownDecls)
        {
            scope_out = (ClosedScope)scope_out.decl(sc_ref);
        }
        #endif

        compilat.run(MM);  // atm the MM keeps references on tmp columns around forever - some pruning mechanism is needed
        VBoxTU last_VBT = compilat.VBoxTrs.Last();
        return(MM.getGen(last_VBT.CH_out));
    }