Inheritance: MissingTokenInserterBase
        public static void Run(
            TreeElement node,
            ILexer lexer,
            ITokenOffsetProvider offsetProvider,
            bool trimTokens,
            SeldomInterruptChecker interruptChecker,
            ITokenIntern intern)
        {
            Assertion.Assert(node.parent == null, "node.parent == null");

            var root = node as CompositeElement;
            if (root == null)
            {
                return;
            }

            var inserter = new NTriplesMissingTokensInserter(lexer, offsetProvider, interruptChecker, intern);
            lexer.Start();

            if (trimTokens)
            {
                using (var container = new DummyContainer(root))
                {
                    inserter.Run(container);
                }
            }
            else
            {
                var terminator = new EofToken(lexer.Buffer);
                root.AppendNewChild(terminator);
                inserter.Run(root);
                root.DeleteChildRange(terminator, terminator);
            }
        }
        public static void Run(
            TreeElement node,
            ILexer lexer,
            ITokenOffsetProvider offsetProvider,
            bool trimTokens,
            SeldomInterruptChecker interruptChecker,
            ITokenIntern intern)
        {
            Assertion.Assert(node.parent == null, "node.parent == null");

            var root = node as CompositeElement;

            if (root == null)
            {
                return;
            }

            var inserter = new NTriplesMissingTokensInserter(lexer, offsetProvider, interruptChecker, intern);

            lexer.Start();

            if (trimTokens)
            {
                using (var container = new DummyContainer(root))
                {
                    inserter.Run(container);
                }
            }
            else
            {
                var terminator = new EofToken(lexer.Buffer);
                root.AppendNewChild(terminator);
                inserter.Run(root);
                root.DeleteChildRange(terminator, terminator);
            }
        }
Exemple #3
0
 private void InsertMissingTokens(TreeElement result, bool trimMissingTokens, ITokenIntern intern)
 {
     NTriplesMissingTokensInserter.Run(result, this.originalLexer, this, trimMissingTokens, this.myCheckForInterrupt, intern);
 }