Ejemplo n.º 1
0
        private void mIdentifier()
        {
            Enter_Identifier();
            EnterRule("Identifier", 9);
            TraceIn("Identifier", 9);
            try
            {
                int _type    = Identifier;
                int _channel = DefaultTokenChannel;
                // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:41:11: ( ( 'A' .. 'z' | '0' .. '9' | UScore )+ )
                DebugEnterAlt(1);
                // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:41:13: ( 'A' .. 'z' | '0' .. '9' | UScore )+
                {
                    DebugLocation(41, 13);
                    // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:41:13: ( 'A' .. 'z' | '0' .. '9' | UScore )+
                    int cnt3 = 0;
                    try { DebugEnterSubRule(3);
                          while (true)
                          {
                              int alt3 = 2;
                              try { DebugEnterDecision(3, decisionCanBacktrack[3]);
                                    int LA3_0 = input.LA(1);

                                    if (((LA3_0 >= '0' && LA3_0 <= '9') || (LA3_0 >= 'A' && LA3_0 <= 'z')))
                                    {
                                        alt3 = 1;
                                    }
                              } finally { DebugExitDecision(3); }
                              switch (alt3)
                              {
                              case 1:
                                  DebugEnterAlt(1);
                                  // D:\\Dev\\Codeplex\\SheepAop\\SheepAspect\\Saql\\Ast\\Pointcut.g:
                                  {
                                      DebugLocation(41, 13);
                                      if ((input.LA(1) >= '0' && input.LA(1) <= '9') || (input.LA(1) >= 'A' && input.LA(1) <= 'z'))
                                      {
                                          input.Consume();
                                      }
                                      else
                                      {
                                          MismatchedSetException mse = new MismatchedSetException(null, input);
                                          DebugRecognitionException(mse);
                                          Recover(mse);
                                          throw mse;
                                      }
                                  }
                                  break;

                              default:
                                  if (cnt3 >= 1)
                                  {
                                      goto loop3;
                                  }

                                  EarlyExitException eee3 = new EarlyExitException(3, input);
                                  DebugRecognitionException(eee3);
                                  throw eee3;
                              }
                              cnt3++;
                          }
loop3:
                          ; } finally { DebugExitSubRule(3); }
                }

                state.type    = _type;
                state.channel = _channel;
            }
            finally
            {
                TraceOut("Identifier", 9);
                LeaveRule("Identifier", 9);
                Leave_Identifier();
            }
        }
    private void mINT()
    {
        EnterRule_INT();
        EnterRule("INT", 6);
        TraceIn("INT", 6);
        try
        {
            int _type    = INT;
            int _channel = DefaultTokenChannel;
            // C:\\Users\\dany_\\Desktop\\Calculadora1.g:63:2: ( ( '0' .. '9' )+ )
            DebugEnterAlt(1);
            // C:\\Users\\dany_\\Desktop\\Calculadora1.g:63:3: ( '0' .. '9' )+
            {
                DebugLocation(63, 3);
                // C:\\Users\\dany_\\Desktop\\Calculadora1.g:63:3: ( '0' .. '9' )+
                int cnt1 = 0;
                try
                {
                    DebugEnterSubRule(1);
                    while (true)
                    {
                        int alt1 = 2;
                        try
                        {
                            DebugEnterDecision(1, decisionCanBacktrack[1]);
                            int LA1_0 = input.LA(1);

                            if (((LA1_0 >= '0' && LA1_0 <= '9')))
                            {
                                alt1 = 1;
                            }
                        }
                        finally { DebugExitDecision(1); }
                        switch (alt1)
                        {
                        case 1:
                            DebugEnterAlt(1);
                            // C:\\Users\\dany_\\Desktop\\Calculadora1.g:
                            {
                                DebugLocation(63, 3);
                                input.Consume();
                            }
                            break;

                        default:
                            if (cnt1 >= 1)
                            {
                                goto loop1;
                            }

                            EarlyExitException eee1 = new EarlyExitException(1, input);
                            DebugRecognitionException(eee1);
                            throw eee1;
                        }
                        cnt1++;
                    }
loop1:
                    ;
                }
                finally { DebugExitSubRule(1); }
            }

            state.type    = _type;
            state.channel = _channel;
        }
        finally
        {
            TraceOut("INT", 6);
            LeaveRule("INT", 6);
            LeaveRule_INT();
        }
    }
Ejemplo n.º 3
0
    private void mWS()
    {
        EnterRule_WS();
        EnterRule("WS", 4);
        TraceIn("WS", 4);
        try
        {
            int _type    = WS;
            int _channel = DefaultTokenChannel;
            // ../Grammars/OslcPrefix.g:54:5: ( ( ' ' | '\\t' | EOL )+ )
            DebugEnterAlt(1);
            // ../Grammars/OslcPrefix.g:54:7: ( ' ' | '\\t' | EOL )+
            {
                DebugLocation(54, 7);
                // ../Grammars/OslcPrefix.g:54:7: ( ' ' | '\\t' | EOL )+
                int cnt1 = 0;
                try { DebugEnterSubRule(1);
                      while (true)
                      {
                          int alt1 = 2;
                          try { DebugEnterDecision(1, false);
                                int LA1_1 = input.LA(1);

                                if (((LA1_1 >= '\t' && LA1_1 <= '\n') || LA1_1 == '\r' || LA1_1 == ' '))
                                {
                                    alt1 = 1;
                                }
                          } finally { DebugExitDecision(1); }
                          switch (alt1)
                          {
                          case 1:
                              DebugEnterAlt(1);
                              // ../Grammars/OslcPrefix.g:
                              {
                                  DebugLocation(54, 7);
                                  input.Consume();
                              }
                              break;

                          default:
                              if (cnt1 >= 1)
                              {
                                  goto loop1;
                              }

                              EarlyExitException eee1 = new EarlyExitException(1, input);
                              DebugRecognitionException(eee1);
                              throw eee1;
                          }
                          cnt1++;
                      }
loop1:
                      ; } finally { DebugExitSubRule(1); }

                DebugLocation(54, 25);
                Skip();
            }

            state.type    = _type;
            state.channel = _channel;
        }
        finally
        {
            TraceOut("WS", 4);
            LeaveRule("WS", 4);
            LeaveRule_WS();
        }
    }
Ejemplo n.º 4
0
 private void mINT()
 {
     try
     {
         int type    = 24;
         int channel = 0;
         int num     = 2;
         try
         {
             try
             {
                 int num2 = input.LA(1);
                 if (num2 == 45)
                 {
                     num = 1;
                 }
             }
             finally
             {
             }
             if (num == 1)
             {
                 Match(45);
             }
         }
         finally
         {
         }
         int num3 = 0;
         try
         {
             while (true)
             {
                 int num4 = 2;
                 try
                 {
                     int num5 = input.LA(1);
                     if (num5 >= 48 && num5 <= 57)
                     {
                         num4 = 1;
                     }
                 }
                 finally
                 {
                 }
                 if (num4 != 1)
                 {
                     break;
                 }
                 input.Consume();
                 num3++;
             }
             if (num3 < 1)
             {
                 EarlyExitException ex = new EarlyExitException(3, input);
                 throw ex;
             }
         }
         finally
         {
         }
         state.type    = type;
         state.channel = channel;
     }
     finally
     {
     }
 }
Ejemplo n.º 5
0
    private void mNOMBRE()
    {
        EnterRule_NOMBRE();
        EnterRule("NOMBRE", 9);
        TraceIn("NOMBRE", 9);
        try
        {
            int _type    = NOMBRE;
            int _channel = DefaultTokenChannel;
            // C:\\Users\\dany_\\Desktop\\final1.g:37:8: ( ( 'A' .. 'Z' | 'a' .. 'z' | '_' )+ )
            DebugEnterAlt(1);
            // C:\\Users\\dany_\\Desktop\\final1.g:37:10: ( 'A' .. 'Z' | 'a' .. 'z' | '_' )+
            {
                DebugLocation(37, 10);
                // C:\\Users\\dany_\\Desktop\\final1.g:37:10: ( 'A' .. 'Z' | 'a' .. 'z' | '_' )+
                int cnt5 = 0;
                try { DebugEnterSubRule(5);
                      while (true)
                      {
                          int alt5 = 2;
                          try { DebugEnterDecision(5, decisionCanBacktrack[5]);
                                int LA5_0 = input.LA(1);

                                if (((LA5_0 >= 'A' && LA5_0 <= 'Z') || LA5_0 == '_' || (LA5_0 >= 'a' && LA5_0 <= 'z')))
                                {
                                    alt5 = 1;
                                }
                          } finally { DebugExitDecision(5); }
                          switch (alt5)
                          {
                          case 1:
                              DebugEnterAlt(1);
                              // C:\\Users\\dany_\\Desktop\\final1.g:
                              {
                                  DebugLocation(37, 10);
                                  input.Consume();
                              }
                              break;

                          default:
                              if (cnt5 >= 1)
                              {
                                  goto loop5;
                              }

                              EarlyExitException eee5 = new EarlyExitException(5, input);
                              DebugRecognitionException(eee5);
                              throw eee5;
                          }
                          cnt5++;
                      }
loop5:
                      ; } finally { DebugExitSubRule(5); }
            }

            state.type    = _type;
            state.channel = _channel;
        }
        finally
        {
            TraceOut("NOMBRE", 9);
            LeaveRule("NOMBRE", 9);
            LeaveRule_NOMBRE();
        }
    }
