public static void Run(TreeElement node, ILexer lexer, ITokenOffsetProvider offsetProvider, ShaderLabPreProcessor preProcessor, SeldomInterruptChecker interruptChecker, ITokenIntern intern)
        {
            Assertion.Assert(node.parent == null, "node.parent == null");

            var root = node as CompositeElement;

            if (root == null)
            {
                return;
            }

            // Append an EOF token so we insert filtered tokens right up to
            // the end of the file
            var eof = new EofToken(lexer.Buffer.Length);

            root.AppendNewChild(eof);

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

            // Reset the lexer, walk the tree and call ProcessLeafElement on each leaf element
            lexer.Start();
            inserter.Run(root);

            root.DeleteChildRange(eof, eof);
        }
        private void InsertMissingTokens(TreeElement root, ITokenIntern intern)
        {
            var interruptChecker = new SeldomInterruptChecker();

            ShaderLabMissingTokensInserter.Run(root, myOriginalLexer, this, myPreProcessor, interruptChecker, intern);
        }