Exemplo n.º 1
0
        private void Jj_rescan_token()
        {
            jj_rescan = true;
            for (int i = 0; i < 2; i++)
            {
                try
                {
                    JjCalls p = jj_2_rtns[i];
                    do
                    {
                        if (p.gen > jj_gen)
                        {
                            jj_la      = p.arg;
                            jj_lastpos = jj_scanpos = p.first;
                            switch (i)
                            {
                            case 0:
                                Jj_3_1();
                                break;

                            case 1:
                                Jj_3_2();
                                break;
                            }
                        }
                        p = p.next;
                    } while (p != null);
                }
                catch (LookaheadSuccess ls)
                {
                }
            }
            jj_rescan = false;
        }
Exemplo n.º 2
0
 /// <summary>Reinitialize</summary>
 public void ReInit(TregexParserTokenManager tm)
 {
     token_source = tm;
     token        = new Token();
     jj_ntk       = -1;
     jj_gen       = 0;
     for (int i = 0; i < 28; i++)
     {
         jj_la1[i] = -1;
     }
     for (int i = 0; i < jj_2_rtns.Length; i++)
     {
         jj_2_rtns[i] = new JjCalls();
     }
 }
Exemplo n.º 3
0
 /// <summary>Reinitialize</summary>
 public void ReInit(TextReader stream)
 {
     jj_input_stream.ReInit(stream, 1, 1);
     token_source.ReInit(jj_input_stream);
     token  = new Token();
     jj_ntk = -1;
     jj_gen = 0;
     for (int i = 0; i < 28; i++)
     {
         jj_la1[i] = -1;
     }
     for (int i = 0; i < jj_2_rtns.Length; i++)
     {
         jj_2_rtns[i] = new JjCalls();
     }
 }
Exemplo n.º 4
0
 /// <summary>Constructor</summary>
 public TregexParser(TextReader stream)
 {
     jj_input_stream = new SimpleCharStream(stream, 1, 1);
     token_source    = new TregexParserTokenManager(jj_input_stream);
     token           = new Token();
     jj_ntk          = -1;
     jj_gen          = 0;
     for (int i = 0; i < 28; i++)
     {
         jj_la1[i] = -1;
     }
     for (int i = 0; i < jj_2_rtns.Length; i++)
     {
         jj_2_rtns[i] = new JjCalls();
     }
 }
Exemplo n.º 5
0
        private void Jj_save(int index, int xla)
        {
            JjCalls p = jj_2_rtns[index];

            while (p.gen > jj_gen)
            {
                if (p.next == null)
                {
                    p = p.next = new JjCalls();
                    break;
                }
                p = p.next;
            }
            p.gen   = jj_gen + xla - jj_la;
            p.first = token;
            p.arg   = xla;
        }
Exemplo n.º 6
0
        private Token Jj_consume_token(int kind)
        {
            Token oldToken;

            if ((oldToken = token).Next != null)
            {
                token = token.Next;
            }
            else
            {
                token = token.Next = token_source.GetNextToken();
            }
            jj_ntk = -1;
            if (token.Kind == kind)
            {
                jj_gen++;
                if (++jj_gc > 100)
                {
                    jj_gc = 0;
                    for (int i = 0; i < jj_2_rtns.Length; i++)
                    {
                        JjCalls c = jj_2_rtns[i];
                        while (c != null)
                        {
                            if (c.gen < jj_gen)
                            {
                                c.first = null;
                            }
                            c = c.next;
                        }
                    }
                }
                return(token);
            }
            token   = oldToken;
            jj_kind = kind;
            throw GenerateParseException();
        }
Exemplo n.º 7
0
 /// <summary>Reinitialize</summary>
 public void ReInit(Stream stream, string encoding)
 {
     try
     {
         jj_input_stream.ReInit(stream, encoding, 1, 1);
     }
     catch (IOException e)
     {
         throw new SystemException("", e);
     }
     token_source.ReInit(jj_input_stream);
     token  = new Token();
     jj_ntk = -1;
     jj_gen = 0;
     for (int i = 0; i < 28; i++)
     {
         jj_la1[i] = -1;
     }
     for (int i = 0; i < jj_2_rtns.Length; i++)
     {
         jj_2_rtns[i] = new JjCalls();
     }
 }
Exemplo n.º 8
0
 /// <summary>
 /// Constructor with Stream and supplied encoding
 /// </summary>
 public TregexParser(Stream stream, string encoding)
 {
     try
     {
         jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1);
     }
     catch (IOException e)
     {
         throw new SystemException("", e);
     }
     token_source = new TregexParserTokenManager(jj_input_stream);
     token        = new Token();
     jj_ntk       = -1;
     jj_gen       = 0;
     for (int i = 0; i < 28; i++)
     {
         jj_la1[i] = -1;
     }
     for (int i = 0; i < jj_2_rtns.Length; i++)
     {
         jj_2_rtns[i] = new JjCalls();
     }
 }
Exemplo n.º 9
0
 /// <summary>Reinitialize</summary>
 public void ReInit(TregexParserTokenManager tm)
 {
     token_source = tm;
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
     for (int i = 0; i < 28; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.Length; i++) jj_2_rtns[i] = new JjCalls();
 }
Exemplo n.º 10
0
 /// <summary>Reinitialize</summary>
 public void ReInit(TextReader stream)
 {
     jj_input_stream.ReInit(stream, 1, 1);
     token_source.ReInit(jj_input_stream);
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
     for (int i = 0; i < 28; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.Length; i++) jj_2_rtns[i] = new JjCalls();
 }
Exemplo n.º 11
0
 /// <summary>Constructor</summary>
 public TregexParser(TextReader stream)
 {
     jj_input_stream = new SimpleCharStream(stream, 1, 1);
     token_source = new TregexParserTokenManager(jj_input_stream);
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
     for (int i = 0; i < 28; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.Length; i++) jj_2_rtns[i] = new JjCalls();
 }
Exemplo n.º 12
0
 /// <summary>Reinitialize</summary>
 public void ReInit(Stream stream, string encoding)
 {
     try
     {
         jj_input_stream.ReInit(stream, encoding, 1, 1);
     }
     catch (IOException e)
     {
         throw new SystemException("", e);
     }
     token_source.ReInit(jj_input_stream);
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
     for (int i = 0; i < 28; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.Length; i++) jj_2_rtns[i] = new JjCalls();
 }
Exemplo n.º 13
0
 /// <summary>
 /// Constructor with Stream and supplied encoding
 /// </summary>
 public TregexParser(Stream stream, string encoding)
 {
     try
     {
         jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1);
     }
     catch (IOException e)
     {
         throw new SystemException("", e);
     }
     token_source = new TregexParserTokenManager(jj_input_stream);
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
     for (int i = 0; i < 28; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.Length; i++) jj_2_rtns[i] = new JjCalls();
 }
Exemplo n.º 14
0
 /// <summary>Constructor with Stream</summary>
 public TsurgeonParser( /*java.io.InputStream*/ Stream stream, string encoding)
 {
     try
     {
         jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1);
     }
     catch ( /*java.io.UnsupportedEncodingException*/Exception e)
     {
         throw new SystemException(e.Message);
     }
     token_source = new TsurgeonParserTokenManager(jj_input_stream);
     token = new Token();
     jj_ntk = -1;
     jj_gen = 0;
     for (int i = 0; i < 10; i++) jj_la1[i] = -1;
     for (int i = 0; i < jj_2_rtns.Length; i++) jj_2_rtns[i] = new JjCalls();
 }