Ejemplo n.º 6
0
        // $ANTLR end values


        // $ANTLR start heirarchy
        // F:\\Projects\\Igneel\\Igneel\\Importers\\BVH\\bvh.g:89:1: heirarchy[BvhDocument d] returns [BvhNode node = new BvhNode()] : ( ROOT | JOINT ) ID LCURLY v= offsets ch= channels ( (child= heirarchy[d] )+ | end= endsite ) RCURLY ;
        public BvhNode heirarchy(BvhDocument d) // throws RecognitionException [1]
        {
            BvhNode node = new BvhNode();

            IToken  ID1 = null;
            Vector3?v   = null;

            List <FODChannel> ch = null;

            BvhNode child = null;

            EndSite end = null;



            d.Nodes.Add(node);

            try
            {
                // F:\\Projects\\Igneel\\Igneel\\Importers\\BVH\\bvh.g:94:2: ( ( ROOT | JOINT ) ID LCURLY v= offsets ch= channels ( (child= heirarchy[d] )+ | end= endsite ) RCURLY )
                // F:\\Projects\\Igneel\\Igneel\\Importers\\BVH\\bvh.g:94:4: ( ROOT | JOINT ) ID LCURLY v= offsets ch= channels ( (child= heirarchy[d] )+ | end= endsite ) RCURLY
                {
                    // F:\\Projects\\Igneel\\Igneel\\Importers\\BVH\\bvh.g:94:4: ( ROOT | JOINT )
                    int alt2  = 2;
                    int LA2_0 = input.LA(1);

                    if ((LA2_0 == ROOT))
                    {
                        alt2 = 1;
                    }
                    else if ((LA2_0 == JOINT))
                    {
                        alt2 = 2;
                    }
                    else
                    {
                        NoViableAltException nvae_d2s0 =
                            new NoViableAltException("94:4: ( ROOT | JOINT )", 2, 0, input);

                        throw nvae_d2s0;
                    }
                    switch (alt2)
                    {
                    case 1:
                        // F:\\Projects\\Igneel\\Igneel\\Importers\\BVH\\bvh.g:94:5: ROOT
                    {
                        Match(input, ROOT, FOLLOW_ROOT_in_heirarchy611);
                        node.IsRoot = true;
                    }
                    break;

                    case 2:
                        // F:\\Projects\\Igneel\\Igneel\\Importers\\BVH\\bvh.g:94:33: JOINT
                    {
                        Match(input, JOINT, FOLLOW_JOINT_in_heirarchy616);
                    }
                    break;
                    }

                    ID1 = (IToken)input.LT(1);
                    Match(input, ID, FOLLOW_ID_in_heirarchy619);
                    node.Name = ID1.Text;
                    Match(input, LCURLY, FOLLOW_LCURLY_in_heirarchy627);
                    PushFollow(FOLLOW_offsets_in_heirarchy635);
                    v = offsets();
                    followingStackPointer_--;

                    node.Offset = (Vector3)v;
                    PushFollow(FOLLOW_channels_in_heirarchy646);
                    ch = channels();
                    followingStackPointer_--;

                    node.Channels = ch.ToArray();
                    // F:\\Projects\\Igneel\\Igneel\\Importers\\BVH\\bvh.g:98:6: ( (child= heirarchy[d] )+ | end= endsite )
                    int alt4  = 2;
                    int LA4_0 = input.LA(1);

                    if (((LA4_0 >= ROOT && LA4_0 <= JOINT)))
                    {
                        alt4 = 1;
                    }
                    else if ((LA4_0 == END_SITE))
                    {
                        alt4 = 2;
                    }
                    else
                    {
                        NoViableAltException nvae_d4s0 =
                            new NoViableAltException("98:6: ( (child= heirarchy[d] )+ | end= endsite )", 4, 0, input);

                        throw nvae_d4s0;
                    }
                    switch (alt4)
                    {
                    case 1:
                        // F:\\Projects\\Igneel\\Igneel\\Importers\\BVH\\bvh.g:98:8: (child= heirarchy[d] )+
                    {
                        // F:\\Projects\\Igneel\\Igneel\\Importers\\BVH\\bvh.g:98:8: (child= heirarchy[d] )+
                        int cnt3 = 0;
                        do
                        {
                            int alt3  = 2;
                            int LA3_0 = input.LA(1);

                            if (((LA3_0 >= ROOT && LA3_0 <= JOINT)))
                            {
                                alt3 = 1;
                            }


                            switch (alt3)
                            {
                            case 1:
                                // F:\\Projects\\Igneel\\Igneel\\Importers\\BVH\\bvh.g:98:9: child= heirarchy[d]
                            {
                                PushFollow(FOLLOW_heirarchy_in_heirarchy660);
                                child = heirarchy(d);
                                followingStackPointer_--;

                                node.Nodes.Add(child);
                            }
                            break;

                            default:
                                if (cnt3 >= 1)
                                {
                                    goto loop3;
                                }
                                EarlyExitException eee =
                                    new EarlyExitException(3, input);
                                throw eee;
                            }
                            cnt3++;
                        } while (true);

loop3:
                        ;                       // Stops C# compiler whinging that label 'loop3' has no statements
                    }
                    break;

                    case 2:
                        // F:\\Projects\\Igneel\\Igneel\\Importers\\BVH\\bvh.g:99:8: end= endsite
                    {
                        PushFollow(FOLLOW_endsite_in_heirarchy677);
                        end = endsite();
                        followingStackPointer_--;

                        node.End = end;
                    }
                    break;
                    }

                    Match(input, RCURLY, FOLLOW_RCURLY_in_heirarchy685);
                }
            }
            catch (RecognitionException re)
            {
                ReportError(re);
                Recover(input, re);
            }
            finally
            {
            }
            return(node);
        }
Ejemplo n.º 7
0
        private void mFLOAT()
        {
            EnterRule_FLOAT();
            EnterRule("FLOAT", 9);
            TraceIn("FLOAT", 9);
            try
            {
                int _type    = FLOAT;
                int _channel = DefaultTokenChannel;
                // C:\\Users\\illus\\OneDrive\\?????????\\Visual Studio 2015\\Projects\\Compilators\\GoA.g:49:5: ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )? | '.' ( '0' .. '9' )+ ( EXPONENT )? | ( '0' .. '9' )+ EXPONENT )
                int alt7 = 3;
                try { DebugEnterDecision(7, false);
                      try
                      {
                          alt7 = dfa7.Predict(input);
                      }
                      catch (NoViableAltException nvae)
                      {
                          DebugRecognitionException(nvae);
                          throw;
                      } } finally { DebugExitDecision(7); }
                switch (alt7)
                {
                case 1:
                    DebugEnterAlt(1);
                    // C:\\Users\\illus\\OneDrive\\?????????\\Visual Studio 2015\\Projects\\Compilators\\GoA.g:49:9: ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )?
                    {
                        DebugLocation(49, 9);
                        // C:\\Users\\illus\\OneDrive\\?????????\\Visual Studio 2015\\Projects\\Compilators\\GoA.g:49:9: ( '0' .. '9' )+
                        int cnt1 = 0;
                        try { DebugEnterSubRule(1);
                              while (true)
                              {
                                  int alt1 = 2;
                                  try { DebugEnterDecision(1, false);
                                        int LA1_1 = input.LA(1);

                                        if (((LA1_1 >= '0' && LA1_1 <= '9')))
                                        {
                                            alt1 = 1;
                                        }
                                  } finally { DebugExitDecision(1); }
                                  switch (alt1)
                                  {
                                  case 1:
                                      DebugEnterAlt(1);
                                      // C:\\Users\\illus\\OneDrive\\?????????\\Visual Studio 2015\\Projects\\Compilators\\GoA.g:
                                      {
                                          DebugLocation(49, 9);
                                          input.Consume();
                                      }
                                      break;

                                  default:
                                      if (cnt1 >= 1)
                                      {
                                          goto loop1;
                                      }

                                      EarlyExitException eee1 = new EarlyExitException(1, input);
                                      DebugRecognitionException(eee1);
                                      throw eee1;
                                  }
                                  cnt1++;
                              }
loop1:
                              ; } finally { DebugExitSubRule(1); }

                        DebugLocation(49, 21);
                        Match('.');
                        DebugLocation(49, 25);
                        // C:\\Users\\illus\\OneDrive\\?????????\\Visual Studio 2015\\Projects\\Compilators\\GoA.g:49:25: ( '0' .. '9' )*
                        try { DebugEnterSubRule(2);
                              while (true)
                              {
                                  int alt2 = 2;
                                  try { DebugEnterDecision(2, false);
                                        int LA2_1 = input.LA(1);

                                        if (((LA2_1 >= '0' && LA2_1 <= '9')))
                                        {
                                            alt2 = 1;
                                        }
                                  } finally { DebugExitDecision(2); }
                                  switch (alt2)
                                  {
                                  case 1:
                                      DebugEnterAlt(1);
                                      // C:\\Users\\illus\\OneDrive\\?????????\\Visual Studio 2015\\Projects\\Compilators\\GoA.g:
                                      {
                                          DebugLocation(49, 25);
                                          input.Consume();
                                      }
                                      break;

                                  default:
                                      goto loop2;
                                  }
                              }

loop2:
                              ; } finally { DebugExitSubRule(2); }

                        DebugLocation(49, 37);
                        // C:\\Users\\illus\\OneDrive\\?????????\\Visual Studio 2015\\Projects\\Compilators\\GoA.g:49:37: ( EXPONENT )?
                        int alt3 = 2;
                        try { DebugEnterSubRule(3);
                              try { DebugEnterDecision(3, false);
                                    int LA3_1 = input.LA(1);

                                    if ((LA3_1 == 'E' || LA3_1 == 'e'))
                                    {
                                        alt3 = 1;
                                    }
                              } finally { DebugExitDecision(3); }
                              switch (alt3)
                              {
                              case 1:
                                  DebugEnterAlt(1);
                                  // C:\\Users\\illus\\OneDrive\\?????????\\Visual Studio 2015\\Projects\\Compilators\\GoA.g:49:37: EXPONENT
                                  {
                                      DebugLocation(49, 37);
                                      mEXPONENT();
                                  }
                                  break;
                              }
                        } finally { DebugExitSubRule(3); }
                    }
                    break;

                case 2:
                    DebugEnterAlt(2);
                    // C:\\Users\\illus\\OneDrive\\?????????\\Visual Studio 2015\\Projects\\Compilators\\GoA.g:50:9: '.' ( '0' .. '9' )+ ( EXPONENT )?
                    {
                        DebugLocation(50, 9);
                        Match('.');
                        DebugLocation(50, 13);
                        // C:\\Users\\illus\\OneDrive\\?????????\\Visual Studio 2015\\Projects\\Compilators\\GoA.g:50:13: ( '0' .. '9' )+
                        int cnt4 = 0;
                        try { DebugEnterSubRule(4);
                              while (true)
                              {
                                  int alt4 = 2;
                                  try { DebugEnterDecision(4, false);
                                        int LA4_1 = input.LA(1);

                                        if (((LA4_1 >= '0' && LA4_1 <= '9')))
                                        {
                                            alt4 = 1;
                                        }
                                  } finally { DebugExitDecision(4); }
                                  switch (alt4)
                                  {
                                  case 1:
                                      DebugEnterAlt(1);
                                      // C:\\Users\\illus\\OneDrive\\?????????\\Visual Studio 2015\\Projects\\Compilators\\GoA.g:
                                      {
                                          DebugLocation(50, 13);
                                          input.Consume();
                                      }
                                      break;

                                  default:
                                      if (cnt4 >= 1)
                                      {
                                          goto loop4;
                                      }

                                      EarlyExitException eee4 = new EarlyExitException(4, input);
                                      DebugRecognitionException(eee4);
                                      throw eee4;
                                  }
                                  cnt4++;
                              }
loop4:
                              ; } finally { DebugExitSubRule(4); }

                        DebugLocation(50, 25);
                        // C:\\Users\\illus\\OneDrive\\?????????\\Visual Studio 2015\\Projects\\Compilators\\GoA.g:50:25: ( EXPONENT )?
                        int alt5 = 2;
                        try { DebugEnterSubRule(5);
                              try { DebugEnterDecision(5, false);
                                    int LA5_1 = input.LA(1);

                                    if ((LA5_1 == 'E' || LA5_1 == 'e'))
                                    {
                                        alt5 = 1;
                                    }
                              } finally { DebugExitDecision(5); }
                              switch (alt5)
                              {
                              case 1:
                                  DebugEnterAlt(1);
                                  // C:\\Users\\illus\\OneDrive\\?????????\\Visual Studio 2015\\Projects\\Compilators\\GoA.g:50:25: EXPONENT
                                  {
                                      DebugLocation(50, 25);
                                      mEXPONENT();
                                  }
                                  break;
                              }
                        } finally { DebugExitSubRule(5); }
                    }
                    break;

                case 3:
                    DebugEnterAlt(3);
                    // C:\\Users\\illus\\OneDrive\\?????????\\Visual Studio 2015\\Projects\\Compilators\\GoA.g:51:9: ( '0' .. '9' )+ EXPONENT
                    {
                        DebugLocation(51, 9);
                        // C:\\Users\\illus\\OneDrive\\?????????\\Visual Studio 2015\\Projects\\Compilators\\GoA.g:51:9: ( '0' .. '9' )+
                        int cnt6 = 0;
                        try { DebugEnterSubRule(6);
                              while (true)
                              {
                                  int alt6 = 2;
                                  try { DebugEnterDecision(6, false);
                                        int LA6_1 = input.LA(1);

                                        if (((LA6_1 >= '0' && LA6_1 <= '9')))
                                        {
                                            alt6 = 1;
                                        }
                                  } finally { DebugExitDecision(6); }
                                  switch (alt6)
                                  {
                                  case 1:
                                      DebugEnterAlt(1);
                                      // C:\\Users\\illus\\OneDrive\\?????????\\Visual Studio 2015\\Projects\\Compilators\\GoA.g:
                                      {
                                          DebugLocation(51, 9);
                                          input.Consume();
                                      }
                                      break;

                                  default:
                                      if (cnt6 >= 1)
                                      {
                                          goto loop6;
                                      }

                                      EarlyExitException eee6 = new EarlyExitException(6, input);
                                      DebugRecognitionException(eee6);
                                      throw eee6;
                                  }
                                  cnt6++;
                              }
loop6:
                              ; } finally { DebugExitSubRule(6); }

                        DebugLocation(51, 21);
                        mEXPONENT();
                    }
                    break;
                }
                state.type    = _type;
                state.channel = _channel;
            }
            finally
            {
                TraceOut("FLOAT", 9);
                LeaveRule("FLOAT", 9);
                LeaveRule_FLOAT();
            }
        }
