コード例 #1
0
    public static Compilat TranslateFully(string src, GrammarEntry GE, TranslateLHS eval_LHS)
    {
        ParserComb.NamedNode NN = LexxAndParse(src, GE.StartProd);


        var TR         = GE.TR_constructor(NN);
        var deltaScope = new preCH_deltaScope(eval_LHS.scope);
        preCH_deltaScope combinedScope = TR.scope(deltaScope);

        var OPs     = TR.emit().ToArray();
        var VBoxTrs = TR.VBoxTUs;

        // basic compile sanity
        // if ( ! ( VBoxTrs.SelectMany ( vbx => vbx.emit()).Count() == OPs.Length ))throw new Exception();
        // figgn! ... im allgemeinen stimmt das gar nicht der OPSuiGen ist in keiner VBoxTU enthalten, so wie das im Moment generiert wird
        // ---

        return(new Compilat {
            deltaScope = (CH_deltaScope)combinedScope.instantiate(),
            OPs = OPs,
            src = src,
            VBoxTrs = VBoxTrs
        });
    }