public override object Deserialize(Type t)
        {
            using (StreamReader fr = new StreamReader(FileName))
            {
                List<Token> tokens = new List<Token>();
                TokenStream stream = new TokenStream(fr);
                Token tok;
                while (!stream.IsEmpty())
                    tokens.Add(stream.ReadToken());

                return tokens;
            }
        }
 internal void TestTokens(string toParse, params Token[] expected)
 {
     TokenStream stream = new TokenStream(new StringReader(toParse));
     List<Token> actual = new List<Token>();
     while (!stream.IsEmpty())
         actual.Add(stream.ReadToken());
     Assert.IsTrue(stream.IsEmpty());
     CollectionAssert.AreEqual(expected, actual);
 }
Esempio n. 3
0
 public Parser(Type t, TokenStream tokenStream, SerializationContext context)
 {
     _deserializedType = t;
     _tokenStream = tokenStream;
     _context = context;
 }