Ejemplo n.º 8
0
    // $ANTLR end "ID"

    // $ANTLR start "MONEY"
    public void mMONEY() // throws RecognitionException [2]
    {
        try
        {
            int _type    = MONEY;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // D:\\Szkolenia\\Artykuł ProgramistaMag - DSL\\Code\\DSLSamples\\CredibilityDSL\\DSL\\CredibilityDSL.g:39:9: ( ( '0' | '1' .. '9' ( '0' .. '9' )* ) | ( '0' .. '9' )+ '.' ( '0' .. '9' )* )
            int alt6 = 2;
            alt6 = dfa6.Predict(input);
            switch (alt6)
            {
            case 1:
                // D:\\Szkolenia\\Artykuł ProgramistaMag - DSL\\Code\\DSLSamples\\CredibilityDSL\\DSL\\CredibilityDSL.g:39:9: ( '0' | '1' .. '9' ( '0' .. '9' )* )
            {
                // D:\\Szkolenia\\Artykuł ProgramistaMag - DSL\\Code\\DSLSamples\\CredibilityDSL\\DSL\\CredibilityDSL.g:39:9: ( '0' | '1' .. '9' ( '0' .. '9' )* )
                int alt3  = 2;
                int LA3_0 = input.LA(1);

                if ((LA3_0 == '0'))
                {
                    alt3 = 1;
                }
                else if (((LA3_0 >= '1' && LA3_0 <= '9')))
                {
                    alt3 = 2;
                }
                else
                {
                    NoViableAltException nvae_d3s0 =
                        new NoViableAltException("", 3, 0, input);

                    throw nvae_d3s0;
                }
                switch (alt3)
                {
                case 1:
                    // D:\\Szkolenia\\Artykuł ProgramistaMag - DSL\\Code\\DSLSamples\\CredibilityDSL\\DSL\\CredibilityDSL.g:39:10: '0'
                {
                    Match('0');
                }
                break;

                case 2:
                    // D:\\Szkolenia\\Artykuł ProgramistaMag - DSL\\Code\\DSLSamples\\CredibilityDSL\\DSL\\CredibilityDSL.g:39:16: '1' .. '9' ( '0' .. '9' )*
                {
                    MatchRange('1', '9');
                    // D:\\Szkolenia\\Artykuł ProgramistaMag - DSL\\Code\\DSLSamples\\CredibilityDSL\\DSL\\CredibilityDSL.g:39:25: ( '0' .. '9' )*
                    do
                    {
                        int alt2  = 2;
                        int LA2_0 = input.LA(1);

                        if (((LA2_0 >= '0' && LA2_0 <= '9')))
                        {
                            alt2 = 1;
                        }


                        switch (alt2)
                        {
                        case 1:
                            // D:\\Szkolenia\\Artykuł ProgramistaMag - DSL\\Code\\DSLSamples\\CredibilityDSL\\DSL\\CredibilityDSL.g:
                        {
                            if ((input.LA(1) >= '0' && input.LA(1) <= '9'))
                            {
                                input.Consume();
                            }
                            else
                            {
                                MismatchedSetException mse = new MismatchedSetException(null, input);
                                Recover(mse);
                                throw mse;
                            }
                        }
                        break;

                        default:
                            goto loop2;
                        }
                    } while (true);

loop2:
                    ;                                   // Stops C# compiler whining that label 'loop2' has no statements
                }
                break;
                }
            }
            break;

            case 2:
                // D:\\Szkolenia\\Artykuł ProgramistaMag - DSL\\Code\\DSLSamples\\CredibilityDSL\\DSL\\CredibilityDSL.g:39:39: ( '0' .. '9' )+ '.' ( '0' .. '9' )*
            {
                // D:\\Szkolenia\\Artykuł ProgramistaMag - DSL\\Code\\DSLSamples\\CredibilityDSL\\DSL\\CredibilityDSL.g:39:39: ( '0' .. '9' )+
                int cnt4 = 0;
                do
                {
                    int alt4  = 2;
                    int LA4_0 = input.LA(1);

                    if (((LA4_0 >= '0' && LA4_0 <= '9')))
                    {
                        alt4 = 1;
                    }


                    switch (alt4)
                    {
                    case 1:
                        // D:\\Szkolenia\\Artykuł ProgramistaMag - DSL\\Code\\DSLSamples\\CredibilityDSL\\DSL\\CredibilityDSL.g:
                    {
                        if ((input.LA(1) >= '0' && input.LA(1) <= '9'))
                        {
                            input.Consume();
                        }
                        else
                        {
                            MismatchedSetException mse = new MismatchedSetException(null, input);
                            Recover(mse);
                            throw mse;
                        }
                    }
                    break;

                    default:
                        if (cnt4 >= 1)
                        {
                            goto loop4;
                        }
                        EarlyExitException eee4 =
                            new EarlyExitException(4, input);
                        throw eee4;
                    }
                    cnt4++;
                } while (true);

loop4:
                ;                       // Stops C# compiler whining that label 'loop4' has no statements

                Match('.');
                // D:\\Szkolenia\\Artykuł ProgramistaMag - DSL\\Code\\DSLSamples\\CredibilityDSL\\DSL\\CredibilityDSL.g:39:55: ( '0' .. '9' )*
                do
                {
                    int alt5  = 2;
                    int LA5_0 = input.LA(1);

                    if (((LA5_0 >= '0' && LA5_0 <= '9')))
                    {
                        alt5 = 1;
                    }


                    switch (alt5)
                    {
                    case 1:
                        // D:\\Szkolenia\\Artykuł ProgramistaMag - DSL\\Code\\DSLSamples\\CredibilityDSL\\DSL\\CredibilityDSL.g:
                    {
                        if ((input.LA(1) >= '0' && input.LA(1) <= '9'))
                        {
                            input.Consume();
                        }
                        else
                        {
                            MismatchedSetException mse = new MismatchedSetException(null, input);
                            Recover(mse);
                            throw mse;
                        }
                    }
                    break;

                    default:
                        goto loop5;
                    }
                } while (true);

loop5:
                ;                       // Stops C# compiler whining that label 'loop5' has no statements
            }
            break;
            }
            state.type    = _type;
            state.channel = _channel;
        }
        finally
        {
        }
    }
        private void mNUMBER()
        {
            EnterRule_NUMBER();
            EnterRule("NUMBER", 5);
            TraceIn("NUMBER", 5);
            try
            {
                int _type    = NUMBER;
                int _channel = DefaultTokenChannel;
                // C:\\REPO\\PowerLog\\PowerLog.Parser\\PowerLogGrammar.g3:106:7: ( ( '0' .. '9' )+ )
                DebugEnterAlt(1);
                // C:\\REPO\\PowerLog\\PowerLog.Parser\\PowerLogGrammar.g3:106:9: ( '0' .. '9' )+
                {
                    DebugLocation(106, 9);
                    // C:\\REPO\\PowerLog\\PowerLog.Parser\\PowerLogGrammar.g3:106:9: ( '0' .. '9' )+
                    int cnt1 = 0;
                    try { DebugEnterSubRule(1);
                          while (true)
                          {
                              int alt1 = 2;
                              try { DebugEnterDecision(1, false);
                                    int LA1_0 = input.LA(1);

                                    if (((LA1_0 >= '0' && LA1_0 <= '9')))
                                    {
                                        alt1 = 1;
                                    }
                              } finally { DebugExitDecision(1); }
                              switch (alt1)
                              {
                              case 1:
                                  DebugEnterAlt(1);
                                  // C:\\REPO\\PowerLog\\PowerLog.Parser\\PowerLogGrammar.g3:
                                  {
                                      DebugLocation(106, 9);
                                      input.Consume();
                                  }
                                  break;

                              default:
                                  if (cnt1 >= 1)
                                  {
                                      goto loop1;
                                  }

                                  EarlyExitException eee1 = new EarlyExitException(1, input);
                                  DebugRecognitionException(eee1);
                                  throw eee1;
                              }
                              cnt1++;
                          }
loop1:
                          ; } finally { DebugExitSubRule(1); }
                }

                state.type    = _type;
                state.channel = _channel;
            }
            finally
            {
                TraceOut("NUMBER", 5);
                LeaveRule("NUMBER", 5);
                LeaveRule_NUMBER();
            }
        }
Ejemplo n.º 10
0
    // $ANTLR end "UINT"

    // $ANTLR start "ALPHA"
    public void mALPHA() // throws RecognitionException [2]
    {
        try
        {
            int _type    = ALPHA;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // TimeDef.g:241:6: ( ( 'A' .. 'Z' | 'a' .. 'z' )+ )
            // TimeDef.g:241:8: ( 'A' .. 'Z' | 'a' .. 'z' )+
            {
                // TimeDef.g:241:8: ( 'A' .. 'Z' | 'a' .. 'z' )+
                int cnt2 = 0;
                do
                {
                    int alt2  = 2;
                    int LA2_0 = input.LA(1);

                    if (((LA2_0 >= 'A' && LA2_0 <= 'Z') || (LA2_0 >= 'a' && LA2_0 <= 'z')))
                    {
                        alt2 = 1;
                    }


                    switch (alt2)
                    {
                    case 1:
                        // TimeDef.g:
                    {
                        if ((input.LA(1) >= 'A' && input.LA(1) <= 'Z') || (input.LA(1) >= 'a' && input.LA(1) <= 'z'))
                        {
                            input.Consume();
                        }
                        else
                        {
                            MismatchedSetException mse = new MismatchedSetException(null, input);
                            Recover(mse);
                            throw mse;
                        }
                    }
                    break;

                    default:
                        if (cnt2 >= 1)
                        {
                            goto loop2;
                        }
                        EarlyExitException eee2 =
                            new EarlyExitException(2, input);
                        throw eee2;
                    }
                    cnt2++;
                } while (true);

loop2:
                ;               // Stops C# compiler whining that label 'loop2' has no statements
            }

            state.type    = _type;
            state.channel = _channel;
        }
        finally
        {
        }
    }
