示例#1
0
 /// <summary> This constructor is used by the method "generateParseException"
 /// in the generated parser.  Calling this constructor generates
 /// a new object of this type with the fields "currentToken",
 /// "expectedTokenSequences", and "tokenImage" set.  The boolean
 /// flag "specialConstructor" is also set to true to indicate that
 /// this constructor was used to create this object.
 /// This constructor calls its super class with the empty string
 /// to force the "toString" method of parent class "Throwable" to
 /// print the error message in the form:
 /// ParseException: <result of getMessage>
 /// </summary>
 public ParseException(Token currentTokenVal, int[][] expectedTokenSequencesVal, System.String[] tokenImageVal)
     : base("")
 {
     InitBlock();
     specialConstructor = true;
     currentToken = currentTokenVal;
     expectedTokenSequences = expectedTokenSequencesVal;
     tokenImage = tokenImageVal;
 }
示例#2
0
 public SelectorParser(SelectorParserTokenManager tm)
 {
     InitBlock();
     token_source = tm;
     token = new Token();
     jj_ntk_Renamed_Field = - 1;
     jj_gen = 0;
     for (int i = 0; i < 0; i++)
         jj_la1[i] = - 1;
     for (int i = 0; i < jj_2_rtns.Length; i++)
         jj_2_rtns[i] = new JJCalls();
 }
示例#3
0
 //UPGRADE_ISSUE: Class hierarchy differences between 'java.io.Reader' and 'System.IO.StreamReader' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186_3"'
 public SelectorParser(System.IO.StreamReader stream)
 {
     InitBlock();
     jj_input_stream = new SimpleCharStream(stream, 1, 1);
     token_source = new SelectorParserTokenManager(jj_input_stream);
     token = new Token();
     jj_ntk_Renamed_Field = - 1;
     jj_gen = 0;
     for (int i = 0; i < 0; i++)
         jj_la1[i] = - 1;
     for (int i = 0; i < jj_2_rtns.Length; i++)
         jj_2_rtns[i] = new JJCalls();
 }
示例#4
0
 private bool jj_2_23(int xla)
 {
     jj_la = xla; jj_lastpos = jj_scanpos = token;
           bool retval = !jj_3_23();
           jj_save(22, xla);
           return retval;
 }
示例#5
0
 //UPGRADE_ISSUE: Class hierarchy differences between 'java.io.Reader' and 'System.IO.StreamReader' may cause compilation errors. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1186_3"'
 public virtual void ReInit(System.IO.StreamReader stream)
 {
     jj_input_stream.ReInit(stream, 1, 1);
     token_source.ReInit(jj_input_stream);
     token = new Token();
     jj_ntk_Renamed_Field = - 1;
     jj_gen = 0;
     for (int i = 0; i < 0; i++)
         jj_la1[i] = - 1;
     for (int i = 0; i < jj_2_rtns.Length; i++)
         jj_2_rtns[i] = new JJCalls();
 }
示例#6
0
 private bool jj_scan_token(int kind)
 {
     if (jj_scanpos == jj_lastpos)
     {
         jj_la--;
         if (jj_scanpos.next == null)
         {
             jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.NextToken;
         }
         else
         {
             jj_lastpos = jj_scanpos = jj_scanpos.next;
         }
     }
     else
     {
         jj_scanpos = jj_scanpos.next;
     }
     if (jj_rescan)
     {
         int i = 0; Token tok = token;
         while (tok != null && tok != jj_scanpos)
         {
             i++; tok = tok.next;
         }
         if (tok != null)
             jj_add_error_token(kind, i);
     }
      return (jj_scanpos.kind != kind);
 }
