Esempio n. 1
0
 public static int[] CheckObjectStart(byte[] line)
 {
     try
     {
         PrTokeniser tk  = new PrTokeniser(line);
         int         num = 0;
         int         gen = 0;
         if (!tk.NextToken() || tk.TokenType != TK_NUMBER)
         {
             return(null);
         }
         num = tk.IntValue;
         if (!tk.NextToken() || tk.TokenType != TK_NUMBER)
         {
             return(null);
         }
         gen = tk.IntValue;
         if (!tk.NextToken())
         {
             return(null);
         }
         if (!tk.StringValue.Equals("obj"))
         {
             return(null);
         }
         return(new[] { num, gen });
     }
     catch
     {
     }
     return(null);
 }
Esempio n. 2
0
 /// <summary>
 /// Reads the next token skipping over the comments.
 /// @throws IOException on error
 /// </summary>
 /// <returns> true  if a token was read,  false  if the end of content was reached</returns>
 public bool NextValidToken()
 {
     while (_tokeniser.NextToken())
     {
         if (_tokeniser.TokenType == PrTokeniser.TK_COMMENT)
         {
             continue;
         }
         return(true);
     }
     return(false);
 }