Ejemplo n.º 11
0
    // $ANTLR end "ALPHA"

    // $ANTLR start "WS"
    public void mWS() // throws RecognitionException [2]
    {
        try
        {
            int _type    = WS;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // TimeDef.g:242:3: ( ( ' ' | '\\t' | '\\r\\n' | '\\r' )+ )
            // TimeDef.g:242:5: ( ' ' | '\\t' | '\\r\\n' | '\\r' )+
            {
                // TimeDef.g:242:5: ( ' ' | '\\t' | '\\r\\n' | '\\r' )+
                int cnt3 = 0;
                do
                {
                    int alt3 = 5;
                    switch (input.LA(1))
                    {
                    case ' ':
                    {
                        alt3 = 1;
                    }
                    break;

                    case '\t':
                    {
                        alt3 = 2;
                    }
                    break;

                    case '\r':
                    {
                        int LA3_4 = input.LA(2);

                        if ((LA3_4 == '\n'))
                        {
                            alt3 = 3;
                        }

                        else
                        {
                            alt3 = 4;
                        }
                    }
                    break;
                    }

                    switch (alt3)
                    {
                    case 1:
                        // TimeDef.g:242:6: ' '
                    {
                        Match(' ');
                    }
                    break;

                    case 2:
                        // TimeDef.g:242:10: '\\t'
                    {
                        Match('\t');
                    }
                    break;

                    case 3:
                        // TimeDef.g:242:15: '\\r\\n'
                    {
                        Match("\r\n");
                    }
                    break;

                    case 4:
                        // TimeDef.g:242:22: '\\r'
                    {
                        Match('\r');
                    }
                    break;

                    default:
                        if (cnt3 >= 1)
                        {
                            goto loop3;
                        }
                        EarlyExitException eee3 =
                            new EarlyExitException(3, input);
                        throw eee3;
                    }
                    cnt3++;
                } while (true);

loop3:
                ;               // Stops C# compiler whining that label 'loop3' has no statements
            }

            state.type    = _type;
            state.channel = _channel;
        }
        finally
        {
        }
    }
    // $ANTLR end NEWLINE

    // $ANTLR start WS
    public void mWS() // throws RecognitionException [2]
    {
        try
        {
            int _type = WS;
            // H:\\KB\\AntLr\\AntLr\\AntLr\\SimpleCalc3.g:81:4: ( ( ' ' | '\\t' | '\\n' | '\\r' )+ )
            // H:\\KB\\AntLr\\AntLr\\AntLr\\SimpleCalc3.g:81:6: ( ' ' | '\\t' | '\\n' | '\\r' )+
            {
                // H:\\KB\\AntLr\\AntLr\\AntLr\\SimpleCalc3.g:81:6: ( ' ' | '\\t' | '\\n' | '\\r' )+
                int cnt4 = 0;
                do
                {
                    int alt4  = 2;
                    int LA4_0 = input.LA(1);

                    if (((LA4_0 >= '\t' && LA4_0 <= '\n') || LA4_0 == '\r' || LA4_0 == ' '))
                    {
                        alt4 = 1;
                    }


                    switch (alt4)
                    {
                    case 1:
                        // H:\\KB\\AntLr\\AntLr\\AntLr\\SimpleCalc3.g:
                    {
                        if ((input.LA(1) >= '\t' && input.LA(1) <= '\n') || input.LA(1) == '\r' || input.LA(1) == ' ')
                        {
                            input.Consume();
                        }
                        else
                        {
                            MismatchedSetException mse =
                                new MismatchedSetException(null, input);
                            Recover(mse);    throw mse;
                        }
                    }
                    break;

                    default:
                        if (cnt4 >= 1)
                        {
                            goto loop4;
                        }
                        EarlyExitException eee =
                            new EarlyExitException(4, input);
                        throw eee;
                    }
                    cnt4++;
                } while (true);

loop4:
                ;               // Stops C# compiler whinging that label 'loop4' has no statements

                Skip();
            }

            this.type = _type;
        }
        finally
        {
        }
    }
    // $ANTLR end ASSIGN

    // $ANTLR start ID
    public void mID() // throws RecognitionException [2]
    {
        try
        {
            int _type = ID;
            // H:\\KB\\AntLr\\AntLr\\AntLr\\SimpleCalc3.g:78:5: ( ( 'a' .. 'z' | 'A' .. 'Z' )+ )
            // H:\\KB\\AntLr\\AntLr\\AntLr\\SimpleCalc3.g:78:7: ( 'a' .. 'z' | 'A' .. 'Z' )+
            {
                // H:\\KB\\AntLr\\AntLr\\AntLr\\SimpleCalc3.g:78:7: ( 'a' .. 'z' | 'A' .. 'Z' )+
                int cnt1 = 0;
                do
                {
                    int alt1  = 2;
                    int LA1_0 = input.LA(1);

                    if (((LA1_0 >= 'A' && LA1_0 <= 'Z') || (LA1_0 >= 'a' && LA1_0 <= 'z')))
                    {
                        alt1 = 1;
                    }


                    switch (alt1)
                    {
                    case 1:
                        // H:\\KB\\AntLr\\AntLr\\AntLr\\SimpleCalc3.g:
                    {
                        if ((input.LA(1) >= 'A' && input.LA(1) <= 'Z') || (input.LA(1) >= 'a' && input.LA(1) <= 'z'))
                        {
                            input.Consume();
                        }
                        else
                        {
                            MismatchedSetException mse =
                                new MismatchedSetException(null, input);
                            Recover(mse);    throw mse;
                        }
                    }
                    break;

                    default:
                        if (cnt1 >= 1)
                        {
                            goto loop1;
                        }
                        EarlyExitException eee =
                            new EarlyExitException(1, input);
                        throw eee;
                    }
                    cnt1++;
                } while (true);

loop1:
                ;               // Stops C# compiler whinging that label 'loop1' has no statements
            }

            this.type = _type;
        }
        finally
        {
        }
    }
