Esempio n. 1
0
        protected List <Terminal> ExpectTerminalList(Reduction reduction)
        {
            List <Terminal>      found          = new List <Terminal>();
            Predicate <Terminal> expectTerminal = terminal =>
            {
                found.Add(terminal);
                return(true);
            };
            TokenParser parser = new TokenParser(m_isNoise, m_isSynthetic);

            parser.OnCreate(expectTerminal, reduction);
            Assert(found.Count > 0);
            return(found);
        }
Esempio n. 2
0
        protected Terminal ExpectOneTerminal(Reduction reduction)
        {
            Terminal             found          = null;
            Predicate <Terminal> expectTerminal = terminal =>
            {
                if (found != null)
                {
                    return(false);
                }
                found = terminal;
                return(true);
            };
            TokenParser parser = new TokenParser(m_isNoise, m_isSynthetic);

            parser.OnCreate(expectTerminal, reduction);
            Assert(found != null);
            return(found);
        }
Esempio n. 3
0
 protected Terminal ExpectOneTerminal(Reduction reduction)
 {
     Terminal found = null;
     Predicate<Terminal> expectTerminal = terminal =>
     {
         if (found != null)
             return false;
         found = terminal;
         return true;
     };
     TokenParser parser = new TokenParser(m_isNoise, m_isSynthetic);
     parser.OnCreate(expectTerminal, reduction);
     Assert(found != null);
     return found;
 }
Esempio n. 4
0
 protected List<Terminal> ExpectTerminalList(Reduction reduction)
 {
     List<Terminal> found = new List<Terminal>();
     Predicate<Terminal> expectTerminal = terminal =>
     {
         found.Add(terminal);
         return true;
     };
     TokenParser parser = new TokenParser(m_isNoise, m_isSynthetic);
     parser.OnCreate(expectTerminal, reduction);
     Assert(found.Count > 0);
     return found;
 }