示例#7
0
        private void jj_rescan_token()
        {
            jj_rescan = true;
            for (int i = 0; i < 42; i++)
            {
                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;

                            case 2:  jj_3_3(); break;

                            case 3:  jj_3_4(); break;

                            case 4:  jj_3_5(); break;

                            case 5:  jj_3_6(); break;

                            case 6:  jj_3_7(); break;

                            case 7:  jj_3_8(); break;

                            case 8:  jj_3_9(); break;

                            case 9:  jj_3_10(); break;

                            case 10:  jj_3_11(); break;

                            case 11:  jj_3_12(); break;

                            case 12:  jj_3_13(); break;

                            case 13:  jj_3_14(); break;

                            case 14:  jj_3_15(); break;

                            case 15:  jj_3_16(); break;

                            case 16:  jj_3_17(); break;

                            case 17:  jj_3_18(); break;

                            case 18:  jj_3_19(); break;

                            case 19:  jj_3_20(); break;

                            case 20:  jj_3_21(); break;

                            case 21:  jj_3_22(); break;

                            case 22:  jj_3_23(); break;

                            case 23:  jj_3_24(); break;

                            case 24:  jj_3_25(); break;

                            case 25:  jj_3_26(); break;

                            case 26:  jj_3_27(); break;

                            case 27:  jj_3_28(); break;

                            case 28:  jj_3_29(); break;

                            case 29:  jj_3_30(); break;

                            case 30:  jj_3_31(); break;

                            case 31:  jj_3_32(); break;

                            case 32:  jj_3_33(); break;

                            case 33:  jj_3_34(); break;

                            case 34:  jj_3_35(); break;

                            case 35:  jj_3_36(); break;

                            case 36:  jj_3_37(); break;

                            case 37:  jj_3_38(); break;

                            case 38:  jj_3_39(); break;

                            case 39:  jj_3_40(); break;

                            case 40:  jj_3_41(); break;

                            case 41:  jj_3_42(); break;
                            }
                    }
                    p = p.next;
                }
                while (p != null);
            }
            jj_rescan = false;
        }
示例#8
0
 private Token jj_consume_token(int kind)
 {
     Token oldToken;
     if ((oldToken = token).next != null)
         token = token.next;
     else
         token = token.next = token_source.NextToken;
     jj_ntk_Renamed_Field = - 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();
 }
示例#9
0
 private bool jj_3_9()
 {
     Token xsp;
           xsp = jj_scanpos;
           if (jj_3_10())
           {
               jj_scanpos = xsp;
               if (jj_3_11()) return true;
               if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
           }
           else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
           return false;
 }
示例#10
0
 private bool jj_3_12()
 {
     Token xsp;
           xsp = jj_scanpos;
           if (jj_3_13())
           {
               jj_scanpos = xsp;
               if (jj_3_14())
               {
                   jj_scanpos = xsp;
                   if (jj_3_15())
                   {
                       jj_scanpos = xsp;
                       if (jj_3_16())
                       {
                           jj_scanpos = xsp;
                           if (jj_3_17())
                           {
                               jj_scanpos = xsp;
                               if (jj_3_18())
                               {
                                   jj_scanpos = xsp;
                                   if (jj_3_19())
                                   {
                                       jj_scanpos = xsp;
                                       if (jj_3_20())
                                       {
                                           jj_scanpos = xsp;
                                           if (jj_3_21())
                                           {
                                               jj_scanpos = xsp;
                                               if (jj_3_22()) return true;
                                               if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
                                           }
                                           else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
                                       }
                                       else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
                                   }
                                   else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
                               }
                               else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
                           }
                           else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
                       }
                       else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
                   }
                   else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
               }
               else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
           }
           else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
           return false;
 }
示例#11
0
 private bool jj_3R_9()
 {
     if (jj_3R_10()) return true;
           if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
           Token xsp;
           while (true)
           {
               xsp = jj_scanpos;
               if (jj_3_6()) { jj_scanpos = xsp; break; }
               if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
           }
           return false;
 }
示例#12
0
 private bool jj_3R_20()
 {
     Token xsp;
           xsp = jj_scanpos;
           if (jj_3_42()) jj_scanpos = xsp;
           else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
           return false;
 }
示例#13
0
 private bool jj_3R_18()
 {
     Token xsp;
           xsp = jj_scanpos;
           if (jj_3_32())
           {
               jj_scanpos = xsp;
               if (jj_3_33())
               {
                   jj_scanpos = xsp;
                   if (jj_3_34())
                   {
                       jj_scanpos = xsp;
                       if (jj_3_35())
                       {
                           jj_scanpos = xsp;
                           if (jj_3_36())
                           {
                               jj_scanpos = xsp;
                               if (jj_3_37())
                               {
                                   jj_scanpos = xsp;
                                   if (jj_3_38()) return true;
                                   if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
                               }
                               else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
                           }
                           else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
                       }
                       else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
                   }
                   else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
               }
               else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
           }
           else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
           return false;
 }
示例#14
0
 private bool jj_3R_14()
 {
     if (jj_3R_12()) return true;
           if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
           Token xsp;
           xsp = jj_scanpos;
           if (jj_3_40()) jj_scanpos = xsp;
           else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
           return false;
 }
示例#15
0
 private bool jj_3R_13()
 {
     Token xsp;
           xsp = jj_scanpos;
           if (jj_3_39()) jj_scanpos = xsp;
           else if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
           if (jj_scan_token(CodeStreet.Selector.Parser.SelectorParserConstants_Fields.TK_NULL)) return true;
           if (jj_la == 0 && jj_scanpos == jj_lastpos) return false;
           return false;
 }