Ejemplo n.º 14
0
        private void mIDENTIFIER()
        {
            Enter_IDENTIFIER();
            EnterRule("IDENTIFIER", 8);
            TraceIn("IDENTIFIER", 8);
            try
            {
                int _type    = IDENTIFIER;
                int _channel = DefaultTokenChannel;
                // D:\\Dev\\Codeplex\\sheepaop\\SheepAop\\Saql\\Ast\\LiteralExpression.g:34:2: ( ( 'A' .. 'z' | UScore | '0' .. '9' )+ )
                DebugEnterAlt(1);
                // D:\\Dev\\Codeplex\\sheepaop\\SheepAop\\Saql\\Ast\\LiteralExpression.g:34:4: ( 'A' .. 'z' | UScore | '0' .. '9' )+
                {
                    DebugLocation(34, 4);
                    // D:\\Dev\\Codeplex\\sheepaop\\SheepAop\\Saql\\Ast\\LiteralExpression.g:34:4: ( 'A' .. 'z' | UScore | '0' .. '9' )+
                    int cnt2 = 0;
                    try { DebugEnterSubRule(2);
                          while (true)
                          {
                              int alt2 = 2;
                              try { DebugEnterDecision(2, decisionCanBacktrack[2]);
                                    int LA2_0 = input.LA(1);

                                    if (((LA2_0 >= '0' && LA2_0 <= '9') || (LA2_0 >= 'A' && LA2_0 <= 'z')))
                                    {
                                        alt2 = 1;
                                    }
                              } finally { DebugExitDecision(2); }
                              switch (alt2)
                              {
                              case 1:
                                  DebugEnterAlt(1);
                                  // D:\\Dev\\Codeplex\\sheepaop\\SheepAop\\Saql\\Ast\\LiteralExpression.g:
                                  {
                                      DebugLocation(34, 4);
                                      if ((input.LA(1) >= '0' && input.LA(1) <= '9') || (input.LA(1) >= 'A' && input.LA(1) <= 'z'))
                                      {
                                          input.Consume();
                                      }
                                      else
                                      {
                                          MismatchedSetException mse = new MismatchedSetException(null, input);
                                          DebugRecognitionException(mse);
                                          Recover(mse);
                                          throw mse;
                                      }
                                  }
                                  break;

                              default:
                                  if (cnt2 >= 1)
                                  {
                                      goto loop2;
                                  }

                                  EarlyExitException eee2 = new EarlyExitException(2, input);
                                  DebugRecognitionException(eee2);
                                  throw eee2;
                              }
                              cnt2++;
                          }
loop2:
                          ; } finally { DebugExitSubRule(2); }
                }

                state.type    = _type;
                state.channel = _channel;
            }
            finally
            {
                TraceOut("IDENTIFIER", 8);
                LeaveRule("IDENTIFIER", 8);
                Leave_IDENTIFIER();
            }
        }
    private void inicio()
    {
        EnterRule_inicio();
        EnterRule("inicio", 2);
        TraceIn("inicio", 2);
        try { DebugEnterRule(GrammarFileName, "inicio");
              DebugLocation(9, 32);
              try
              {
                  // C:\\Users\\dany_\\Desktop\\SIC_gramatica.g:9:8: ( SIMBOLO 'START' NUM ( NL )+ )
                  DebugEnterAlt(1);
                  // C:\\Users\\dany_\\Desktop\\SIC_gramatica.g:9:10: SIMBOLO 'START' NUM ( NL )+
                  {
                      DebugLocation(9, 10);
                      Match(input, SIMBOLO, Follow._SIMBOLO_in_inicio52);
                      DebugLocation(9, 18);
                      Match(input, 32, Follow._32_in_inicio54);
                      DebugLocation(9, 26);
                      Match(input, NUM, Follow._NUM_in_inicio56);
                      DebugLocation(9, 30);
                      // C:\\Users\\dany_\\Desktop\\SIC_gramatica.g:9:30: ( NL )+
                      int cnt1 = 0;
                      try { DebugEnterSubRule(1);
                            while (true)
                            {
                                int alt1 = 2;
                                try { DebugEnterDecision(1, decisionCanBacktrack[1]);
                                      int LA1_0 = input.LA(1);

                                      if ((LA1_0 == NL))
                                      {
                                          alt1 = 1;
                                      }
                                } finally { DebugExitDecision(1); }
                                switch (alt1)
                                {
                                case 1:
                                    DebugEnterAlt(1);
                                    // C:\\Users\\dany_\\Desktop\\SIC_gramatica.g:9:30: NL
                                    {
                                        DebugLocation(9, 30);
                                        Match(input, NL, Follow._NL_in_inicio58);
                                    }
                                    break;

                                default:
                                    if (cnt1 >= 1)
                                    {
                                        goto loop1;
                                    }

                                    EarlyExitException eee1 = new EarlyExitException(1, input);
                                    DebugRecognitionException(eee1);
                                    throw eee1;
                                }
                                cnt1++;
                            }
loop1:
                            ; } finally { DebugExitSubRule(1); }
                  }
              }
              catch (RecognitionException re)
              {
                  ReportError(re);
                  Recover(input, re);
              }
              finally
              {
                  TraceOut("inicio", 2);
                  LeaveRule("inicio", 2);
                  LeaveRule_inicio();
              }
              DebugLocation(9, 32); } finally { DebugExitRule(GrammarFileName, "inicio"); }
        return;
    }
        private void mFLOAT()
        {
            EnterRule_FLOAT();
            EnterRule("FLOAT", 6);
            TraceIn("FLOAT", 6);
            try
            {
                int _type    = FLOAT;
                int _channel = DefaultTokenChannel;
                // C:\\REPO\\PowerLog\\PowerLog.Parser\\PowerLogGrammar.g3:108:7: ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* | '.' ( '0' .. '9' )+ )
                int alt5 = 2;
                try { DebugEnterDecision(5, false);
                      int LA5_0 = input.LA(1);

                      if (((LA5_0 >= '0' && LA5_0 <= '9')))
                      {
                          alt5 = 1;
                      }
                      else if ((LA5_0 == '.'))
                      {
                          alt5 = 2;
                      }
                      else
                      {
                          NoViableAltException nvae = new NoViableAltException("", 5, 0, input);
                          DebugRecognitionException(nvae);
                          throw nvae;
                      } } finally { DebugExitDecision(5); }
                switch (alt5)
                {
                case 1:
                    DebugEnterAlt(1);
                    // C:\\REPO\\PowerLog\\PowerLog.Parser\\PowerLogGrammar.g3:108:11: ( '0' .. '9' )+ '.' ( '0' .. '9' )*
                    {
                        DebugLocation(108, 11);
                        // C:\\REPO\\PowerLog\\PowerLog.Parser\\PowerLogGrammar.g3:108:11: ( '0' .. '9' )+
                        int cnt2 = 0;
                        try { DebugEnterSubRule(2);
                              while (true)
                              {
                                  int alt2 = 2;
                                  try { DebugEnterDecision(2, false);
                                        int LA2_0 = input.LA(1);

                                        if (((LA2_0 >= '0' && LA2_0 <= '9')))
                                        {
                                            alt2 = 1;
                                        }
                                  } finally { DebugExitDecision(2); }
                                  switch (alt2)
                                  {
                                  case 1:
                                      DebugEnterAlt(1);
                                      // C:\\REPO\\PowerLog\\PowerLog.Parser\\PowerLogGrammar.g3:
                                      {
                                          DebugLocation(108, 11);
                                          input.Consume();
                                      }
                                      break;

                                  default:
                                      if (cnt2 >= 1)
                                      {
                                          goto loop2;
                                      }

                                      EarlyExitException eee2 = new EarlyExitException(2, input);
                                      DebugRecognitionException(eee2);
                                      throw eee2;
                                  }
                                  cnt2++;
                              }
loop2:
                              ; } finally { DebugExitSubRule(2); }

                        DebugLocation(108, 23);
                        Match('.');
                        DebugLocation(108, 27);
                        // C:\\REPO\\PowerLog\\PowerLog.Parser\\PowerLogGrammar.g3:108:27: ( '0' .. '9' )*
                        try { DebugEnterSubRule(3);
                              while (true)
                              {
                                  int alt3 = 2;
                                  try { DebugEnterDecision(3, false);
                                        int LA3_0 = input.LA(1);

                                        if (((LA3_0 >= '0' && LA3_0 <= '9')))
                                        {
                                            alt3 = 1;
                                        }
                                  } finally { DebugExitDecision(3); }
                                  switch (alt3)
                                  {
                                  case 1:
                                      DebugEnterAlt(1);
                                      // C:\\REPO\\PowerLog\\PowerLog.Parser\\PowerLogGrammar.g3:
                                      {
                                          DebugLocation(108, 27);
                                          input.Consume();
                                      }
                                      break;

                                  default:
                                      goto loop3;
                                  }
                              }

loop3:
                              ; } finally { DebugExitSubRule(3); }
                    }
                    break;

                case 2:
                    DebugEnterAlt(2);
                    // C:\\REPO\\PowerLog\\PowerLog.Parser\\PowerLogGrammar.g3:109:11: '.' ( '0' .. '9' )+
                    {
                        DebugLocation(109, 11);
                        Match('.');
                        DebugLocation(109, 15);
                        // C:\\REPO\\PowerLog\\PowerLog.Parser\\PowerLogGrammar.g3:109:15: ( '0' .. '9' )+
                        int cnt4 = 0;
                        try { DebugEnterSubRule(4);
                              while (true)
                              {
                                  int alt4 = 2;
                                  try { DebugEnterDecision(4, false);
                                        int LA4_0 = input.LA(1);

                                        if (((LA4_0 >= '0' && LA4_0 <= '9')))
                                        {
                                            alt4 = 1;
                                        }
                                  } finally { DebugExitDecision(4); }
                                  switch (alt4)
                                  {
                                  case 1:
                                      DebugEnterAlt(1);
                                      // C:\\REPO\\PowerLog\\PowerLog.Parser\\PowerLogGrammar.g3:
                                      {
                                          DebugLocation(109, 15);
                                          input.Consume();
                                      }
                                      break;

                                  default:
                                      if (cnt4 >= 1)
                                      {
                                          goto loop4;
                                      }

                                      EarlyExitException eee4 = new EarlyExitException(4, input);
                                      DebugRecognitionException(eee4);
                                      throw eee4;
                                  }
                                  cnt4++;
                              }
loop4:
                              ; } finally { DebugExitSubRule(4); }
                    }
                    break;
                }
                state.type    = _type;
                state.channel = _channel;
            }
            finally
            {
                TraceOut("FLOAT", 6);
                LeaveRule("FLOAT", 6);
                LeaveRule_FLOAT();
            }
        }
    private void proposicion()
    {
        EnterRule_proposicion();
        EnterRule("proposicion", 3);
        TraceIn("proposicion", 3);
        try { DebugEnterRule(GrammarFileName, "proposicion");
              DebugLocation(11, 1);
              try
              {
                  // C:\\Users\\dany_\\Desktop\\SIC_gramatica.g:12:2: ( ( instruccion | directiva )+ ( NL )+ | ( NL )+ )
                  int alt5 = 2;
                  try { DebugEnterDecision(5, decisionCanBacktrack[5]);
                        int LA5_0 = input.LA(1);

                        if ((LA5_0 == SIMBOLO))
                        {
                            alt5 = 1;
                        }
                        else if ((LA5_0 == NL))
                        {
                            alt5 = 2;
                        }
                        else
                        {
                            NoViableAltException nvae = new NoViableAltException("", 5, 0, input);
                            DebugRecognitionException(nvae);
                            throw nvae;
                        } } finally { DebugExitDecision(5); }
                  switch (alt5)
                  {
                  case 1:
                      DebugEnterAlt(1);
                      // C:\\Users\\dany_\\Desktop\\SIC_gramatica.g:12:5: ( instruccion | directiva )+ ( NL )+
                      {
                          DebugLocation(12, 5);
                          // C:\\Users\\dany_\\Desktop\\SIC_gramatica.g:12:5: ( instruccion | directiva )+
                          int cnt2 = 0;
                          try { DebugEnterSubRule(2);
                                while (true)
                                {
                                    int alt2 = 3;
                                    try { DebugEnterDecision(2, decisionCanBacktrack[2]);
                                          int LA2_0 = input.LA(1);

                                          if ((LA2_0 == SIMBOLO))
                                          {
                                              int LA2_2 = input.LA(2);

                                              if ((LA2_2 == FINL || (LA2_2 >= 9 && LA2_2 <= 10) || (LA2_2 >= 13 && LA2_2 <= 14) || (LA2_2 >= 16 && LA2_2 <= 27) || (LA2_2 >= 30 && LA2_2 <= 31) || (LA2_2 >= 33 && LA2_2 <= 40)))
                                              {
                                                  alt2 = 1;
                                              }
                                              else if ((LA2_2 == 11 || (LA2_2 >= 28 && LA2_2 <= 29) || LA2_2 == 41))
                                              {
                                                  alt2 = 2;
                                              }
                                          }
                                    } finally { DebugExitDecision(2); }
                                    switch (alt2)
                                    {
                                    case 1:
                                        DebugEnterAlt(1);
                                        // C:\\Users\\dany_\\Desktop\\SIC_gramatica.g:12:6: instruccion
                                        {
                                            DebugLocation(12, 6);
                                            PushFollow(Follow._instruccion_in_proposicion70);
                                            instruccion();
                                            PopFollow();
                                        }
                                        break;

                                    case 2:
                                        DebugEnterAlt(2);
                                        // C:\\Users\\dany_\\Desktop\\SIC_gramatica.g:12:20: directiva
                                        {
                                            DebugLocation(12, 20);
                                            PushFollow(Follow._directiva_in_proposicion74);
                                            directiva();
                                            PopFollow();
                                        }
                                        break;

                                    default:
                                        if (cnt2 >= 1)
                                        {
                                            goto loop2;
                                        }

                                        EarlyExitException eee2 = new EarlyExitException(2, input);
                                        DebugRecognitionException(eee2);
                                        throw eee2;
                                    }
                                    cnt2++;
                                }
loop2:
                                ; } finally { DebugExitSubRule(2); }

                          DebugLocation(12, 33);
                          // C:\\Users\\dany_\\Desktop\\SIC_gramatica.g:12:33: ( NL )+
                          int cnt3 = 0;
                          try { DebugEnterSubRule(3);
                                while (true)
                                {
                                    int alt3 = 2;
                                    try { DebugEnterDecision(3, decisionCanBacktrack[3]);
                                          int LA3_0 = input.LA(1);

                                          if ((LA3_0 == NL))
                                          {
                                              alt3 = 1;
                                          }
                                    } finally { DebugExitDecision(3); }
                                    switch (alt3)
                                    {
                                    case 1:
                                        DebugEnterAlt(1);
                                        // C:\\Users\\dany_\\Desktop\\SIC_gramatica.g:12:33: NL
                                        {
                                            DebugLocation(12, 33);
                                            Match(input, NL, Follow._NL_in_proposicion79);
                                        }
                                        break;

                                    default:
                                        if (cnt3 >= 1)
                                        {
                                            goto loop3;
                                        }

                                        EarlyExitException eee3 = new EarlyExitException(3, input);
                                        DebugRecognitionException(eee3);
                                        throw eee3;
                                    }
                                    cnt3++;
                                }
loop3:
                                ; } finally { DebugExitSubRule(3); }
                      }
                      break;

                  case 2:
                      DebugEnterAlt(2);
                      // C:\\Users\\dany_\\Desktop\\SIC_gramatica.g:12:39: ( NL )+
                      {
                          DebugLocation(12, 39);
                          // C:\\Users\\dany_\\Desktop\\SIC_gramatica.g:12:39: ( NL )+
                          int cnt4 = 0;
                          try { DebugEnterSubRule(4);
                                while (true)
                                {
                                    int alt4 = 2;
                                    try { DebugEnterDecision(4, decisionCanBacktrack[4]);
                                          int LA4_0 = input.LA(1);

                                          if ((LA4_0 == NL))
                                          {
                                              alt4 = 1;
                                          }
                                    } finally { DebugExitDecision(4); }
                                    switch (alt4)
                                    {
                                    case 1:
                                        DebugEnterAlt(1);
                                        // C:\\Users\\dany_\\Desktop\\SIC_gramatica.g:12:39: NL
                                        {
                                            DebugLocation(12, 39);
                                            Match(input, NL, Follow._NL_in_proposicion84);
                                        }
                                        break;

                                    default:
                                        if (cnt4 >= 1)
                                        {
                                            goto loop4;
                                        }

                                        EarlyExitException eee4 = new EarlyExitException(4, input);
                                        DebugRecognitionException(eee4);
                                        throw eee4;
                                    }
                                    cnt4++;
                                }
loop4:
                                ; } finally { DebugExitSubRule(4); }
                      }
                      break;
                  }
              }
              catch (RecognitionException re)
              {
                  ReportError(re);
                  Recover(input, re);
              }
              finally
              {
                  TraceOut("proposicion", 3);
                  LeaveRule("proposicion", 3);
                  LeaveRule_proposicion();
              }
              DebugLocation(13, 1); } finally { DebugExitRule(GrammarFileName, "proposicion"); }
        return;
    }
        private void mWS()
        {
            EnterRule_WS();
            EnterRule("WS", 15);
            TraceIn("WS", 15);
            try
            {
                int _type    = WS;
                int _channel = DefaultTokenChannel;
                // C:\\REPO\\PowerLog\\PowerLog.Parser\\PowerLogGrammar.g3:141:7: ( ( ' ' | '\\t' | '\\n' | '\\r' | '\\f' )+ )
                DebugEnterAlt(1);
                // C:\\REPO\\PowerLog\\PowerLog.Parser\\PowerLogGrammar.g3:141:9: ( ' ' | '\\t' | '\\n' | '\\r' | '\\f' )+
                {
                    DebugLocation(141, 9);
                    // C:\\REPO\\PowerLog\\PowerLog.Parser\\PowerLogGrammar.g3:141:9: ( ' ' | '\\t' | '\\n' | '\\r' | '\\f' )+
                    int cnt7 = 0;
                    try { DebugEnterSubRule(7);
                          while (true)
                          {
                              int alt7 = 2;
                              try { DebugEnterDecision(7, false);
                                    int LA7_0 = input.LA(1);

                                    if (((LA7_0 >= '\t' && LA7_0 <= '\n') || (LA7_0 >= '\f' && LA7_0 <= '\r') || LA7_0 == ' '))
                                    {
                                        alt7 = 1;
                                    }
                              } finally { DebugExitDecision(7); }
                              switch (alt7)
                              {
                              case 1:
                                  DebugEnterAlt(1);
                                  // C:\\REPO\\PowerLog\\PowerLog.Parser\\PowerLogGrammar.g3:
                                  {
                                      DebugLocation(141, 9);
                                      input.Consume();
                                  }
                                  break;

                              default:
                                  if (cnt7 >= 1)
                                  {
                                      goto loop7;
                                  }

                                  EarlyExitException eee7 = new EarlyExitException(7, input);
                                  DebugRecognitionException(eee7);
                                  throw eee7;
                              }
                              cnt7++;
                          }
loop7:
                          ; } finally { DebugExitSubRule(7); }
                }

                state.type    = _type;
                state.channel = _channel;
            }
            finally
            {
                TraceOut("WS", 15);
                LeaveRule("WS", 15);
                LeaveRule_WS();
            }
        }
