public Token error_or_eof_case(
            TokenStream tstream_ptr,
            Token token_ptr,
            int cu_state,
            byte[] token_str,
            int token_ind,
            byte ch
        )
        {
            PexAssume.IsNotNull(tstream_ptr);
            PexAssume.IsNotNull(tstream_ptr.ch_stream);
            PexAssume.IsNotNull(tstream_ptr.ch_stream.fp);
            PexAssume.IsNotNullOrEmpty(tstream_ptr.ch_stream.stream);
            PexAssume.IsNotNull(token_ptr);
            PexAssume.IsNotNullOrEmpty(token_ptr.token_string);
            PexAssume.IsTrue(tstream_ptr.ch_stream.stream_ind > 0 && tstream_ptr.ch_stream.stream_ind < tstream_ptr.ch_stream.stream.Length);
            PexAssume.IsNotNullOrEmpty(token_str);
            PexAssume.IsTrue(token_str.Length > token_ind);
            PexAssume.IsTrue(token_ind > 1 || (token_ind > 0 && cu_state == 0));
            PexAssume.IsTrue(token_str.Length == token_ptr.token_string.Length);

            Token result = Original.error_or_eof_case
                               (tstream_ptr, token_ptr, cu_state, token_str, token_ind, ch);
            return result;
            // TODO: add assertions to method OriginalTest.error_or_eof_case(TokenStream, Token, Int32, Byte[], Int32, Byte)
        }
public void numeric_case111()
{
    using (PexDisposableContext disposables = PexDisposableContext.Create())
    {
      MemoryStream memoryStream;
      CharacterStream characterStream;
      Token token;
      Token token1;
      byte[] bs = new byte[3];
      memoryStream = new MemoryStream(bs, false);
      disposables.Add((IDisposable)memoryStream);
      byte[] bs1 = new byte[3];
      characterStream = new CharacterStream();
      characterStream.fp = (Stream)memoryStream;
      characterStream.stream_ind = 1;
      characterStream.stream = bs1;
      byte[] bs2 = new byte[3];
      token = new Token();
      token.token_string = bs2;
      token.token_id = 0;
      TokenStream s0 = new TokenStream();
      s0.ch_stream = characterStream;
      byte[] bs3 = new byte[3];
      token1 = this.numeric_case(s0, token, (byte)49, bs3, 1);
      disposables.Dispose();
      Assert.IsNotNull((object)token1);
      Assert.IsNotNull((object)(token1.token_string));
      Assert.AreEqual<int>(3, token1.token_string.Length);
      Assert.AreEqual<byte>((byte)0, token1.token_string[0]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[1]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[2]);
      Assert.AreEqual<int>(-1, token1.token_id);
    }
}
public void print_token967()
{
    Token token;
    int i;
    token = new Token();
    token.token_string = (byte[])null;
    token.token_id = 30;
    i = this.print_token(token);
    Assert.AreEqual<int>(0, i);
}
public void is_eof_token199()
{
    Token token;
    int i;
    token = new Token();
    token.token_string = (byte[])null;
    token.token_id = 2;
    i = this.is_eof_token(token);
    Assert.AreEqual<int>(0, i);
}
Exemplo n.º 5
0
        /* *****************************************************************
           Function name : error_or_eof_case 
           Input         : tstream_ptr,token_ptr,cu_state,token_str,token_ind,ch
           Output        : token_ptr 
           Exceptions    : none 
           Description   : This function checks whether it is EOF or not.
                           If it is it returns EOF token else returns ERROR 
                           token.
         * *****************************************************************/

        public static Token error_or_eof_case(TokenStream tstream_ptr, Token token_ptr, int cu_state, byte[] token_str, int token_ind, byte ch)
        {
            if (is_end_of_character_stream(tstream_ptr.ch_stream) == TRUE)
            {
                token_ptr.token_id = EOTSTREAM;
                token_ptr.token_string[0] = (byte)'\0';
                return (token_ptr);
            }
            if (cu_state != 0)
            {
                unget_char(ch, tstream_ptr.ch_stream);
                token_ind--;
            }
            token_ptr.token_id = ERROR;
            get_actual_token(token_str, token_ind);
            token_str.CopyTo(token_ptr.token_string, 0);
            return (token_ptr);
        }
