Exemplo n.º 1
0
        private string binaryFunction(string parseFileName, string parsePassword)
        {
            EnterRule_binaryFunction();
            EnterRule("binaryFunction", 4);
            TraceIn("binaryFunction", 4);
            string value = default(string);


            ParserRuleReturnScope <IToken> func = default(ParserRuleReturnScope <IToken>);
            string arg1 = default(string);
            string arg2 = default(string);

            try { DebugEnterRule(GrammarFileName, "binaryFunction");
                  DebugLocation(71, 1);
                  try
                  {
                      // D:\\Patrick\\FigLeaf\\fig-leaf\\FigLeaf.Core\\FigLeafPasswordRule.g:72:2: (func= binaryFunctionName OPENBRACKET arg1= functionArgument[parseFileName, parsePassword] COMMA ( SPACE )* arg2= functionArgument[parseFileName, parsePassword] CLOSEBRACKET )
                      DebugEnterAlt(1);
                      // D:\\Patrick\\FigLeaf\\fig-leaf\\FigLeaf.Core\\FigLeafPasswordRule.g:72:4: func= binaryFunctionName OPENBRACKET arg1= functionArgument[parseFileName, parsePassword] COMMA ( SPACE )* arg2= functionArgument[parseFileName, parsePassword] CLOSEBRACKET
                      {
                          DebugLocation(72, 9);
                          PushFollow(Follow._binaryFunctionName_in_binaryFunction183);
                          func = binaryFunctionName();
                          PopFollow();

                          DebugLocation(72, 30);
                          Match(input, OPENBRACKET, Follow._OPENBRACKET_in_binaryFunction185);
                          DebugLocation(72, 47);
                          PushFollow(Follow._functionArgument_in_binaryFunction191);
                          arg1 = functionArgument(parseFileName, parsePassword);
                          PopFollow();

                          DebugLocation(72, 96);
                          Match(input, COMMA, Follow._COMMA_in_binaryFunction194);
                          DebugLocation(72, 102);
                          // D:\\Patrick\\FigLeaf\\fig-leaf\\FigLeaf.Core\\FigLeafPasswordRule.g:72:102: ( SPACE )*
                          try { DebugEnterSubRule(4);
                                while (true)
                                {
                                    int alt4 = 2;
                                    try { DebugEnterDecision(4, decisionCanBacktrack[4]);
                                          int LA4_1 = input.LA(1);

                                          if ((LA4_1 == SPACE))
                                          {
                                              alt4 = 1;
                                          }
                                    } finally { DebugExitDecision(4); }
                                    switch (alt4)
                                    {
                                    case 1:
                                        DebugEnterAlt(1);
                                        // D:\\Patrick\\FigLeaf\\fig-leaf\\FigLeaf.Core\\FigLeafPasswordRule.g:72:102: SPACE
                                        {
                                            DebugLocation(72, 102);
                                            Match(input, SPACE, Follow._SPACE_in_binaryFunction196);
                                        }
                                        break;

                                    default:
                                        goto loop4;
                                    }
                                }

loop4:
                                ; } finally { DebugExitSubRule(4); }

                          DebugLocation(72, 114);
                          PushFollow(Follow._functionArgument_in_binaryFunction203);
                          arg2 = functionArgument(parseFileName, parsePassword);
                          PopFollow();

                          DebugLocation(72, 163);
                          Match(input, CLOSEBRACKET, Follow._CLOSEBRACKET_in_binaryFunction206);
                          DebugLocation(73, 2);

                          System.Func <string, string, string> function = Functions.GetBinaryFunction((func != null?input.ToString(func.Start, func.Stop):default(string)));
                          value = function(arg1, arg2);
                      }
                  }

                  catch (RecognitionException e)
                  {
                      throw;
                  }

                  finally
                  {
                      TraceOut("binaryFunction", 4);
                      LeaveRule("binaryFunction", 4);
                      LeaveRule_binaryFunction();
                  }
                  DebugLocation(77, 1); } finally { DebugExitRule(GrammarFileName, "binaryFunction"); }
            return(value);
        }
Exemplo n.º 2
0
        public string functionArgument(string parseFileName, string parsePassword)
        {
            EnterRule_functionArgument();
            EnterRule("functionArgument", 2);
            TraceIn("functionArgument", 2);
            string value = default(string);


            string ba = default(string);
            ParserRuleReturnScope <IToken> n = default(ParserRuleReturnScope <IToken>);
            string f = default(string);

            try { DebugEnterRule(GrammarFileName, "functionArgument");
                  DebugLocation(45, 1);
                  try
                  {
                      // D:\\Patrick\\FigLeaf\\fig-leaf\\FigLeaf.Core\\FigLeafPasswordRule.g:46:2: (ba= baseArgument[parseFileName, parsePassword] |n= number |f= function[parseFileName, parsePassword] )
                      int alt2 = 3;
                      try { DebugEnterDecision(2, decisionCanBacktrack[2]);
                            switch (input.LA(1))
                            {
                            case 12:
                            case 16:
                            {
                                alt2 = 1;
                            }
                            break;

                            case DIGIT:
                            {
                                alt2 = 2;
                            }
                            break;

                            case 9:
                            case 10:
                            case 11:
                            case 13:
                            case 14:
                            case 15:
                            case 17:
                            case 18:
                            case 19:
                            case 20:
                            {
                                alt2 = 3;
                            }
                            break;

                            default:
                            {
                                NoViableAltException nvae = new NoViableAltException("", 2, 0, input, 1);
                                DebugRecognitionException(nvae);
                                throw nvae;
                            }
                            }
                      } finally { DebugExitDecision(2); }
                      switch (alt2)
                      {
                      case 1:
                          DebugEnterAlt(1);
                          // D:\\Patrick\\FigLeaf\\fig-leaf\\FigLeaf.Core\\FigLeafPasswordRule.g:46:4: ba= baseArgument[parseFileName, parsePassword]
                          {
                              DebugLocation(46, 7);
                              PushFollow(Follow._baseArgument_in_functionArgument99);
                              ba = baseArgument(parseFileName, parsePassword);
                              PopFollow();

                              DebugLocation(47, 2);

                              value = ba;
                          }
                          break;

                      case 2:
                          DebugEnterAlt(2);
                          // D:\\Patrick\\FigLeaf\\fig-leaf\\FigLeaf.Core\\FigLeafPasswordRule.g:50:4: n= number
                          {
                              DebugLocation(50, 6);
                              PushFollow(Follow._number_in_functionArgument112);
                              n = number();
                              PopFollow();

                              DebugLocation(51, 2);

                              value = (n != null?input.ToString(n.Start, n.Stop):default(string));
                          }
                          break;

                      case 3:
                          DebugEnterAlt(3);
                          // D:\\Patrick\\FigLeaf\\fig-leaf\\FigLeaf.Core\\FigLeafPasswordRule.g:54:4: f= function[parseFileName, parsePassword]
                          {
                              DebugLocation(54, 6);
                              PushFollow(Follow._function_in_functionArgument124);
                              f = function(parseFileName, parsePassword);
                              PopFollow();

                              DebugLocation(55, 2);

                              value = f;
                          }
                          break;
                      }
                  }

                  catch (RecognitionException e)
                  {
                      throw;
                  }

                  finally
                  {
                      TraceOut("functionArgument", 2);
                      LeaveRule("functionArgument", 2);
                      LeaveRule_functionArgument();
                  }
                  DebugLocation(58, 1); } finally { DebugExitRule(GrammarFileName, "functionArgument"); }
            return(value);
        }