Ejemplo n.º 19
0
        // $ANTLR end endsite


        // $ANTLR start channels
        // F:\\Projects\\Igneel\\Igneel\\Importers\\BVH\\bvh.g:110:1: channels returns [List<FODChannel>list] : CHANNELS len= NUMBER ( XPOSITION | YPOSITION | ZPOSITION | ZROTATION | XROTATION | YROTATION )+ ;
        public List <FODChannel> channels() // throws RecognitionException [1]
        {
            List <FODChannel> list = null;

            IToken len = null;

            try
            {
                // F:\\Projects\\Igneel\\Igneel\\Importers\\BVH\\bvh.g:111:2: ( CHANNELS len= NUMBER ( XPOSITION | YPOSITION | ZPOSITION | ZROTATION | XROTATION | YROTATION )+ )
                // F:\\Projects\\Igneel\\Igneel\\Importers\\BVH\\bvh.g:111:4: CHANNELS len= NUMBER ( XPOSITION | YPOSITION | ZPOSITION | ZROTATION | XROTATION | YROTATION )+
                {
                    Match(input, CHANNELS, FOLLOW_CHANNELS_in_channels735);
                    len = (IToken)input.LT(1);
                    Match(input, NUMBER, FOLLOW_NUMBER_in_channels739);
                    list = new List <FODChannel>(int.Parse(len.Text));
                    // F:\\Projects\\Igneel\\Igneel\\Importers\\BVH\\bvh.g:112:2: ( XPOSITION | YPOSITION | ZPOSITION | ZROTATION | XROTATION | YROTATION )+
                    int cnt5 = 0;
                    do
                    {
                        int alt5 = 7;
                        switch (input.LA(1))
                        {
                        case XPOSITION:
                        {
                            alt5 = 1;
                        }
                        break;

                        case YPOSITION:
                        {
                            alt5 = 2;
                        }
                        break;

                        case ZPOSITION:
                        {
                            alt5 = 3;
                        }
                        break;

                        case ZROTATION:
                        {
                            alt5 = 4;
                        }
                        break;

                        case XROTATION:
                        {
                            alt5 = 5;
                        }
                        break;

                        case YROTATION:
                        {
                            alt5 = 6;
                        }
                        break;
                        }

                        switch (alt5)
                        {
                        case 1:
                            // F:\\Projects\\Igneel\\Igneel\\Importers\\BVH\\bvh.g:113:6: XPOSITION
                        {
                            Match(input, XPOSITION, FOLLOW_XPOSITION_in_channels751);
                            list.Add(FODChannel.XPosition);
                        }
                        break;

                        case 2:
                            // F:\\Projects\\Igneel\\Igneel\\Importers\\BVH\\bvh.g:114:6: YPOSITION
                        {
                            Match(input, YPOSITION, FOLLOW_YPOSITION_in_channels762);
                            list.Add(FODChannel.YPosition);
                        }
                        break;

                        case 3:
                            // F:\\Projects\\Igneel\\Igneel\\Importers\\BVH\\bvh.g:115:6: ZPOSITION
                        {
                            Match(input, ZPOSITION, FOLLOW_ZPOSITION_in_channels774);
                            list.Add(FODChannel.ZPosition);
                        }
                        break;

                        case 4:
                            // F:\\Projects\\Igneel\\Igneel\\Importers\\BVH\\bvh.g:116:6: ZROTATION
                        {
                            Match(input, ZROTATION, FOLLOW_ZROTATION_in_channels785);
                            list.Add(FODChannel.ZRotation);
                        }
                        break;

                        case 5:
                            // F:\\Projects\\Igneel\\Igneel\\Importers\\BVH\\bvh.g:117:6: XROTATION
                        {
                            Match(input, XROTATION, FOLLOW_XROTATION_in_channels796);
                            list.Add(FODChannel.XRotation);
                        }
                        break;

                        case 6:
                            // F:\\Projects\\Igneel\\Igneel\\Importers\\BVH\\bvh.g:118:6: YROTATION
                        {
                            Match(input, YROTATION, FOLLOW_YROTATION_in_channels807);
                            list.Add(FODChannel.YRotation);
                        }
                        break;

                        default:
                            if (cnt5 >= 1)
                            {
                                goto loop5;
                            }
                            EarlyExitException eee =
                                new EarlyExitException(5, input);
                            throw eee;
                        }
                        cnt5++;
                    } while (true);

loop5:
                    ;           // Stops C# compiler whinging that label 'loop5' has no statements
                }
            }
            catch (RecognitionException re)
            {
                ReportError(re);
                Recover(input, re);
            }
            finally
            {
            }
            return(list);
        }
Ejemplo n.º 20
0
    // $ANTLR end "IntegerLiteral"

    // $ANTLR start "WS"
    public void mWS() // throws RecognitionException [2]
    {
        try
        {
            int _type    = WS;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // D:\\Szkolenia\\Artykuł ProgramistaMag - DSL\\Code\\DSLSamples\\SimpleDSL\\Simple.g:22:5: ( ( ' ' | '\\t' | '\\n' | '\\r' )+ )
            // D:\\Szkolenia\\Artykuł ProgramistaMag - DSL\\Code\\DSLSamples\\SimpleDSL\\Simple.g:22:5: ( ' ' | '\\t' | '\\n' | '\\r' )+
            {
                // D:\\Szkolenia\\Artykuł ProgramistaMag - DSL\\Code\\DSLSamples\\SimpleDSL\\Simple.g:22:5: ( ' ' | '\\t' | '\\n' | '\\r' )+
                int cnt4 = 0;
                do
                {
                    int alt4  = 2;
                    int LA4_0 = input.LA(1);

                    if (((LA4_0 >= '\t' && LA4_0 <= '\n') || LA4_0 == '\r' || LA4_0 == ' '))
                    {
                        alt4 = 1;
                    }


                    switch (alt4)
                    {
                    case 1:
                        // D:\\Szkolenia\\Artykuł ProgramistaMag - DSL\\Code\\DSLSamples\\SimpleDSL\\Simple.g:
                    {
                        if ((input.LA(1) >= '\t' && input.LA(1) <= '\n') || input.LA(1) == '\r' || input.LA(1) == ' ')
                        {
                            input.Consume();
                        }
                        else
                        {
                            MismatchedSetException mse = new MismatchedSetException(null, input);
                            Recover(mse);
                            throw mse;
                        }
                    }
                    break;

                    default:
                        if (cnt4 >= 1)
                        {
                            goto loop4;
                        }
                        EarlyExitException eee4 =
                            new EarlyExitException(4, input);
                        throw eee4;
                    }
                    cnt4++;
                } while (true);

loop4:
                ;               // Stops C# compiler whining that label 'loop4' has no statements

                _channel = HIDDEN;
            }

            state.type    = _type;
            state.channel = _channel;
        }
        finally
        {
        }
    }
Ejemplo n.º 21
0
        private void mEXPONENT()
        {
            EnterRule_EXPONENT();
            EnterRule("EXPONENT", 10);
            TraceIn("EXPONENT", 10);
            try
            {
                // C:\\Users\\illus\\OneDrive\\?????????\\Visual Studio 2015\\Projects\\Compilators\\GoA.g:56:10: ( ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+ )
                DebugEnterAlt(1);
                // C:\\Users\\illus\\OneDrive\\?????????\\Visual Studio 2015\\Projects\\Compilators\\GoA.g:56:12: ( 'e' | 'E' ) ( '+' | '-' )? ( '0' .. '9' )+
                {
                    DebugLocation(56, 12);
                    if (input.LA(1) == 'E' || input.LA(1) == 'e')
                    {
                        input.Consume();
                    }
                    else
                    {
                        MismatchedSetException mse = new MismatchedSetException(null, input);
                        DebugRecognitionException(mse);
                        Recover(mse);
                        throw mse;
                    }

                    DebugLocation(56, 22);
                    // C:\\Users\\illus\\OneDrive\\?????????\\Visual Studio 2015\\Projects\\Compilators\\GoA.g:56:22: ( '+' | '-' )?
                    int alt8 = 2;
                    try { DebugEnterSubRule(8);
                          try { DebugEnterDecision(8, false);
                                int LA8_1 = input.LA(1);

                                if ((LA8_1 == '+' || LA8_1 == '-'))
                                {
                                    alt8 = 1;
                                }
                          } finally { DebugExitDecision(8); }
                          switch (alt8)
                          {
                          case 1:
                              DebugEnterAlt(1);
                              // C:\\Users\\illus\\OneDrive\\?????????\\Visual Studio 2015\\Projects\\Compilators\\GoA.g:
                              {
                                  DebugLocation(56, 22);
                                  input.Consume();
                              }
                              break;
                          }
                    } finally { DebugExitSubRule(8); }

                    DebugLocation(56, 33);
                    // C:\\Users\\illus\\OneDrive\\?????????\\Visual Studio 2015\\Projects\\Compilators\\GoA.g:56:33: ( '0' .. '9' )+
                    int cnt9 = 0;
                    try { DebugEnterSubRule(9);
                          while (true)
                          {
                              int alt9 = 2;
                              try { DebugEnterDecision(9, false);
                                    int LA9_1 = input.LA(1);

                                    if (((LA9_1 >= '0' && LA9_1 <= '9')))
                                    {
                                        alt9 = 1;
                                    }
                              } finally { DebugExitDecision(9); }
                              switch (alt9)
                              {
                              case 1:
                                  DebugEnterAlt(1);
                                  // C:\\Users\\illus\\OneDrive\\?????????\\Visual Studio 2015\\Projects\\Compilators\\GoA.g:
                                  {
                                      DebugLocation(56, 33);
                                      input.Consume();
                                  }
                                  break;

                              default:
                                  if (cnt9 >= 1)
                                  {
                                      goto loop9;
                                  }

                                  EarlyExitException eee9 = new EarlyExitException(9, input);
                                  DebugRecognitionException(eee9);
                                  throw eee9;
                              }
                              cnt9++;
                          }
loop9:
                          ; } finally { DebugExitSubRule(9); }
                }
            }
            finally
            {
                TraceOut("EXPONENT", 10);
                LeaveRule("EXPONENT", 10);
                LeaveRule_EXPONENT();
            }
        }
Ejemplo n.º 22
0
        private void mIDENTIFIER()
        {
            EnterRule_IDENTIFIER();
            EnterRule("IDENTIFIER", 9);
            TraceIn("IDENTIFIER", 9);
            try
            {
                int _type    = IDENTIFIER;
                int _channel = DefaultTokenChannel;
                // E:\\dolivares\\ChemProV\\ChemProV\\Grammars\\ChemProV.g:28:2: ( ( 'a' .. 'z' | 'A' .. 'Z' )+ | ( 'a' .. 'z' | 'A' .. 'Z' )+ '0' .. '9' ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' )* )
                int alt4 = 2;
                try { DebugEnterDecision(4, false);
                      try
                      {
                          alt4 = dfa4.Predict(input);
                      }
                      catch (NoViableAltException nvae)
                      {
                          DebugRecognitionException(nvae);
                          throw;
                      } } finally { DebugExitDecision(4); }
                switch (alt4)
                {
                case 1:
                    DebugEnterAlt(1);
                    // E:\\dolivares\\ChemProV\\ChemProV\\Grammars\\ChemProV.g:28:4: ( 'a' .. 'z' | 'A' .. 'Z' )+
                    {
                        DebugLocation(28, 4);
                        // E:\\dolivares\\ChemProV\\ChemProV\\Grammars\\ChemProV.g:28:4: ( 'a' .. 'z' | 'A' .. 'Z' )+
                        int cnt1 = 0;
                        try { DebugEnterSubRule(1);
                              while (true)
                              {
                                  int alt1 = 2;
                                  try { DebugEnterDecision(1, false);
                                        int LA1_0 = input.LA(1);

                                        if (((LA1_0 >= 'A' && LA1_0 <= 'Z') || (LA1_0 >= 'a' && LA1_0 <= 'z')))
                                        {
                                            alt1 = 1;
                                        }
                                  } finally { DebugExitDecision(1); }
                                  switch (alt1)
                                  {
                                  case 1:
                                      DebugEnterAlt(1);
                                      // E:\\dolivares\\ChemProV\\ChemProV\\Grammars\\ChemProV.g:
                                      {
                                          DebugLocation(28, 4);
                                          input.Consume();
                                      }
                                      break;

                                  default:
                                      if (cnt1 >= 1)
                                      {
                                          goto loop1;
                                      }

                                      EarlyExitException eee1 = new EarlyExitException(1, input);
                                      DebugRecognitionException(eee1);
                                      throw eee1;
                                  }
                                  cnt1++;
                              }
loop1:
                              ; } finally { DebugExitSubRule(1); }
                    }
                    break;

                case 2:
                    DebugEnterAlt(2);
                    // E:\\dolivares\\ChemProV\\ChemProV\\Grammars\\ChemProV.g:28:27: ( 'a' .. 'z' | 'A' .. 'Z' )+ '0' .. '9' ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' )*
                    {
                        DebugLocation(28, 27);
                        // E:\\dolivares\\ChemProV\\ChemProV\\Grammars\\ChemProV.g:28:27: ( 'a' .. 'z' | 'A' .. 'Z' )+
                        int cnt2 = 0;
                        try { DebugEnterSubRule(2);
                              while (true)
                              {
                                  int alt2 = 2;
                                  try { DebugEnterDecision(2, false);
                                        int LA2_0 = input.LA(1);

                                        if (((LA2_0 >= 'A' && LA2_0 <= 'Z') || (LA2_0 >= 'a' && LA2_0 <= 'z')))
                                        {
                                            alt2 = 1;
                                        }
                                  } finally { DebugExitDecision(2); }
                                  switch (alt2)
                                  {
                                  case 1:
                                      DebugEnterAlt(1);
                                      // E:\\dolivares\\ChemProV\\ChemProV\\Grammars\\ChemProV.g:
                                      {
                                          DebugLocation(28, 27);
                                          input.Consume();
                                      }
                                      break;

                                  default:
                                      if (cnt2 >= 1)
                                      {
                                          goto loop2;
                                      }

                                      EarlyExitException eee2 = new EarlyExitException(2, input);
                                      DebugRecognitionException(eee2);
                                      throw eee2;
                                  }
                                  cnt2++;
                              }
loop2:
                              ; } finally { DebugExitSubRule(2); }

                        DebugLocation(28, 48);
                        MatchRange('0', '9');
                        DebugLocation(28, 57);
                        // E:\\dolivares\\ChemProV\\ChemProV\\Grammars\\ChemProV.g:28:57: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' )*
                        try { DebugEnterSubRule(3);
                              while (true)
                              {
                                  int alt3 = 2;
                                  try { DebugEnterDecision(3, false);
                                        int LA3_0 = input.LA(1);

                                        if (((LA3_0 >= '0' && LA3_0 <= '9') || (LA3_0 >= 'A' && LA3_0 <= 'Z') || (LA3_0 >= 'a' && LA3_0 <= 'z')))
                                        {
                                            alt3 = 1;
                                        }
                                  } finally { DebugExitDecision(3); }
                                  switch (alt3)
                                  {
                                  case 1:
                                      DebugEnterAlt(1);
                                      // E:\\dolivares\\ChemProV\\ChemProV\\Grammars\\ChemProV.g:
                                      {
                                          DebugLocation(28, 57);
                                          input.Consume();
                                      }
                                      break;

                                  default:
                                      goto loop3;
                                  }
                              }

loop3:
                              ; } finally { DebugExitSubRule(3); }
                    }
                    break;
                }
                state.type    = _type;
                state.channel = _channel;
            }
            finally
            {
                TraceOut("IDENTIFIER", 9);
                LeaveRule("IDENTIFIER", 9);
                LeaveRule_IDENTIFIER();
            }
        }