Exemplo n.º 6
0
        /* ******************************************************************
           Function name : numeric_case
           Input         : tstream_ptr,token_ptr,ch,token_str,token_ind
           Output        : token_ptr;
           Exceptions    : none 
           Description   : It checks for the delimiter, if it is then it
                           forms numeric token else forms error token.
         * ****************************************************************** */

        public static Token numeric_case(TokenStream tstream_ptr, Token token_ptr, byte ch, byte[] token_str, int token_ind)
        {
            if (check_delimiter(ch) != TRUE)
            {   /* Error case */
                token_ptr.token_id = ERROR;
                while (check_delimiter(ch) == FALSE)
                {
                    if (token_ind >= 80) break; /* Added protection - hf */
                    token_str[token_ind++] = ch = get_char(tstream_ptr.ch_stream);
                }
                unget_char(ch, tstream_ptr.ch_stream);
                token_ind--;
                get_actual_token(token_str, token_ind);
                token_str.CopyTo(token_ptr.token_string, 0);
                return (token_ptr);
            }
            token_ptr.token_id = NUMERIC; /* Numeric case */
            unget_char(ch, tstream_ptr.ch_stream);
            token_ind--;
            get_actual_token(token_str, token_ind);
            token_str.CopyTo(token_ptr.token_string, 0);
            return (token_ptr);
        }
Exemplo n.º 7
0
        /* ********************************************************************
           Function name : get_token
           Input         : token_stream
           Output        : token
           Exceptions    : none.
           Description   : This function returns the next token from the
                           token_stream.The type of token is integer and specifies 
                           only the type of the token. DFA is used for finding the
                           next token. cu_state is initialized to zero and charcter
                           are read until the the is the final state and it
                           returns the token type.
        * ******************************************************************* */

        public static Token get_token(TokenStream tstream_ptr)
        {
            byte[] token_str = new byte[80]; /* This buffer stores the current token */
            int token_ind;      /* Index to the token_str  */
            Token token_ptr;
            byte ch;
            int cu_state, next_st, token_found;

            token_ptr = new Token();
            ch = get_char(tstream_ptr.ch_stream);
            cu_state = token_ind = token_found = 0;
            while (token_found == 0)
            {
                if (token_ind < 80) /* ADDED ERROR CHECK - hf */
                {
                    token_str[token_ind++] = ch;
                    next_st = next_state(cu_state, ch);
                }
                else
                {
                    next_st = -1; /* - hf */
                }
                if (next_st == -1)
                { /* ERROR or EOF case */
                    return (error_or_eof_case(tstream_ptr,
                                 token_ptr, cu_state, token_str, token_ind, ch));
                }
                else if (next_st == -2)
                {/* This is numeric case. */
                    return (numeric_case(tstream_ptr, token_ptr, ch,
                            token_str, token_ind));
                }
                else if (next_st == -3)
                {/* This is the IDENTIFIER case */
                    token_ptr.token_id = IDENTIFIER;
                    unget_char(ch, tstream_ptr.ch_stream);
                    token_ind--;
                    get_actual_token(token_str, token_ind);

                    token_str.CopyTo(token_ptr.token_string, 0);
                    return (token_ptr);
                }

                switch (next_st)
                {
                    default: break;
                    case 6: /* These are all KEYWORD cases. */
                    case 9:
                    case 11:
                    case 13:
                    case 16: ch = get_char(tstream_ptr.ch_stream);
                        if (check_delimiter(ch) == TRUE)
                        {
                            token_ptr.token_id = keyword(next_st);
                            unget_char(ch, tstream_ptr.ch_stream);
                            token_ptr.token_string[0] = (byte)'\0';
                            return (token_ptr);
                        }
                        unget_char(ch, tstream_ptr.ch_stream);
                        break;
                    case 19: /* These are all special SPECIAL character */
                    case 20: /* cases */
                    case 21:
                    case 22:
                    case 23:
                    case 24:
                    case 25: 
                    case 32: token_ptr.token_id = special(next_st);
                        token_ptr.token_string[0] = (byte)'\0';
                        return (token_ptr);
                    case 27: /* These are constant cases */
                    case 29: token_ptr.token_id = constant(next_st, token_str, token_ind);
                        get_actual_token(token_str, token_ind);
                        token_str.CopyTo(token_ptr.token_string, 0);
                        return (token_ptr);
                    case 30:  /* This is COMMENT case */
                        skip(tstream_ptr.ch_stream);
                        token_ind = next_st = 0;
                        break;
                }
                cu_state = next_st;
                ch = get_char(tstream_ptr.ch_stream);
            }
            throw new ApplicationException("Execution should not have reached this line");
        }
 public int print_token(Token token_ptr)
 {
     PexAssume.IsNotNull(token_ptr);
     int result = Original.print_token(token_ptr);
     return result;
     // TODO: add assertions to method OriginalTest.print_token(Token)
 }
        public Token numeric_case(
            TokenStream tstream_ptr,
            Token token_ptr,
            byte ch,
            byte[] token_str,
            int token_ind
        )
        {
            PexAssume.IsNotNull(tstream_ptr);
            PexAssume.IsNotNull(tstream_ptr.ch_stream);
            PexAssume.IsNotNull(tstream_ptr.ch_stream.fp);
            PexAssume.IsNotNullOrEmpty(tstream_ptr.ch_stream.stream);
            PexAssume.IsTrue(tstream_ptr.ch_stream.stream_ind > 0 && tstream_ptr.ch_stream.stream_ind < tstream_ptr.ch_stream.stream.Length - 1);
            PexAssume.IsTrue(tstream_ptr.ch_stream.stream.Length > 1);

            PexAssume.IsNotNull(token_str);
            PexAssume.IsTrue(token_ind < token_str.Length - 1);
            PexAssume.IsTrue(token_ind > 0);
            PexAssume.IsTrue(token_str.Length > 1);

            PexAssume.IsNotNull(token_ptr);
            PexAssume.IsNotNull(token_ptr.token_string);

            PexAssume.IsTrue(token_str.Length <= token_ptr.token_string.Length);

            Token result
               = Original.numeric_case(tstream_ptr, token_ptr, ch, token_str, token_ind);
            return result;
            // TODO: add assertions to method OriginalTest.numeric_case(TokenStream, Token, Byte, Byte[], Int32)
        }
