Пример #1
0
        protected virtual Handle MakeBlock([NotNull] BlockStartState start, [NotNull] BlockAST blkAST, [NotNull] IList <Handle> alts)
        {
            start.sll = IsSLLDecision(blkAST);

            BlockEndState end = NewState <BlockEndState>(blkAST);

            start.endState = end;
            foreach (Handle alt in alts)
            {
                // hook alts up to decision block
                Epsilon(start, alt.left);
                Epsilon(alt.right, end);
                // no back link in ATN so must walk entire alt to see if we can
                // strip out the epsilon to 'end' state
                TailEpsilonRemover opt = new TailEpsilonRemover(atn);
                opt.Visit(alt.left);
            }
            Handle h = new Handle(start, end);

            //		FASerializer ser = new FASerializer(g, h.left);
            //		System.out.println(blkAST.toStringTree()+":\n"+ser);
            blkAST.atnState = start;

            return(h);
        }