Ejemplo n.º 23
0
    private void mINT()
    {
        EnterRule_INT();
        EnterRule("INT", 8);
        TraceIn("INT", 8);
        try
        {
            int _type    = INT;
            int _channel = DefaultTokenChannel;
            // C:\\Users\\dany_\\Desktop\\final1.g:36:5: ( ( 'A' .. 'F' | '0' .. '9' | 'a' .. 'f' )+ )
            DebugEnterAlt(1);
            // C:\\Users\\dany_\\Desktop\\final1.g:36:8: ( 'A' .. 'F' | '0' .. '9' | 'a' .. 'f' )+
            {
                DebugLocation(36, 8);
                // C:\\Users\\dany_\\Desktop\\final1.g:36:8: ( 'A' .. 'F' | '0' .. '9' | 'a' .. 'f' )+
                int cnt4 = 0;
                try { DebugEnterSubRule(4);
                      while (true)
                      {
                          int alt4 = 2;
                          try { DebugEnterDecision(4, decisionCanBacktrack[4]);
                                int LA4_0 = input.LA(1);

                                if (((LA4_0 >= '0' && LA4_0 <= '9') || (LA4_0 >= 'A' && LA4_0 <= 'F') || (LA4_0 >= 'a' && LA4_0 <= 'f')))
                                {
                                    alt4 = 1;
                                }
                          } finally { DebugExitDecision(4); }
                          switch (alt4)
                          {
                          case 1:
                              DebugEnterAlt(1);
                              // C:\\Users\\dany_\\Desktop\\final1.g:
                              {
                                  DebugLocation(36, 8);
                                  input.Consume();
                              }
                              break;

                          default:
                              if (cnt4 >= 1)
                              {
                                  goto loop4;
                              }

                              EarlyExitException eee4 = new EarlyExitException(4, input);
                              DebugRecognitionException(eee4);
                              throw eee4;
                          }
                          cnt4++;
                      }
loop4:
                      ; } finally { DebugExitSubRule(4); }
            }

            state.type    = _type;
            state.channel = _channel;
        }
        finally
        {
            TraceOut("INT", 8);
            LeaveRule("INT", 8);
            LeaveRule_INT();
        }
    }
Ejemplo n.º 24
0
        private void mINTEGER()
        {
            EnterRule_INTEGER();
            EnterRule("INTEGER", 10);
            TraceIn("INTEGER", 10);
            try
            {
                int _type    = INTEGER;
                int _channel = DefaultTokenChannel;
                // E:\\dolivares\\ChemProV\\ChemProV\\Grammars\\ChemProV.g:32:2: ( ( '0' .. '9' )+ )
                DebugEnterAlt(1);
                // E:\\dolivares\\ChemProV\\ChemProV\\Grammars\\ChemProV.g:32:4: ( '0' .. '9' )+
                {
                    DebugLocation(32, 4);
                    // E:\\dolivares\\ChemProV\\ChemProV\\Grammars\\ChemProV.g:32:4: ( '0' .. '9' )+
                    int cnt5 = 0;
                    try { DebugEnterSubRule(5);
                          while (true)
                          {
                              int alt5 = 2;
                              try { DebugEnterDecision(5, false);
                                    int LA5_0 = input.LA(1);

                                    if (((LA5_0 >= '0' && LA5_0 <= '9')))
                                    {
                                        alt5 = 1;
                                    }
                              } finally { DebugExitDecision(5); }
                              switch (alt5)
                              {
                              case 1:
                                  DebugEnterAlt(1);
                                  // E:\\dolivares\\ChemProV\\ChemProV\\Grammars\\ChemProV.g:
                                  {
                                      DebugLocation(32, 4);
                                      input.Consume();
                                  }
                                  break;

                              default:
                                  if (cnt5 >= 1)
                                  {
                                      goto loop5;
                                  }

                                  EarlyExitException eee5 = new EarlyExitException(5, input);
                                  DebugRecognitionException(eee5);
                                  throw eee5;
                              }
                              cnt5++;
                          }
loop5:
                          ; } finally { DebugExitSubRule(5); }
                }

                state.type    = _type;
                state.channel = _channel;
            }
            finally
            {
                TraceOut("INTEGER", 10);
                LeaveRule("INTEGER", 10);
                LeaveRule_INTEGER();
            }
        }
Ejemplo n.º 25
0
        private void mWS()
        {
            EnterRule_WS();
            EnterRule("WS", 2);
            TraceIn("WS", 2);
            try
            {
                int _type    = WS;
                int _channel = DefaultTokenChannel;
                // C:\\Users\\franz\\SkyDrive\\Dokumente\\workspace\\TextTable\\src\\eu\\reitmayer\\texttable\\lang\\TextTable.g:53:4: ( ( ' ' | '\\t' | '\\f' | '\\n' | '\\r' )+ )
                DebugEnterAlt(1);
                // C:\\Users\\franz\\SkyDrive\\Dokumente\\workspace\\TextTable\\src\\eu\\reitmayer\\texttable\\lang\\TextTable.g:54:3: ( ' ' | '\\t' | '\\f' | '\\n' | '\\r' )+
                {
                    DebugLocation(54, 3);
                    // C:\\Users\\franz\\SkyDrive\\Dokumente\\workspace\\TextTable\\src\\eu\\reitmayer\\texttable\\lang\\TextTable.g:54:3: ( ' ' | '\\t' | '\\f' | '\\n' | '\\r' )+
                    int cnt1 = 0;
                    try { DebugEnterSubRule(1);
                          while (true)
                          {
                              int alt1 = 2;
                              try { DebugEnterDecision(1, false);
                                    int LA1_0 = input.LA(1);

                                    if (((LA1_0 >= '\t' && LA1_0 <= '\n') || (LA1_0 >= '\f' && LA1_0 <= '\r') || LA1_0 == ' '))
                                    {
                                        alt1 = 1;
                                    }
                              } finally { DebugExitDecision(1); }
                              switch (alt1)
                              {
                              case 1:
                                  DebugEnterAlt(1);
                                  // C:\\Users\\franz\\SkyDrive\\Dokumente\\workspace\\TextTable\\src\\eu\\reitmayer\\texttable\\lang\\TextTable.g:
                                  {
                                      DebugLocation(54, 3);
                                      input.Consume();
                                  }
                                  break;

                              default:
                                  if (cnt1 >= 1)
                                  {
                                      goto loop1;
                                  }

                                  EarlyExitException eee1 = new EarlyExitException(1, input);
                                  DebugRecognitionException(eee1);
                                  throw eee1;
                              }
                              cnt1++;
                          }
loop1:
                          ; } finally { DebugExitSubRule(1); }

                    DebugLocation(54, 38);
                    _channel = Hidden;
                }

                state.type    = _type;
                state.channel = _channel;
            }
            finally
            {
                TraceOut("WS", 2);
                LeaveRule("WS", 2);
                LeaveRule_WS();
            }
        }