public void numeric_case226()
{
    using (PexDisposableContext disposables = PexDisposableContext.Create())
    {
      MemoryStream memoryStream;
      CharacterStream characterStream;
      Token token;
      Token token1;
      byte[] bs = new byte[96];
      memoryStream = new MemoryStream(bs, false);
      disposables.Add((IDisposable)memoryStream);
      byte[] bs1 = new byte[80];
      bs1[64] = (byte)49;
      bs1[65] = (byte)1;
      characterStream = new CharacterStream();
      characterStream.fp = (Stream)memoryStream;
      characterStream.stream_ind = 64;
      characterStream.stream = bs1;
      byte[] bs2 = new byte[96];
      token = new Token();
      token.token_string = bs2;
      token.token_id = 0;
      TokenStream s0 = new TokenStream();
      s0.ch_stream = characterStream;
      token1 = this.numeric_case(s0, token, (byte)49, bs1, 1);
      disposables.Dispose();
      Assert.IsNotNull((object)token1);
      Assert.IsNotNull((object)(token1.token_string));
      Assert.AreEqual<int>(96, token1.token_string.Length);
      Assert.AreEqual<byte>((byte)0, token1.token_string[0]);
      Assert.AreEqual<byte>((byte)49, token1.token_string[1]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[2]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[3]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[4]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[5]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[6]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[7]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[8]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[9]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[10]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[11]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[12]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[13]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[14]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[15]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[16]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[17]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[18]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[19]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[20]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[21]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[22]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[23]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[24]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[25]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[26]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[27]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[28]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[29]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[30]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[31]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[32]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[33]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[34]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[35]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[36]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[37]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[38]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[39]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[40]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[41]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[42]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[43]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[44]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[45]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[46]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[47]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[48]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[49]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[50]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[51]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[52]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[53]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[54]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[55]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[56]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[57]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[58]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[59]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[60]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[61]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[62]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[63]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[64]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[65]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[66]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[67]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[68]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[69]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[70]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[71]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[72]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[73]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[74]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[75]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[76]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[77]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[78]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[79]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[80]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[81]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[82]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[83]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[84]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[85]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[86]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[87]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[88]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[89]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[90]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[91]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[92]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[93]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[94]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[95]);
      Assert.AreEqual<int>(-1, token1.token_id);
    }
}
public void numeric_case948()
{
    using (PexDisposableContext disposables = PexDisposableContext.Create())
    {
      MemoryStream memoryStream;
      CharacterStream characterStream;
      Token token;
      Token token1;
      byte[] bs = new byte[64];
      memoryStream = new MemoryStream(bs, false);
      disposables.Add((IDisposable)memoryStream);
      byte[] bs1 = new byte[80];
      bs1[2] = (byte)66;
      characterStream = new CharacterStream();
      characterStream.fp = (Stream)memoryStream;
      characterStream.stream_ind = 2;
      characterStream.stream = bs1;
      byte[] bs2 = new byte[34];
      token = new Token();
      token.token_string = bs2;
      token.token_id = 0;
      TokenStream s0 = new TokenStream();
      s0.ch_stream = characterStream;
      byte[] bs3 = new byte[33];
      bs3[0] = (byte)9;
      token1 = this.numeric_case(s0, token, (byte)113, bs3, 1);
      disposables.Dispose();
      Assert.IsNotNull((object)token1);
      Assert.IsNotNull((object)(token1.token_string));
      Assert.AreEqual<int>(34, token1.token_string.Length);
      Assert.AreEqual<byte>((byte)66, token1.token_string[0]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[1]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[2]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[3]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[4]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[5]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[6]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[7]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[8]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[9]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[10]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[11]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[12]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[13]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[14]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[15]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[16]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[17]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[18]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[19]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[20]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[21]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[22]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[23]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[24]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[25]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[26]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[27]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[28]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[29]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[30]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[31]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[32]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[33]);
      Assert.AreEqual<int>(-1, token1.token_id);
    }
}
public void numeric_caseThrowsIndexOutOfRangeException651()
{
    using (PexDisposableContext disposables = PexDisposableContext.Create())
    {
      MemoryStream memoryStream;
      CharacterStream characterStream;
      Token token;
      Token token1;
      byte[] bs = new byte[0];
      memoryStream = new MemoryStream(bs, false);
      disposables.Add((IDisposable)memoryStream);
      byte[] bs1 = new byte[80];
      bs1[0] = (byte)49;
      characterStream = new CharacterStream();
      characterStream.fp = (Stream)memoryStream;
      characterStream.stream_ind = 3;
      characterStream.stream = bs1;
      byte[] bs2 = new byte[3];
      token = new Token();
      token.token_string = bs2;
      token.token_id = 0;
      TokenStream s0 = new TokenStream();
      s0.ch_stream = characterStream;
      byte[] bs3 = new byte[3];
      token1 = this.numeric_case(s0, token, (byte)49, bs3, 1);
      disposables.Dispose();
    }
}
Exemplo n.º 13
0
 public Token Constructor()
 {
     Token target = new Token();
     return target;
     // TODO: add assertions to method TokenTest.Constructor()
 }
