Esempio n. 1
0
        public ForkableScanner Create(SourceReader source)
        {
            CodeContract.RequiresArgumentNotNull(source, "source");

            Scanner masterScanner = new Scanner(ScannerInfo);

            masterScanner.SetSource(source);
            masterScanner.SetTriviaTokens(m_triviaTokens);
            masterScanner.ErrorList      = ErrorList;
            masterScanner.RecoverErrors  = RecoverErrors;
            masterScanner.LexicalErrorId = LexicalErrorId;

            return(ForkableScanner.Create(masterScanner));
        }
Esempio n. 2
0
        public void Join(ForkableScanner child)
        {
            CodeContract.RequiresArgumentNotNull(child, "child");
            CodeContract.Requires(child.m_node.MasterScanner != null, "The scanner to join with has been closed");
            CodeContract.Requires(child.m_node.Parent == m_node.Parent, "child", "The scanner to join does not share the parent node with current scanner");

            var parent = m_node.Parent;

            //swap "this" with "child"
            var temp = m_node;
            m_node = child.m_node;
            child.m_node = temp;

            //close other children
            foreach (var otherChild in parent.Children.ToArray())
            {
                if (otherChild != m_node)
                {
                    otherChild.Close();
                }
            }
        }
Esempio n. 3
0
 public void Join(ForkableScanner scanner)
 {
     m_masterScanner = scanner.m_masterScanner;
     m_offset        = scanner.m_offset;
 }
Esempio n. 4
0
 public void Join(ForkableScanner scanner)
 {
     m_core   = scanner.m_core;
     m_offset = scanner.m_offset;
 }
Esempio n. 5
0
 public void Join(ForkableScanner scanner)
 {
     m_core = scanner.m_core;
     m_offset = scanner.m_offset;
 }
Esempio n. 6
0
 public void Join(ForkableScanner scanner)
 {
     m_masterScanner = scanner.m_masterScanner;
     m_offset = scanner.m_offset;
 }