Ejemplo n.º 26
0
        private void mFLOAT()
        {
            EnterRule_FLOAT();
            EnterRule("FLOAT", 11);
            TraceIn("FLOAT", 11);
            try
            {
                int _type    = FLOAT;
                int _channel = DefaultTokenChannel;
                // E:\\dolivares\\ChemProV\\ChemProV\\Grammars\\ChemProV.g:34:2: ( ( '0' .. '9' )+ '.' ( '0' .. '9' )+ )
                DebugEnterAlt(1);
                // E:\\dolivares\\ChemProV\\ChemProV\\Grammars\\ChemProV.g:34:4: ( '0' .. '9' )+ '.' ( '0' .. '9' )+
                {
                    DebugLocation(34, 4);
                    // E:\\dolivares\\ChemProV\\ChemProV\\Grammars\\ChemProV.g:34:4: ( '0' .. '9' )+
                    int cnt6 = 0;
                    try { DebugEnterSubRule(6);
                          while (true)
                          {
                              int alt6 = 2;
                              try { DebugEnterDecision(6, false);
                                    int LA6_0 = input.LA(1);

                                    if (((LA6_0 >= '0' && LA6_0 <= '9')))
                                    {
                                        alt6 = 1;
                                    }
                              } finally { DebugExitDecision(6); }
                              switch (alt6)
                              {
                              case 1:
                                  DebugEnterAlt(1);
                                  // E:\\dolivares\\ChemProV\\ChemProV\\Grammars\\ChemProV.g:
                                  {
                                      DebugLocation(34, 4);
                                      input.Consume();
                                  }
                                  break;

                              default:
                                  if (cnt6 >= 1)
                                  {
                                      goto loop6;
                                  }

                                  EarlyExitException eee6 = new EarlyExitException(6, input);
                                  DebugRecognitionException(eee6);
                                  throw eee6;
                              }
                              cnt6++;
                          }
loop6:
                          ; } finally { DebugExitSubRule(6); }

                    DebugLocation(34, 14);
                    Match('.');
                    DebugLocation(34, 18);
                    // E:\\dolivares\\ChemProV\\ChemProV\\Grammars\\ChemProV.g:34:18: ( '0' .. '9' )+
                    int cnt7 = 0;
                    try { DebugEnterSubRule(7);
                          while (true)
                          {
                              int alt7 = 2;
                              try { DebugEnterDecision(7, false);
                                    int LA7_0 = input.LA(1);

                                    if (((LA7_0 >= '0' && LA7_0 <= '9')))
                                    {
                                        alt7 = 1;
                                    }
                              } finally { DebugExitDecision(7); }
                              switch (alt7)
                              {
                              case 1:
                                  DebugEnterAlt(1);
                                  // E:\\dolivares\\ChemProV\\ChemProV\\Grammars\\ChemProV.g:
                                  {
                                      DebugLocation(34, 18);
                                      input.Consume();
                                  }
                                  break;

                              default:
                                  if (cnt7 >= 1)
                                  {
                                      goto loop7;
                                  }

                                  EarlyExitException eee7 = new EarlyExitException(7, input);
                                  DebugRecognitionException(eee7);
                                  throw eee7;
                              }
                              cnt7++;
                          }
loop7:
                          ; } finally { DebugExitSubRule(7); }
                }

                state.type    = _type;
                state.channel = _channel;
            }
            finally
            {
                TraceOut("FLOAT", 11);
                LeaveRule("FLOAT", 11);
                LeaveRule_FLOAT();
            }
        }
    private void mWS()
    {
        EnterRule_WS();
        EnterRule("WS", 9);
        TraceIn("WS", 9);
        try
        {
            int _type    = WS;
            int _channel = DefaultTokenChannel;
            // C:\\Users\\dany_\\Desktop\\Calculadora1.g:73:2: ( ( ' ' | '\\r' | '\\n' | '\\t' )+ )
            DebugEnterAlt(1);
            // C:\\Users\\dany_\\Desktop\\Calculadora1.g:73:4: ( ' ' | '\\r' | '\\n' | '\\t' )+
            {
                DebugLocation(73, 4);
                // C:\\Users\\dany_\\Desktop\\Calculadora1.g:73:4: ( ' ' | '\\r' | '\\n' | '\\t' )+
                int cnt2 = 0;
                try
                {
                    DebugEnterSubRule(2);
                    while (true)
                    {
                        int alt2 = 2;
                        try
                        {
                            DebugEnterDecision(2, decisionCanBacktrack[2]);
                            int LA2_0 = input.LA(1);

                            if (((LA2_0 >= '\t' && LA2_0 <= '\n') || LA2_0 == '\r' || LA2_0 == ' '))
                            {
                                alt2 = 1;
                            }
                        }
                        finally { DebugExitDecision(2); }
                        switch (alt2)
                        {
                        case 1:
                            DebugEnterAlt(1);
                            // C:\\Users\\dany_\\Desktop\\Calculadora1.g:
                            {
                                DebugLocation(73, 4);
                                input.Consume();
                            }
                            break;

                        default:
                            if (cnt2 >= 1)
                            {
                                goto loop2;
                            }

                            EarlyExitException eee2 = new EarlyExitException(2, input);
                            DebugRecognitionException(eee2);
                            throw eee2;
                        }
                        cnt2++;
                    }
loop2:
                    ;
                }
                finally { DebugExitSubRule(2); }

                DebugLocation(73, 26);
                Skip();
            }

            state.type    = _type;
            state.channel = _channel;
        }
        finally
        {
            TraceOut("WS", 9);
            LeaveRule("WS", 9);
            LeaveRule_WS();
        }
    }
Ejemplo n.º 28
0
        private void mWS()
        {
            EnterRule_WS();
            EnterRule("WS", 13);
            TraceIn("WS", 13);
            try
            {
                int _type    = WS;
                int _channel = DefaultTokenChannel;
                // E:\\dolivares\\ChemProV\\ChemProV\\Grammars\\ChemProV.g:37:4: ( ( ' ' | '\\t' | '\\n' | '\\r' )+ )
                DebugEnterAlt(1);
                // E:\\dolivares\\ChemProV\\ChemProV\\Grammars\\ChemProV.g:37:6: ( ' ' | '\\t' | '\\n' | '\\r' )+
                {
                    DebugLocation(37, 6);
                    // E:\\dolivares\\ChemProV\\ChemProV\\Grammars\\ChemProV.g:37:6: ( ' ' | '\\t' | '\\n' | '\\r' )+
                    int cnt9 = 0;
                    try { DebugEnterSubRule(9);
                          while (true)
                          {
                              int alt9 = 2;
                              try { DebugEnterDecision(9, false);
                                    int LA9_0 = input.LA(1);

                                    if (((LA9_0 >= '\t' && LA9_0 <= '\n') || LA9_0 == '\r' || LA9_0 == ' '))
                                    {
                                        alt9 = 1;
                                    }
                              } finally { DebugExitDecision(9); }
                              switch (alt9)
                              {
                              case 1:
                                  DebugEnterAlt(1);
                                  // E:\\dolivares\\ChemProV\\ChemProV\\Grammars\\ChemProV.g:
                                  {
                                      DebugLocation(37, 6);
                                      input.Consume();
                                  }
                                  break;

                              default:
                                  if (cnt9 >= 1)
                                  {
                                      goto loop9;
                                  }

                                  EarlyExitException eee9 = new EarlyExitException(9, input);
                                  DebugRecognitionException(eee9);
                                  throw eee9;
                              }
                              cnt9++;
                          }
loop9:
                          ; } finally { DebugExitSubRule(9); }

                    DebugLocation(37, 28);
                    Skip();
                }

                state.type    = _type;
                state.channel = _channel;
            }
            finally
            {
                TraceOut("WS", 13);
                LeaveRule("WS", 13);
                LeaveRule_WS();
            }
        }
Ejemplo n.º 29
0
    // $ANTLR end IDENTIFIER

    // $ANTLR start WHITESPACE
    public void mWHITESPACE() // throws RecognitionException [2]
    {
        try
        {
            int _type = WHITESPACE;
            // CVarTracker/cvartracker.g:54:14: ( ( '\\t' | ' ' | '\\r' | '\\n' | '\\u000C' )+ )
            // CVarTracker/cvartracker.g:54:14: ( '\\t' | ' ' | '\\r' | '\\n' | '\\u000C' )+
            {
                // CVarTracker/cvartracker.g:54:14: ( '\\t' | ' ' | '\\r' | '\\n' | '\\u000C' )+
                int cnt2 = 0;
                do
                {
                    int alt2  = 2;
                    int LA2_0 = input.LA(1);

                    if (((LA2_0 >= '\t' && LA2_0 <= '\n') || (LA2_0 >= '\f' && LA2_0 <= '\r') || LA2_0 == ' '))
                    {
                        alt2 = 1;
                    }


                    switch (alt2)
                    {
                    case 1:
                        // CVarTracker/cvartracker.g:
                    {
                        if ((input.LA(1) >= '\t' && input.LA(1) <= '\n') || (input.LA(1) >= '\f' && input.LA(1) <= '\r') || input.LA(1) == ' ')
                        {
                            input.Consume();
                        }
                        else
                        {
                            MismatchedSetException mse =
                                new MismatchedSetException(null, input);
                            Recover(mse);    throw mse;
                        }
                    }
                    break;

                    default:
                        if (cnt2 >= 1)
                        {
                            goto loop2;
                        }
                        EarlyExitException eee =
                            new EarlyExitException(2, input);
                        throw eee;
                    }
                    cnt2++;
                } while (true);

loop2:
                ;               // Stops C# compiler whinging that label 'loop2' has no statements

                channel = HIDDEN;
            }

            this.type = _type;
        }
        finally
        {
        }
    }
Ejemplo n.º 30
0
    // $ANTLR end "prog"


    // $ANTLR start "stat"
    // BuildOptions\\DebugTreeGrammar.g3:56:0: stat : ( expr | ^( '=' ID expr ) | ^( FUNC ( . )+ ) );
    private void stat(  )
    {
        CommonTree ID2   = null;
        BigInteger expr1 = default(BigInteger);
        BigInteger expr3 = default(BigInteger);

        try
        {
            dbg.EnterRule(GrammarFileName, "stat");
            if (RuleLevel == 0)
            {
                dbg.Commence();
            }
            IncRuleLevel();
            dbg.Location(56, -1);

            try
            {
                // BuildOptions\\DebugTreeGrammar.g3:56:9: ( expr | ^( '=' ID expr ) | ^( FUNC ( . )+ ) )
                int alt3 = 3;
                try
                {
                    dbg.EnterDecision(3);

                    switch (input.LA(1))
                    {
                    case CALL:
                    case ID:
                    case INT:
                    case 10:
                    case 11:
                    case 14:
                    case 15:
                    case 16:
                    {
                        alt3 = 1;
                    }
                    break;

                    case 17:
                    {
                        alt3 = 2;
                    }
                    break;

                    case FUNC:
                    {
                        alt3 = 3;
                    }
                    break;

                    default:
                    {
                        NoViableAltException nvae = new NoViableAltException("", 3, 0, input);

                        dbg.RecognitionException(nvae);
                        throw nvae;
                    }
                    }
                }
                finally
                {
                    dbg.ExitDecision(3);
                }

                switch (alt3)
                {
                case 1:
                    dbg.EnterAlt(1);

                    // BuildOptions\\DebugTreeGrammar.g3:56:9: expr
                    {
                        dbg.Location(56, 8);
                        PushFollow(Follow._expr_in_stat63);
                        expr1 = expr();

                        state._fsp--;

                        dbg.Location(56, 35);
                        string result = expr1.ToString();
                        Console.Out.WriteLine(expr1 + " (about " + result[0] + "*10^" + (result.Length - 1) + ")");
                    }
                    break;

                case 2:
                    dbg.EnterAlt(2);

                    // BuildOptions\\DebugTreeGrammar.g3:59:9: ^( '=' ID expr )
                    {
                        dbg.Location(59, 8);
                        dbg.Location(59, 10);
                        Match(input, 17, Follow._17_in_stat98);

                        Match(input, TokenConstants.DOWN, null);
                        dbg.Location(59, 14);
                        ID2 = (CommonTree)Match(input, ID, Follow._ID_in_stat100);
                        dbg.Location(59, 17);
                        PushFollow(Follow._expr_in_stat102);
                        expr3 = expr();

                        state._fsp--;


                        Match(input, TokenConstants.UP, null);
                        dbg.Location(59, 35);
                        globalMemory[(ID2 != null?ID2.Text:null)] = expr3;
                    }
                    break;

                case 3:
                    dbg.EnterAlt(3);

                    // BuildOptions\\DebugTreeGrammar.g3:60:9: ^( FUNC ( . )+ )
                    {
                        dbg.Location(60, 8);
                        dbg.Location(60, 10);
                        Match(input, FUNC, Follow._FUNC_in_stat128);

                        Match(input, TokenConstants.DOWN, null);
                        dbg.Location(60, 15);
                        // BuildOptions\\DebugTreeGrammar.g3:60:16: ( . )+
                        int cnt2 = 0;
                        try
                        {
                            dbg.EnterSubRule(2);

                            for ( ; ;)
                            {
                                int alt2 = 2;
                                try
                                {
                                    dbg.EnterDecision(2);

                                    int LA2_0 = input.LA(1);

                                    if (((LA2_0 >= CALL && LA2_0 <= 17)))
                                    {
                                        alt2 = 1;
                                    }
                                    else if ((LA2_0 == UP))
                                    {
                                        alt2 = 2;
                                    }
                                }
                                finally
                                {
                                    dbg.ExitDecision(2);
                                }

                                switch (alt2)
                                {
                                case 1:
                                    dbg.EnterAlt(1);

                                    // BuildOptions\\DebugTreeGrammar.g3:60:0: .
                                    {
                                        dbg.Location(60, 15);
                                        MatchAny(input);
                                    }
                                    break;

                                default:
                                    if (cnt2 >= 1)
                                    {
                                        goto loop2;
                                    }

                                    EarlyExitException eee2 = new EarlyExitException(2, input);
                                    dbg.RecognitionException(eee2);

                                    throw eee2;
                                }
                                cnt2++;
                            }
loop2:
                            ;
                        }
                        finally
                        {
                            dbg.ExitSubRule(2);
                        }


                        Match(input, TokenConstants.UP, null);
                    }
                    break;
                }
            }
            catch (RecognitionException re)
            {
                ReportError(re);
                Recover(input, re);
            }
            finally
            {
            }
            dbg.Location(61, 4);
        }
        finally
        {
            dbg.ExitRule(GrammarFileName, "stat");
            DecRuleLevel();
            if (RuleLevel == 0)
            {
                dbg.Terminate();
            }
        }

        return;
    }