Exemplo n.º 14
0
        /* *********************************************************************
           Function name : is_eof_token
           Input         : token
           Output        : Boolean
           Exceptions    : none.
           Description   : This function checks whether the token t is eof_token 
                           or not. If the integer value stored in the t is
                           EOTSTREAM then it is eof_token.
         * ***************************************************************** */

        public static int is_eof_token(Token t)
        {
            if (t.token_id == EOTSTREAM)
                return (TRUE);
            return (FALSE);
        }
 public int is_eof_token(Token t)
 {
     PexAssume.IsNotNull(t);
     int result = Original.is_eof_token(t);
     return result;
     // TODO: add assertions to method OriginalTest.is_eof_token(Token)
 }
Exemplo n.º 16
0
        /* ********************************************************************
           Function name : print_token
           Input         : token
           Output        : Boolean
           Exceptions    : none.
           Description   : This function  prints the token. The token_id gives 
                           the type of token not the token itself. So, in the
                           case of identifier,numeric,  string,character it is
                           required to print the actual token  from token_str. 
                           So, precaution must be taken when printing the token.
                           This function is able to print the current token only
                           and it is the limitation of the program.
         * ******************************************************************** */

        public static int print_token(Token token_ptr)
        {
            switch (token_ptr.token_id)
            {    /* Print the respective tokens. */
                case ERROR: Console.Write("error,\t\""); Console.Write(get_null_terminated_string(System.Text.Encoding.ASCII.GetString(token_ptr.token_string)));
                    Console.Write("\".\n"); return (TRUE);
                case EOTSTREAM: Console.Write("eof.\n"); return (TRUE);
                case 6: Console.Write("keyword,\t\"lambda\".\n"); return (TRUE);
                case 9: Console.Write("keyword,\t\"and\".\n"); return (TRUE);
                case 11: Console.Write("keyword,\t\"or\".\n"); return (TRUE);
                case 13: Console.Write("keyword,\t\"if\".\n"); return (TRUE);
                case 16: Console.Write("keyword,\t\"xor\".\n"); return (TRUE);
                case 17: Console.Write("identifier,\t\""); Console.Write(get_null_terminated_string(System.Text.Encoding.ASCII.GetString(token_ptr.token_string)));
                    Console.Write("\".\n"); return (TRUE);
                case 18: Console.Write("numeric,\t"); Console.Write(get_null_terminated_string(System.Text.Encoding.ASCII.GetString(token_ptr.token_string)));
                    Console.Write(".\n"); return (TRUE);
                case 19: Console.Write("lparen.\n"); return (TRUE);
                case 20: Console.Write("rparen.\n"); return (TRUE);
                case 21: Console.Write("lsquare.\n"); return (TRUE);
                case 22: Console.Write("rsquare.\n"); return (TRUE);
                case 23: Console.Write("quote.\n"); return (TRUE);
                case 24: Console.Write("bquote.\n"); return (TRUE);
                case 25: Console.Write("comma.\n"); return (TRUE);
                case 27: Console.Write("string,\t"); Console.Write(get_null_terminated_string(System.Text.Encoding.ASCII.GetString(token_ptr.token_string)));
                    Console.Write(".\n"); return (TRUE);
                case 29: Console.Write("character,\t\""); Console.Write(get_null_terminated_string(System.Text.Encoding.ASCII.GetString(token_ptr.token_string)));
                    Console.Write("\".\n"); return (TRUE);
                case 32: Console.Write("keyword,\t\"=>\".\n"); return (TRUE);
                default: break;
            }
            return (FALSE);
        }
public void error_or_eof_case809()
{
    using (PexDisposableContext disposables = PexDisposableContext.Create())
    {
      MemoryStream memoryStream;
      CharacterStream characterStream;
      Token token;
      Token token1;
      byte[] bs = new byte[5];
      memoryStream = new MemoryStream(bs, false);
      disposables.Add((IDisposable)memoryStream);
      byte[] bs1 = new byte[4];
      bs1[0] = (byte)127;
      bs1[1] = (byte)127;
      bs1[2] = (byte)127;
      bs1[3] = (byte)127;
      characterStream = new CharacterStream();
      characterStream.fp = (Stream)memoryStream;
      characterStream.stream_ind = 1;
      characterStream.stream = bs1;
      byte[] bs2 = new byte[5];
      token = new Token();
      token.token_string = bs2;
      token.token_id = 0;
      TokenStream s0 = new TokenStream();
      s0.ch_stream = characterStream;
      byte[] bs3 = new byte[5];
      token1 = this.error_or_eof_case(s0, token, 0, bs3, 4, (byte)0);
      disposables.Dispose();
      Assert.IsNotNull((object)token1);
      Assert.IsNotNull((object)(token1.token_string));
      Assert.AreEqual<int>(5, token1.token_string.Length);
      Assert.AreEqual<byte>((byte)0, token1.token_string[0]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[1]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[2]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[3]);
      Assert.AreEqual<byte>((byte)0, token1.token_string[4]);
      Assert.AreEqual<int>(0, token1.token_id);
    }
}