A game about forced loneliness, made by TACStudios
1#pragma warning disable 219 2// $ANTLR 3.2 Sep 23, 2009 12:02:23 C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g 2009-11-11 17:56:42 3 4using System; 5using System.Collections.Generic; 6using System.Globalization; 7using System.Text; 8using Unity.VisualScripting.Antlr3.Runtime; 9using Unity.VisualScripting.Antlr3.Runtime.Tree; 10 11namespace Unity.VisualScripting.Dependencies.NCalc 12{ 13 public class NCalcParser : Parser 14 { 15 // delegates 16 // delegators 17 18 public NCalcParser(ITokenStream input) 19 : this(input, new RecognizerSharedState()) { } 20 21 public NCalcParser(ITokenStream input, RecognizerSharedState state) 22 : base(input, state) 23 { 24 InitializeCyclicDFAs(); 25 } 26 27 protected ITreeAdaptor adaptor = new CommonTreeAdaptor(); 28 29 public ITreeAdaptor TreeAdaptor 30 { 31 get 32 { 33 return adaptor; 34 } 35 set 36 { 37 adaptor = value; 38 } 39 } 40 41 override public string[] TokenNames 42 { 43 get 44 { 45 return tokenNames; 46 } 47 } 48 49 override public string GrammarFileName 50 { 51 get 52 { 53 return "C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g"; 54 } 55 } 56 57 public List<string> Errors { get; private set; } 58 59 // $ANTLR end "arguments" 60 61 // Delegated rules 62 63 private void InitializeCyclicDFAs() { } 64 65 private string extractString(string text) 66 { 67 var sb = new StringBuilder(text); 68 var startIndex = 1; // Skip initial quote 69 var slashIndex = -1; 70 71 while ((slashIndex = sb.ToString().IndexOf(BS, startIndex)) != -1) 72 { 73 var escapeType = sb[slashIndex + 1]; 74 switch (escapeType) 75 { 76 case 'u': 77 var hcode = String.Concat(sb[slashIndex + 4], sb[slashIndex + 5]); 78 var lcode = String.Concat(sb[slashIndex + 2], sb[slashIndex + 3]); 79 var unicodeChar = Encoding.Unicode.GetChars(new[] { Convert.ToByte(hcode, 16), Convert.ToByte(lcode, 16) })[0]; 80 sb.Remove(slashIndex, 6).Insert(slashIndex, unicodeChar); 81 break; 82 case 'n': 83 sb.Remove(slashIndex, 2).Insert(slashIndex, '\n'); 84 break; 85 case 'r': 86 sb.Remove(slashIndex, 2).Insert(slashIndex, '\r'); 87 break; 88 case 't': 89 sb.Remove(slashIndex, 2).Insert(slashIndex, '\t'); 90 break; 91 case '\'': 92 sb.Remove(slashIndex, 2).Insert(slashIndex, '\''); 93 break; 94 case '\\': 95 sb.Remove(slashIndex, 2).Insert(slashIndex, '\\'); 96 break; 97 default: 98 throw new RecognitionException("Unvalid escape sequence: \\" + escapeType); 99 } 100 101 startIndex = slashIndex + 1; 102 } 103 104 sb.Remove(0, 1); 105 sb.Remove(sb.Length - 1, 1); 106 107 return sb.ToString(); 108 } 109 110 public override void DisplayRecognitionError(String[] tokenNames, RecognitionException e) 111 { 112 base.DisplayRecognitionError(tokenNames, e); 113 114 if (Errors == null) 115 { 116 Errors = new List<string>(); 117 } 118 119 var hdr = GetErrorHeader(e); 120 var msg = GetErrorMessage(e, tokenNames); 121 Errors.Add(msg + " at " + hdr); 122 } 123 124 // $ANTLR start "ncalcExpression" 125 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:77:1: ncalcExpression returns [LogicalExpression value] : logicalExpression EOF ; 126 public ncalcExpression_return ncalcExpression() // throws RecognitionException [1] 127 { 128 var retval = new ncalcExpression_return(); 129 retval.Start = input.LT(1); 130 131 CommonTree root_0 = null; 132 133 IToken EOF2 = null; 134 logicalExpression_return logicalExpression1 = null; 135 136 CommonTree EOF2_tree = null; 137 138 try 139 { 140 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:78:2: ( logicalExpression EOF ) 141 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:78:4: logicalExpression EOF 142 { 143 root_0 = (CommonTree)adaptor.GetNilNode(); 144 145 PushFollow(FOLLOW_logicalExpression_in_ncalcExpression56); 146 logicalExpression1 = logicalExpression(); 147 state.followingStackPointer--; 148 149 adaptor.AddChild(root_0, logicalExpression1.Tree); 150 EOF2 = (IToken)Match(input, EOF, FOLLOW_EOF_in_ncalcExpression58); 151 retval.value = logicalExpression1 != null ? logicalExpression1.value : null; 152 } 153 154 retval.Stop = input.LT(-1); 155 156 retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0); 157 adaptor.SetTokenBoundaries(retval.Tree, (IToken)retval.Start, (IToken)retval.Stop); 158 } 159 catch (RecognitionException re) 160 { 161 ReportError(re); 162 Recover(input, re); 163 // Conversion of the second argument necessary, but harmless 164 retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken)retval.Start, input.LT(-1), re); 165 } 166 finally { } 167 return retval; 168 } 169 170 // $ANTLR start "logicalExpression" 171 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:81:1: logicalExpression returns [LogicalExpression value] : left= conditionalExpression ( '?' middle= conditionalExpression ':' right= conditionalExpression )? ; 172 public logicalExpression_return logicalExpression() // throws RecognitionException [1] 173 { 174 var retval = new logicalExpression_return(); 175 retval.Start = input.LT(1); 176 177 CommonTree root_0 = null; 178 179 IToken char_literal3 = null; 180 IToken char_literal4 = null; 181 conditionalExpression_return left = null; 182 183 conditionalExpression_return middle = null; 184 185 conditionalExpression_return right = null; 186 187 CommonTree char_literal3_tree = null; 188 CommonTree char_literal4_tree = null; 189 190 try 191 { 192 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:82:2: (left= conditionalExpression ( '?' middle= conditionalExpression ':' right= conditionalExpression )? ) 193 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:82:4: left= conditionalExpression ( '?' middle= conditionalExpression ':' right= conditionalExpression )? 194 { 195 root_0 = (CommonTree)adaptor.GetNilNode(); 196 197 PushFollow(FOLLOW_conditionalExpression_in_logicalExpression78); 198 left = conditionalExpression(); 199 state.followingStackPointer--; 200 201 adaptor.AddChild(root_0, left.Tree); 202 retval.value = left != null ? left.value : null; 203 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:82:57: ( '?' middle= conditionalExpression ':' right= conditionalExpression )? 204 var alt1 = 2; 205 var LA1_0 = input.LA(1); 206 207 if (LA1_0 == 19) 208 { 209 alt1 = 1; 210 } 211 switch (alt1) 212 { 213 case 1: 214 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:82:59: '?' middle= conditionalExpression ':' right= conditionalExpression 215 { 216 char_literal3 = (IToken)Match(input, 19, FOLLOW_19_in_logicalExpression84); 217 char_literal3_tree = (CommonTree)adaptor.Create(char_literal3); 218 adaptor.AddChild(root_0, char_literal3_tree); 219 220 PushFollow(FOLLOW_conditionalExpression_in_logicalExpression88); 221 middle = conditionalExpression(); 222 state.followingStackPointer--; 223 224 adaptor.AddChild(root_0, middle.Tree); 225 char_literal4 = (IToken)Match(input, 20, FOLLOW_20_in_logicalExpression90); 226 char_literal4_tree = (CommonTree)adaptor.Create(char_literal4); 227 adaptor.AddChild(root_0, char_literal4_tree); 228 229 PushFollow(FOLLOW_conditionalExpression_in_logicalExpression94); 230 right = conditionalExpression(); 231 state.followingStackPointer--; 232 233 adaptor.AddChild(root_0, right.Tree); 234 retval.value = new TernaryExpression(left != null ? left.value : null, middle != null ? middle.value : null, right != null ? right.value : null); 235 } 236 break; 237 } 238 } 239 240 retval.Stop = input.LT(-1); 241 242 retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0); 243 adaptor.SetTokenBoundaries(retval.Tree, (IToken)retval.Start, (IToken)retval.Stop); 244 } 245 catch (RecognitionException re) 246 { 247 ReportError(re); 248 Recover(input, re); 249 // Conversion of the second argument necessary, but harmless 250 retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken)retval.Start, input.LT(-1), re); 251 } 252 finally { } 253 return retval; 254 } 255 256 // $ANTLR start "conditionalExpression" 257 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:85:1: conditionalExpression returns [LogicalExpression value] : left= booleanAndExpression ( ( '||' | 'or' ) right= conditionalExpression )* ; 258 public conditionalExpression_return conditionalExpression() // throws RecognitionException [1] 259 { 260 var retval = new conditionalExpression_return(); 261 retval.Start = input.LT(1); 262 263 CommonTree root_0 = null; 264 265 IToken set5 = null; 266 booleanAndExpression_return left = null; 267 268 conditionalExpression_return right = null; 269 270 CommonTree set5_tree = null; 271 272 var type = BinaryExpressionType.Unknown; 273 274 try 275 { 276 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:89:2: (left= booleanAndExpression ( ( '||' | 'or' ) right= conditionalExpression )* ) 277 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:89:4: left= booleanAndExpression ( ( '||' | 'or' ) right= conditionalExpression )* 278 { 279 root_0 = (CommonTree)adaptor.GetNilNode(); 280 281 PushFollow(FOLLOW_booleanAndExpression_in_conditionalExpression121); 282 left = booleanAndExpression(); 283 state.followingStackPointer--; 284 285 adaptor.AddChild(root_0, left.Tree); 286 retval.value = left != null ? left.value : null; 287 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:89:56: ( ( '||' | 'or' ) right= conditionalExpression )* 288 do 289 { 290 var alt2 = 2; 291 var LA2_0 = input.LA(1); 292 293 if (LA2_0 >= 21 && LA2_0 <= 22) 294 { 295 alt2 = 1; 296 } 297 298 switch (alt2) 299 { 300 case 1: 301 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:90:4: ( '||' | 'or' ) right= conditionalExpression 302 { 303 set5 = (IToken)input.LT(1); 304 if (input.LA(1) >= 21 && input.LA(1) <= 22) 305 { 306 input.Consume(); 307 adaptor.AddChild(root_0, (CommonTree)adaptor.Create(set5)); 308 state.errorRecovery = false; 309 } 310 else 311 { 312 var mse = new MismatchedSetException(null, input); 313 throw mse; 314 } 315 316 type = BinaryExpressionType.Or; 317 PushFollow(FOLLOW_conditionalExpression_in_conditionalExpression146); 318 right = conditionalExpression(); 319 state.followingStackPointer--; 320 321 adaptor.AddChild(root_0, right.Tree); 322 retval.value = new BinaryExpression(type, retval.value, right != null ? right.value : null); 323 } 324 break; 325 326 default: 327 goto loop2; 328 } 329 } 330 while (true); 331 332 loop2: 333 ; // Stops C# compiler whining that label 'loop2' has no statements 334 } 335 336 retval.Stop = input.LT(-1); 337 338 retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0); 339 adaptor.SetTokenBoundaries(retval.Tree, (IToken)retval.Start, (IToken)retval.Stop); 340 } 341 catch (RecognitionException re) 342 { 343 ReportError(re); 344 Recover(input, re); 345 // Conversion of the second argument necessary, but harmless 346 retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken)retval.Start, input.LT(-1), re); 347 } 348 finally { } 349 return retval; 350 } 351 352 // $ANTLR start "booleanAndExpression" 353 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:95:1: booleanAndExpression returns [LogicalExpression value] : left= bitwiseOrExpression ( ( '&&' | 'and' ) right= bitwiseOrExpression )* ; 354 public booleanAndExpression_return booleanAndExpression() // throws RecognitionException [1] 355 { 356 var retval = new booleanAndExpression_return(); 357 retval.Start = input.LT(1); 358 359 CommonTree root_0 = null; 360 361 IToken set6 = null; 362 bitwiseOrExpression_return left = null; 363 364 bitwiseOrExpression_return right = null; 365 366 CommonTree set6_tree = null; 367 368 var type = BinaryExpressionType.Unknown; 369 370 try 371 { 372 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:99:2: (left= bitwiseOrExpression ( ( '&&' | 'and' ) right= bitwiseOrExpression )* ) 373 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:99:4: left= bitwiseOrExpression ( ( '&&' | 'and' ) right= bitwiseOrExpression )* 374 { 375 root_0 = (CommonTree)adaptor.GetNilNode(); 376 377 PushFollow(FOLLOW_bitwiseOrExpression_in_booleanAndExpression180); 378 left = bitwiseOrExpression(); 379 state.followingStackPointer--; 380 381 adaptor.AddChild(root_0, left.Tree); 382 retval.value = left != null ? left.value : null; 383 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:99:55: ( ( '&&' | 'and' ) right= bitwiseOrExpression )* 384 do 385 { 386 var alt3 = 2; 387 var LA3_0 = input.LA(1); 388 389 if (LA3_0 >= 23 && LA3_0 <= 24) 390 { 391 alt3 = 1; 392 } 393 394 switch (alt3) 395 { 396 case 1: 397 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:100:4: ( '&&' | 'and' ) right= bitwiseOrExpression 398 { 399 set6 = (IToken)input.LT(1); 400 if (input.LA(1) >= 23 && input.LA(1) <= 24) 401 { 402 input.Consume(); 403 adaptor.AddChild(root_0, (CommonTree)adaptor.Create(set6)); 404 state.errorRecovery = false; 405 } 406 else 407 { 408 var mse = new MismatchedSetException(null, input); 409 throw mse; 410 } 411 412 type = BinaryExpressionType.And; 413 PushFollow(FOLLOW_bitwiseOrExpression_in_booleanAndExpression205); 414 right = bitwiseOrExpression(); 415 state.followingStackPointer--; 416 417 adaptor.AddChild(root_0, right.Tree); 418 retval.value = new BinaryExpression(type, retval.value, right != null ? right.value : null); 419 } 420 break; 421 422 default: 423 goto loop3; 424 } 425 } 426 while (true); 427 428 loop3: 429 ; // Stops C# compiler whining that label 'loop3' has no statements 430 } 431 432 retval.Stop = input.LT(-1); 433 434 retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0); 435 adaptor.SetTokenBoundaries(retval.Tree, (IToken)retval.Start, (IToken)retval.Stop); 436 } 437 catch (RecognitionException re) 438 { 439 ReportError(re); 440 Recover(input, re); 441 // Conversion of the second argument necessary, but harmless 442 retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken)retval.Start, input.LT(-1), re); 443 } 444 finally { } 445 return retval; 446 } 447 448 // $ANTLR start "bitwiseOrExpression" 449 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:105:1: bitwiseOrExpression returns [LogicalExpression value] : left= bitwiseXOrExpression ( '|' right= bitwiseOrExpression )* ; 450 public bitwiseOrExpression_return bitwiseOrExpression() // throws RecognitionException [1] 451 { 452 var retval = new bitwiseOrExpression_return(); 453 retval.Start = input.LT(1); 454 455 CommonTree root_0 = null; 456 457 IToken char_literal7 = null; 458 bitwiseXOrExpression_return left = null; 459 460 bitwiseOrExpression_return right = null; 461 462 CommonTree char_literal7_tree = null; 463 464 var type = BinaryExpressionType.Unknown; 465 466 try 467 { 468 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:109:2: (left= bitwiseXOrExpression ( '|' right= bitwiseOrExpression )* ) 469 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:109:4: left= bitwiseXOrExpression ( '|' right= bitwiseOrExpression )* 470 { 471 root_0 = (CommonTree)adaptor.GetNilNode(); 472 473 PushFollow(FOLLOW_bitwiseXOrExpression_in_bitwiseOrExpression237); 474 left = bitwiseXOrExpression(); 475 state.followingStackPointer--; 476 477 adaptor.AddChild(root_0, left.Tree); 478 retval.value = left != null ? left.value : null; 479 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:109:56: ( '|' right= bitwiseOrExpression )* 480 do 481 { 482 var alt4 = 2; 483 var LA4_0 = input.LA(1); 484 485 if (LA4_0 == 25) 486 { 487 alt4 = 1; 488 } 489 490 switch (alt4) 491 { 492 case 1: 493 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:110:4: '|' right= bitwiseOrExpression 494 { 495 char_literal7 = (IToken)Match(input, 25, FOLLOW_25_in_bitwiseOrExpression246); 496 char_literal7_tree = (CommonTree)adaptor.Create(char_literal7); 497 adaptor.AddChild(root_0, char_literal7_tree); 498 499 type = BinaryExpressionType.BitwiseOr; 500 PushFollow(FOLLOW_bitwiseOrExpression_in_bitwiseOrExpression256); 501 right = bitwiseOrExpression(); 502 state.followingStackPointer--; 503 504 adaptor.AddChild(root_0, right.Tree); 505 retval.value = new BinaryExpression(type, retval.value, right != null ? right.value : null); 506 } 507 break; 508 509 default: 510 goto loop4; 511 } 512 } 513 while (true); 514 515 loop4: 516 ; // Stops C# compiler whining that label 'loop4' has no statements 517 } 518 519 retval.Stop = input.LT(-1); 520 521 retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0); 522 adaptor.SetTokenBoundaries(retval.Tree, (IToken)retval.Start, (IToken)retval.Stop); 523 } 524 catch (RecognitionException re) 525 { 526 ReportError(re); 527 Recover(input, re); 528 // Conversion of the second argument necessary, but harmless 529 retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken)retval.Start, input.LT(-1), re); 530 } 531 finally { } 532 return retval; 533 } 534 535 // $ANTLR start "bitwiseXOrExpression" 536 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:115:1: bitwiseXOrExpression returns [LogicalExpression value] : left= bitwiseAndExpression ( '^' right= bitwiseAndExpression )* ; 537 public bitwiseXOrExpression_return bitwiseXOrExpression() // throws RecognitionException [1] 538 { 539 var retval = new bitwiseXOrExpression_return(); 540 retval.Start = input.LT(1); 541 542 CommonTree root_0 = null; 543 544 IToken char_literal8 = null; 545 bitwiseAndExpression_return left = null; 546 547 bitwiseAndExpression_return right = null; 548 549 CommonTree char_literal8_tree = null; 550 551 var type = BinaryExpressionType.Unknown; 552 553 try 554 { 555 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:119:2: (left= bitwiseAndExpression ( '^' right= bitwiseAndExpression )* ) 556 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:119:4: left= bitwiseAndExpression ( '^' right= bitwiseAndExpression )* 557 { 558 root_0 = (CommonTree)adaptor.GetNilNode(); 559 560 PushFollow(FOLLOW_bitwiseAndExpression_in_bitwiseXOrExpression290); 561 left = bitwiseAndExpression(); 562 state.followingStackPointer--; 563 564 adaptor.AddChild(root_0, left.Tree); 565 retval.value = left != null ? left.value : null; 566 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:119:56: ( '^' right= bitwiseAndExpression )* 567 do 568 { 569 var alt5 = 2; 570 var LA5_0 = input.LA(1); 571 572 if (LA5_0 == 26) 573 { 574 alt5 = 1; 575 } 576 577 switch (alt5) 578 { 579 case 1: 580 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:120:4: '^' right= bitwiseAndExpression 581 { 582 char_literal8 = (IToken)Match(input, 26, FOLLOW_26_in_bitwiseXOrExpression299); 583 char_literal8_tree = (CommonTree)adaptor.Create(char_literal8); 584 adaptor.AddChild(root_0, char_literal8_tree); 585 586 type = BinaryExpressionType.BitwiseXOr; 587 PushFollow(FOLLOW_bitwiseAndExpression_in_bitwiseXOrExpression309); 588 right = bitwiseAndExpression(); 589 state.followingStackPointer--; 590 591 adaptor.AddChild(root_0, right.Tree); 592 retval.value = new BinaryExpression(type, retval.value, right != null ? right.value : null); 593 } 594 break; 595 596 default: 597 goto loop5; 598 } 599 } 600 while (true); 601 602 loop5: 603 ; // Stops C# compiler whining that label 'loop5' has no statements 604 } 605 606 retval.Stop = input.LT(-1); 607 608 retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0); 609 adaptor.SetTokenBoundaries(retval.Tree, (IToken)retval.Start, (IToken)retval.Stop); 610 } 611 catch (RecognitionException re) 612 { 613 ReportError(re); 614 Recover(input, re); 615 // Conversion of the second argument necessary, but harmless 616 retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken)retval.Start, input.LT(-1), re); 617 } 618 finally { } 619 return retval; 620 } 621 622 // $ANTLR start "bitwiseAndExpression" 623 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:125:1: bitwiseAndExpression returns [LogicalExpression value] : left= equalityExpression ( '&' right= equalityExpression )* ; 624 public bitwiseAndExpression_return bitwiseAndExpression() // throws RecognitionException [1] 625 { 626 var retval = new bitwiseAndExpression_return(); 627 retval.Start = input.LT(1); 628 629 CommonTree root_0 = null; 630 631 IToken char_literal9 = null; 632 equalityExpression_return left = null; 633 634 equalityExpression_return right = null; 635 636 CommonTree char_literal9_tree = null; 637 638 var type = BinaryExpressionType.Unknown; 639 640 try 641 { 642 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:129:2: (left= equalityExpression ( '&' right= equalityExpression )* ) 643 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:129:4: left= equalityExpression ( '&' right= equalityExpression )* 644 { 645 root_0 = (CommonTree)adaptor.GetNilNode(); 646 647 PushFollow(FOLLOW_equalityExpression_in_bitwiseAndExpression341); 648 left = equalityExpression(); 649 state.followingStackPointer--; 650 651 adaptor.AddChild(root_0, left.Tree); 652 retval.value = left != null ? left.value : null; 653 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:129:54: ( '&' right= equalityExpression )* 654 do 655 { 656 var alt6 = 2; 657 var LA6_0 = input.LA(1); 658 659 if (LA6_0 == 27) 660 { 661 alt6 = 1; 662 } 663 664 switch (alt6) 665 { 666 case 1: 667 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:130:4: '&' right= equalityExpression 668 { 669 char_literal9 = (IToken)Match(input, 27, FOLLOW_27_in_bitwiseAndExpression350); 670 char_literal9_tree = (CommonTree)adaptor.Create(char_literal9); 671 adaptor.AddChild(root_0, char_literal9_tree); 672 673 type = BinaryExpressionType.BitwiseAnd; 674 PushFollow(FOLLOW_equalityExpression_in_bitwiseAndExpression360); 675 right = equalityExpression(); 676 state.followingStackPointer--; 677 678 adaptor.AddChild(root_0, right.Tree); 679 retval.value = new BinaryExpression(type, retval.value, right != null ? right.value : null); 680 } 681 break; 682 683 default: 684 goto loop6; 685 } 686 } 687 while (true); 688 689 loop6: 690 ; // Stops C# compiler whining that label 'loop6' has no statements 691 } 692 693 retval.Stop = input.LT(-1); 694 695 retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0); 696 adaptor.SetTokenBoundaries(retval.Tree, (IToken)retval.Start, (IToken)retval.Stop); 697 } 698 catch (RecognitionException re) 699 { 700 ReportError(re); 701 Recover(input, re); 702 // Conversion of the second argument necessary, but harmless 703 retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken)retval.Start, input.LT(-1), re); 704 } 705 finally { } 706 return retval; 707 } 708 709 // $ANTLR start "equalityExpression" 710 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:135:1: equalityExpression returns [LogicalExpression value] : left= relationalExpression ( ( ( '==' | '=' ) | ( '!=' | '<>' ) ) right= relationalExpression )* ; 711 public equalityExpression_return equalityExpression() // throws RecognitionException [1] 712 { 713 var retval = new equalityExpression_return(); 714 retval.Start = input.LT(1); 715 716 CommonTree root_0 = null; 717 718 IToken set10 = null; 719 IToken set11 = null; 720 relationalExpression_return left = null; 721 722 relationalExpression_return right = null; 723 724 CommonTree set10_tree = null; 725 CommonTree set11_tree = null; 726 727 var type = BinaryExpressionType.Unknown; 728 729 try 730 { 731 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:139:2: (left= relationalExpression ( ( ( '==' | '=' ) | ( '!=' | '<>' ) ) right= relationalExpression )* ) 732 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:139:4: left= relationalExpression ( ( ( '==' | '=' ) | ( '!=' | '<>' ) ) right= relationalExpression )* 733 { 734 root_0 = (CommonTree)adaptor.GetNilNode(); 735 736 PushFollow(FOLLOW_relationalExpression_in_equalityExpression394); 737 left = relationalExpression(); 738 state.followingStackPointer--; 739 740 adaptor.AddChild(root_0, left.Tree); 741 retval.value = left != null ? left.value : null; 742 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:139:56: ( ( ( '==' | '=' ) | ( '!=' | '<>' ) ) right= relationalExpression )* 743 do 744 { 745 var alt8 = 2; 746 var LA8_0 = input.LA(1); 747 748 if (LA8_0 >= 28 && LA8_0 <= 31) 749 { 750 alt8 = 1; 751 } 752 753 switch (alt8) 754 { 755 case 1: 756 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:140:4: ( ( '==' | '=' ) | ( '!=' | '<>' ) ) right= relationalExpression 757 { 758 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:140:4: ( ( '==' | '=' ) | ( '!=' | '<>' ) ) 759 var alt7 = 2; 760 var LA7_0 = input.LA(1); 761 762 if (LA7_0 >= 28 && LA7_0 <= 29) 763 { 764 alt7 = 1; 765 } 766 else if (LA7_0 >= 30 && LA7_0 <= 31) 767 { 768 alt7 = 2; 769 } 770 else 771 { 772 var nvae_d7s0 = 773 new NoViableAltException("", 7, 0, input); 774 775 throw nvae_d7s0; 776 } 777 switch (alt7) 778 { 779 case 1: 780 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:140:6: ( '==' | '=' ) 781 { 782 set10 = (IToken)input.LT(1); 783 if (input.LA(1) >= 28 && input.LA(1) <= 29) 784 { 785 input.Consume(); 786 adaptor.AddChild(root_0, (CommonTree)adaptor.Create(set10)); 787 state.errorRecovery = false; 788 } 789 else 790 { 791 var mse = new MismatchedSetException(null, input); 792 throw mse; 793 } 794 795 type = BinaryExpressionType.Equal; 796 } 797 break; 798 case 2: 799 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:141:6: ( '!=' | '<>' ) 800 { 801 set11 = (IToken)input.LT(1); 802 if (input.LA(1) >= 30 && input.LA(1) <= 31) 803 { 804 input.Consume(); 805 adaptor.AddChild(root_0, (CommonTree)adaptor.Create(set11)); 806 state.errorRecovery = false; 807 } 808 else 809 { 810 var mse = new MismatchedSetException(null, input); 811 throw mse; 812 } 813 814 type = BinaryExpressionType.NotEqual; 815 } 816 break; 817 } 818 819 PushFollow(FOLLOW_relationalExpression_in_equalityExpression441); 820 right = relationalExpression(); 821 state.followingStackPointer--; 822 823 adaptor.AddChild(root_0, right.Tree); 824 retval.value = new BinaryExpression(type, retval.value, right != null ? right.value : null); 825 } 826 break; 827 828 default: 829 goto loop8; 830 } 831 } 832 while (true); 833 834 loop8: 835 ; // Stops C# compiler whining that label 'loop8' has no statements 836 } 837 838 retval.Stop = input.LT(-1); 839 840 retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0); 841 adaptor.SetTokenBoundaries(retval.Tree, (IToken)retval.Start, (IToken)retval.Stop); 842 } 843 catch (RecognitionException re) 844 { 845 ReportError(re); 846 Recover(input, re); 847 // Conversion of the second argument necessary, but harmless 848 retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken)retval.Start, input.LT(-1), re); 849 } 850 finally { } 851 return retval; 852 } 853 854 // $ANTLR start "relationalExpression" 855 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:146:1: relationalExpression returns [LogicalExpression value] : left= shiftExpression ( ( '<' | '<=' | '>' | '>=' ) right= shiftExpression )* ; 856 public relationalExpression_return relationalExpression() // throws RecognitionException [1] 857 { 858 var retval = new relationalExpression_return(); 859 retval.Start = input.LT(1); 860 861 CommonTree root_0 = null; 862 863 IToken char_literal12 = null; 864 IToken string_literal13 = null; 865 IToken char_literal14 = null; 866 IToken string_literal15 = null; 867 shiftExpression_return left = null; 868 869 shiftExpression_return right = null; 870 871 CommonTree char_literal12_tree = null; 872 CommonTree string_literal13_tree = null; 873 CommonTree char_literal14_tree = null; 874 CommonTree string_literal15_tree = null; 875 876 var type = BinaryExpressionType.Unknown; 877 878 try 879 { 880 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:150:2: (left= shiftExpression ( ( '<' | '<=' | '>' | '>=' ) right= shiftExpression )* ) 881 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:150:4: left= shiftExpression ( ( '<' | '<=' | '>' | '>=' ) right= shiftExpression )* 882 { 883 root_0 = (CommonTree)adaptor.GetNilNode(); 884 885 PushFollow(FOLLOW_shiftExpression_in_relationalExpression474); 886 left = shiftExpression(); 887 state.followingStackPointer--; 888 889 adaptor.AddChild(root_0, left.Tree); 890 retval.value = left != null ? left.value : null; 891 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:150:51: ( ( '<' | '<=' | '>' | '>=' ) right= shiftExpression )* 892 do 893 { 894 var alt10 = 2; 895 var LA10_0 = input.LA(1); 896 897 if (LA10_0 >= 32 && LA10_0 <= 35) 898 { 899 alt10 = 1; 900 } 901 902 switch (alt10) 903 { 904 case 1: 905 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:151:4: ( '<' | '<=' | '>' | '>=' ) right= shiftExpression 906 { 907 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:151:4: ( '<' | '<=' | '>' | '>=' ) 908 var alt9 = 4; 909 switch (input.LA(1)) 910 { 911 case 32: 912 { 913 alt9 = 1; 914 } 915 break; 916 case 33: 917 { 918 alt9 = 2; 919 } 920 break; 921 case 34: 922 { 923 alt9 = 3; 924 } 925 break; 926 case 35: 927 { 928 alt9 = 4; 929 } 930 break; 931 default: 932 var nvae_d9s0 = 933 new NoViableAltException("", 9, 0, input); 934 935 throw nvae_d9s0; 936 } 937 938 switch (alt9) 939 { 940 case 1: 941 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:151:6: '<' 942 { 943 char_literal12 = (IToken)Match(input, 32, FOLLOW_32_in_relationalExpression485); 944 char_literal12_tree = (CommonTree)adaptor.Create(char_literal12); 945 adaptor.AddChild(root_0, char_literal12_tree); 946 947 type = BinaryExpressionType.Lesser; 948 } 949 break; 950 case 2: 951 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:152:6: '<=' 952 { 953 string_literal13 = (IToken)Match(input, 33, FOLLOW_33_in_relationalExpression495); 954 string_literal13_tree = (CommonTree)adaptor.Create(string_literal13); 955 adaptor.AddChild(root_0, string_literal13_tree); 956 957 type = BinaryExpressionType.LesserOrEqual; 958 } 959 break; 960 case 3: 961 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:153:6: '>' 962 { 963 char_literal14 = (IToken)Match(input, 34, FOLLOW_34_in_relationalExpression506); 964 char_literal14_tree = (CommonTree)adaptor.Create(char_literal14); 965 adaptor.AddChild(root_0, char_literal14_tree); 966 967 type = BinaryExpressionType.Greater; 968 } 969 break; 970 case 4: 971 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:154:6: '>=' 972 { 973 string_literal15 = (IToken)Match(input, 35, FOLLOW_35_in_relationalExpression516); 974 string_literal15_tree = (CommonTree)adaptor.Create(string_literal15); 975 adaptor.AddChild(root_0, string_literal15_tree); 976 977 type = BinaryExpressionType.GreaterOrEqual; 978 } 979 break; 980 } 981 982 PushFollow(FOLLOW_shiftExpression_in_relationalExpression528); 983 right = shiftExpression(); 984 state.followingStackPointer--; 985 986 adaptor.AddChild(root_0, right.Tree); 987 retval.value = new BinaryExpression(type, retval.value, right != null ? right.value : null); 988 } 989 break; 990 991 default: 992 goto loop10; 993 } 994 } 995 while (true); 996 997 loop10: 998 ; // Stops C# compiler whining that label 'loop10' has no statements 999 } 1000 1001 retval.Stop = input.LT(-1); 1002 1003 retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0); 1004 adaptor.SetTokenBoundaries(retval.Tree, (IToken)retval.Start, (IToken)retval.Stop); 1005 } 1006 catch (RecognitionException re) 1007 { 1008 ReportError(re); 1009 Recover(input, re); 1010 // Conversion of the second argument necessary, but harmless 1011 retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken)retval.Start, input.LT(-1), re); 1012 } 1013 finally { } 1014 return retval; 1015 } 1016 1017 // $ANTLR start "shiftExpression" 1018 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:159:1: shiftExpression returns [LogicalExpression value] : left= additiveExpression ( ( '<<' | '>>' ) right= additiveExpression )* ; 1019 public shiftExpression_return shiftExpression() // throws RecognitionException [1] 1020 { 1021 var retval = new shiftExpression_return(); 1022 retval.Start = input.LT(1); 1023 1024 CommonTree root_0 = null; 1025 1026 IToken string_literal16 = null; 1027 IToken string_literal17 = null; 1028 additiveExpression_return left = null; 1029 1030 additiveExpression_return right = null; 1031 1032 CommonTree string_literal16_tree = null; 1033 CommonTree string_literal17_tree = null; 1034 1035 var type = BinaryExpressionType.Unknown; 1036 1037 try 1038 { 1039 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:163:2: (left= additiveExpression ( ( '<<' | '>>' ) right= additiveExpression )* ) 1040 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:163:4: left= additiveExpression ( ( '<<' | '>>' ) right= additiveExpression )* 1041 { 1042 root_0 = (CommonTree)adaptor.GetNilNode(); 1043 1044 PushFollow(FOLLOW_additiveExpression_in_shiftExpression560); 1045 left = additiveExpression(); 1046 state.followingStackPointer--; 1047 1048 adaptor.AddChild(root_0, left.Tree); 1049 retval.value = left != null ? left.value : null; 1050 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:163:54: ( ( '<<' | '>>' ) right= additiveExpression )* 1051 do 1052 { 1053 var alt12 = 2; 1054 var LA12_0 = input.LA(1); 1055 1056 if (LA12_0 >= 36 && LA12_0 <= 37) 1057 { 1058 alt12 = 1; 1059 } 1060 1061 switch (alt12) 1062 { 1063 case 1: 1064 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:164:4: ( '<<' | '>>' ) right= additiveExpression 1065 { 1066 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:164:4: ( '<<' | '>>' ) 1067 var alt11 = 2; 1068 var LA11_0 = input.LA(1); 1069 1070 if (LA11_0 == 36) 1071 { 1072 alt11 = 1; 1073 } 1074 else if (LA11_0 == 37) 1075 { 1076 alt11 = 2; 1077 } 1078 else 1079 { 1080 var nvae_d11s0 = 1081 new NoViableAltException("", 11, 0, input); 1082 1083 throw nvae_d11s0; 1084 } 1085 switch (alt11) 1086 { 1087 case 1: 1088 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:164:6: '<<' 1089 { 1090 string_literal16 = (IToken)Match(input, 36, FOLLOW_36_in_shiftExpression571); 1091 string_literal16_tree = (CommonTree)adaptor.Create(string_literal16); 1092 adaptor.AddChild(root_0, string_literal16_tree); 1093 1094 type = BinaryExpressionType.LeftShift; 1095 } 1096 break; 1097 case 2: 1098 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:165:6: '>>' 1099 { 1100 string_literal17 = (IToken)Match(input, 37, FOLLOW_37_in_shiftExpression581); 1101 string_literal17_tree = (CommonTree)adaptor.Create(string_literal17); 1102 adaptor.AddChild(root_0, string_literal17_tree); 1103 1104 type = BinaryExpressionType.RightShift; 1105 } 1106 break; 1107 } 1108 1109 PushFollow(FOLLOW_additiveExpression_in_shiftExpression593); 1110 right = additiveExpression(); 1111 state.followingStackPointer--; 1112 1113 adaptor.AddChild(root_0, right.Tree); 1114 retval.value = new BinaryExpression(type, retval.value, right != null ? right.value : null); 1115 } 1116 break; 1117 1118 default: 1119 goto loop12; 1120 } 1121 } 1122 while (true); 1123 1124 loop12: 1125 ; // Stops C# compiler whining that label 'loop12' has no statements 1126 } 1127 1128 retval.Stop = input.LT(-1); 1129 1130 retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0); 1131 adaptor.SetTokenBoundaries(retval.Tree, (IToken)retval.Start, (IToken)retval.Stop); 1132 } 1133 catch (RecognitionException re) 1134 { 1135 ReportError(re); 1136 Recover(input, re); 1137 // Conversion of the second argument necessary, but harmless 1138 retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken)retval.Start, input.LT(-1), re); 1139 } 1140 finally { } 1141 return retval; 1142 } 1143 1144 // $ANTLR start "additiveExpression" 1145 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:170:1: additiveExpression returns [LogicalExpression value] : left= multiplicativeExpression ( ( '+' | '-' ) right= multiplicativeExpression )* ; 1146 public additiveExpression_return additiveExpression() // throws RecognitionException [1] 1147 { 1148 var retval = new additiveExpression_return(); 1149 retval.Start = input.LT(1); 1150 1151 CommonTree root_0 = null; 1152 1153 IToken char_literal18 = null; 1154 IToken char_literal19 = null; 1155 multiplicativeExpression_return left = null; 1156 1157 multiplicativeExpression_return right = null; 1158 1159 CommonTree char_literal18_tree = null; 1160 CommonTree char_literal19_tree = null; 1161 1162 var type = BinaryExpressionType.Unknown; 1163 1164 try 1165 { 1166 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:174:2: (left= multiplicativeExpression ( ( '+' | '-' ) right= multiplicativeExpression )* ) 1167 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:174:4: left= multiplicativeExpression ( ( '+' | '-' ) right= multiplicativeExpression )* 1168 { 1169 root_0 = (CommonTree)adaptor.GetNilNode(); 1170 1171 PushFollow(FOLLOW_multiplicativeExpression_in_additiveExpression625); 1172 left = multiplicativeExpression(); 1173 state.followingStackPointer--; 1174 1175 adaptor.AddChild(root_0, left.Tree); 1176 retval.value = left != null ? left.value : null; 1177 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:174:60: ( ( '+' | '-' ) right= multiplicativeExpression )* 1178 do 1179 { 1180 var alt14 = 2; 1181 var LA14_0 = input.LA(1); 1182 1183 if (LA14_0 >= 38 && LA14_0 <= 39) 1184 { 1185 alt14 = 1; 1186 } 1187 1188 switch (alt14) 1189 { 1190 case 1: 1191 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:175:4: ( '+' | '-' ) right= multiplicativeExpression 1192 { 1193 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:175:4: ( '+' | '-' ) 1194 var alt13 = 2; 1195 var LA13_0 = input.LA(1); 1196 1197 if (LA13_0 == 38) 1198 { 1199 alt13 = 1; 1200 } 1201 else if (LA13_0 == 39) 1202 { 1203 alt13 = 2; 1204 } 1205 else 1206 { 1207 var nvae_d13s0 = 1208 new NoViableAltException("", 13, 0, input); 1209 1210 throw nvae_d13s0; 1211 } 1212 switch (alt13) 1213 { 1214 case 1: 1215 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:175:6: '+' 1216 { 1217 char_literal18 = (IToken)Match(input, 38, FOLLOW_38_in_additiveExpression636); 1218 char_literal18_tree = (CommonTree)adaptor.Create(char_literal18); 1219 adaptor.AddChild(root_0, char_literal18_tree); 1220 1221 type = BinaryExpressionType.Plus; 1222 } 1223 break; 1224 case 2: 1225 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:176:6: '-' 1226 { 1227 char_literal19 = (IToken)Match(input, 39, FOLLOW_39_in_additiveExpression646); 1228 char_literal19_tree = (CommonTree)adaptor.Create(char_literal19); 1229 adaptor.AddChild(root_0, char_literal19_tree); 1230 1231 type = BinaryExpressionType.Minus; 1232 } 1233 break; 1234 } 1235 1236 PushFollow(FOLLOW_multiplicativeExpression_in_additiveExpression658); 1237 right = multiplicativeExpression(); 1238 state.followingStackPointer--; 1239 1240 adaptor.AddChild(root_0, right.Tree); 1241 retval.value = new BinaryExpression(type, retval.value, right != null ? right.value : null); 1242 } 1243 break; 1244 1245 default: 1246 goto loop14; 1247 } 1248 } 1249 while (true); 1250 1251 loop14: 1252 ; // Stops C# compiler whining that label 'loop14' has no statements 1253 } 1254 1255 retval.Stop = input.LT(-1); 1256 1257 retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0); 1258 adaptor.SetTokenBoundaries(retval.Tree, (IToken)retval.Start, (IToken)retval.Stop); 1259 } 1260 catch (RecognitionException re) 1261 { 1262 ReportError(re); 1263 Recover(input, re); 1264 // Conversion of the second argument necessary, but harmless 1265 retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken)retval.Start, input.LT(-1), re); 1266 } 1267 finally { } 1268 return retval; 1269 } 1270 1271 // $ANTLR start "multiplicativeExpression" 1272 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:181:1: multiplicativeExpression returns [LogicalExpression value] : left= unaryExpression ( ( '*' | '/' | '%' ) right= unaryExpression )* ; 1273 public multiplicativeExpression_return multiplicativeExpression() // throws RecognitionException [1] 1274 { 1275 var retval = new multiplicativeExpression_return(); 1276 retval.Start = input.LT(1); 1277 1278 CommonTree root_0 = null; 1279 1280 IToken char_literal20 = null; 1281 IToken char_literal21 = null; 1282 IToken char_literal22 = null; 1283 unaryExpression_return left = null; 1284 1285 unaryExpression_return right = null; 1286 1287 CommonTree char_literal20_tree = null; 1288 CommonTree char_literal21_tree = null; 1289 CommonTree char_literal22_tree = null; 1290 1291 var type = BinaryExpressionType.Unknown; 1292 1293 try 1294 { 1295 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:185:2: (left= unaryExpression ( ( '*' | '/' | '%' ) right= unaryExpression )* ) 1296 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:185:4: left= unaryExpression ( ( '*' | '/' | '%' ) right= unaryExpression )* 1297 { 1298 root_0 = (CommonTree)adaptor.GetNilNode(); 1299 1300 PushFollow(FOLLOW_unaryExpression_in_multiplicativeExpression690); 1301 left = unaryExpression(); 1302 state.followingStackPointer--; 1303 1304 adaptor.AddChild(root_0, left.Tree); 1305 retval.value = left != null ? left.value : null; 1306 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:185:52: ( ( '*' | '/' | '%' ) right= unaryExpression )* 1307 do 1308 { 1309 var alt16 = 2; 1310 var LA16_0 = input.LA(1); 1311 1312 if (LA16_0 >= 40 && LA16_0 <= 42) 1313 { 1314 alt16 = 1; 1315 } 1316 1317 switch (alt16) 1318 { 1319 case 1: 1320 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:186:4: ( '*' | '/' | '%' ) right= unaryExpression 1321 { 1322 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:186:4: ( '*' | '/' | '%' ) 1323 var alt15 = 3; 1324 switch (input.LA(1)) 1325 { 1326 case 40: 1327 { 1328 alt15 = 1; 1329 } 1330 break; 1331 case 41: 1332 { 1333 alt15 = 2; 1334 } 1335 break; 1336 case 42: 1337 { 1338 alt15 = 3; 1339 } 1340 break; 1341 default: 1342 var nvae_d15s0 = 1343 new NoViableAltException("", 15, 0, input); 1344 1345 throw nvae_d15s0; 1346 } 1347 1348 switch (alt15) 1349 { 1350 case 1: 1351 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:186:6: '*' 1352 { 1353 char_literal20 = (IToken)Match(input, 40, FOLLOW_40_in_multiplicativeExpression701); 1354 char_literal20_tree = (CommonTree)adaptor.Create(char_literal20); 1355 adaptor.AddChild(root_0, char_literal20_tree); 1356 1357 type = BinaryExpressionType.Times; 1358 } 1359 break; 1360 case 2: 1361 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:187:6: '/' 1362 { 1363 char_literal21 = (IToken)Match(input, 41, FOLLOW_41_in_multiplicativeExpression711); 1364 char_literal21_tree = (CommonTree)adaptor.Create(char_literal21); 1365 adaptor.AddChild(root_0, char_literal21_tree); 1366 1367 type = BinaryExpressionType.Div; 1368 } 1369 break; 1370 case 3: 1371 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:188:6: '%' 1372 { 1373 char_literal22 = (IToken)Match(input, 42, FOLLOW_42_in_multiplicativeExpression721); 1374 char_literal22_tree = (CommonTree)adaptor.Create(char_literal22); 1375 adaptor.AddChild(root_0, char_literal22_tree); 1376 1377 type = BinaryExpressionType.Modulo; 1378 } 1379 break; 1380 } 1381 1382 PushFollow(FOLLOW_unaryExpression_in_multiplicativeExpression733); 1383 right = unaryExpression(); 1384 state.followingStackPointer--; 1385 1386 adaptor.AddChild(root_0, right.Tree); 1387 retval.value = new BinaryExpression(type, retval.value, right != null ? right.value : null); 1388 } 1389 break; 1390 1391 default: 1392 goto loop16; 1393 } 1394 } 1395 while (true); 1396 1397 loop16: 1398 ; // Stops C# compiler whining that label 'loop16' has no statements 1399 } 1400 1401 retval.Stop = input.LT(-1); 1402 1403 retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0); 1404 adaptor.SetTokenBoundaries(retval.Tree, (IToken)retval.Start, (IToken)retval.Stop); 1405 } 1406 catch (RecognitionException re) 1407 { 1408 ReportError(re); 1409 Recover(input, re); 1410 // Conversion of the second argument necessary, but harmless 1411 retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken)retval.Start, input.LT(-1), re); 1412 } 1413 finally { } 1414 return retval; 1415 } 1416 1417 // $ANTLR start "unaryExpression" 1418 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:194:1: unaryExpression returns [LogicalExpression value] : ( primaryExpression | ( '!' | 'not' ) primaryExpression | ( '~' ) primaryExpression | '-' primaryExpression ); 1419 public unaryExpression_return unaryExpression() // throws RecognitionException [1] 1420 { 1421 var retval = new unaryExpression_return(); 1422 retval.Start = input.LT(1); 1423 1424 CommonTree root_0 = null; 1425 1426 IToken set24 = null; 1427 IToken char_literal26 = null; 1428 IToken char_literal28 = null; 1429 primaryExpression_return primaryExpression23 = null; 1430 1431 primaryExpression_return primaryExpression25 = null; 1432 1433 primaryExpression_return primaryExpression27 = null; 1434 1435 primaryExpression_return primaryExpression29 = null; 1436 1437 CommonTree set24_tree = null; 1438 CommonTree char_literal26_tree = null; 1439 CommonTree char_literal28_tree = null; 1440 1441 try 1442 { 1443 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:195:2: ( primaryExpression | ( '!' | 'not' ) primaryExpression | ( '~' ) primaryExpression | '-' primaryExpression ) 1444 var alt17 = 4; 1445 switch (input.LA(1)) 1446 { 1447 case INTEGER: 1448 case FLOAT: 1449 case STRING: 1450 case DATETIME: 1451 case TRUE: 1452 case FALSE: 1453 case ID: 1454 case NAME: 1455 case 46: 1456 { 1457 alt17 = 1; 1458 } 1459 break; 1460 case 43: 1461 case 44: 1462 { 1463 alt17 = 2; 1464 } 1465 break; 1466 case 45: 1467 { 1468 alt17 = 3; 1469 } 1470 break; 1471 case 39: 1472 { 1473 alt17 = 4; 1474 } 1475 break; 1476 default: 1477 var nvae_d17s0 = 1478 new NoViableAltException("", 17, 0, input); 1479 1480 throw nvae_d17s0; 1481 } 1482 1483 switch (alt17) 1484 { 1485 case 1: 1486 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:195:4: primaryExpression 1487 { 1488 root_0 = (CommonTree)adaptor.GetNilNode(); 1489 1490 PushFollow(FOLLOW_primaryExpression_in_unaryExpression760); 1491 primaryExpression23 = primaryExpression(); 1492 state.followingStackPointer--; 1493 1494 adaptor.AddChild(root_0, primaryExpression23.Tree); 1495 retval.value = primaryExpression23 != null ? primaryExpression23.value : null; 1496 } 1497 break; 1498 case 2: 1499 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:196:8: ( '!' | 'not' ) primaryExpression 1500 { 1501 root_0 = (CommonTree)adaptor.GetNilNode(); 1502 1503 set24 = (IToken)input.LT(1); 1504 if (input.LA(1) >= 43 && input.LA(1) <= 44) 1505 { 1506 input.Consume(); 1507 adaptor.AddChild(root_0, (CommonTree)adaptor.Create(set24)); 1508 state.errorRecovery = false; 1509 } 1510 else 1511 { 1512 var mse = new MismatchedSetException(null, input); 1513 throw mse; 1514 } 1515 1516 PushFollow(FOLLOW_primaryExpression_in_unaryExpression779); 1517 primaryExpression25 = primaryExpression(); 1518 state.followingStackPointer--; 1519 1520 adaptor.AddChild(root_0, primaryExpression25.Tree); 1521 retval.value = new UnaryExpression(UnaryExpressionType.Not, primaryExpression25 != null ? primaryExpression25.value : null); 1522 } 1523 break; 1524 case 3: 1525 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:197:8: ( '~' ) primaryExpression 1526 { 1527 root_0 = (CommonTree)adaptor.GetNilNode(); 1528 1529 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:197:8: ( '~' ) 1530 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:197:9: '~' 1531 { 1532 char_literal26 = (IToken)Match(input, 45, FOLLOW_45_in_unaryExpression791); 1533 char_literal26_tree = (CommonTree)adaptor.Create(char_literal26); 1534 adaptor.AddChild(root_0, char_literal26_tree); 1535 } 1536 1537 PushFollow(FOLLOW_primaryExpression_in_unaryExpression794); 1538 primaryExpression27 = primaryExpression(); 1539 state.followingStackPointer--; 1540 1541 adaptor.AddChild(root_0, primaryExpression27.Tree); 1542 retval.value = new UnaryExpression(UnaryExpressionType.BitwiseNot, primaryExpression27 != null ? primaryExpression27.value : null); 1543 } 1544 break; 1545 case 4: 1546 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:198:8: '-' primaryExpression 1547 { 1548 root_0 = (CommonTree)adaptor.GetNilNode(); 1549 1550 char_literal28 = (IToken)Match(input, 39, FOLLOW_39_in_unaryExpression805); 1551 char_literal28_tree = (CommonTree)adaptor.Create(char_literal28); 1552 adaptor.AddChild(root_0, char_literal28_tree); 1553 1554 PushFollow(FOLLOW_primaryExpression_in_unaryExpression807); 1555 primaryExpression29 = primaryExpression(); 1556 state.followingStackPointer--; 1557 1558 adaptor.AddChild(root_0, primaryExpression29.Tree); 1559 retval.value = new UnaryExpression(UnaryExpressionType.Negate, primaryExpression29 != null ? primaryExpression29.value : null); 1560 } 1561 break; 1562 } 1563 retval.Stop = input.LT(-1); 1564 1565 retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0); 1566 adaptor.SetTokenBoundaries(retval.Tree, (IToken)retval.Start, (IToken)retval.Stop); 1567 } 1568 catch (RecognitionException re) 1569 { 1570 ReportError(re); 1571 Recover(input, re); 1572 // Conversion of the second argument necessary, but harmless 1573 retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken)retval.Start, input.LT(-1), re); 1574 } 1575 finally { } 1576 return retval; 1577 } 1578 1579 // $ANTLR start "primaryExpression" 1580 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:201:1: primaryExpression returns [LogicalExpression value] : ( '(' logicalExpression ')' | expr= value | identifier ( arguments )? ); 1581 public primaryExpression_return primaryExpression() // throws RecognitionException [1] 1582 { 1583 var retval = new primaryExpression_return(); 1584 retval.Start = input.LT(1); 1585 1586 CommonTree root_0 = null; 1587 1588 IToken char_literal30 = null; 1589 IToken char_literal32 = null; 1590 value_return expr = null; 1591 1592 logicalExpression_return logicalExpression31 = null; 1593 1594 identifier_return identifier33 = null; 1595 1596 arguments_return arguments34 = null; 1597 1598 CommonTree char_literal30_tree = null; 1599 CommonTree char_literal32_tree = null; 1600 1601 try 1602 { 1603 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:202:2: ( '(' logicalExpression ')' | expr= value | identifier ( arguments )? ) 1604 var alt19 = 3; 1605 switch (input.LA(1)) 1606 { 1607 case 46: 1608 { 1609 alt19 = 1; 1610 } 1611 break; 1612 case INTEGER: 1613 case FLOAT: 1614 case STRING: 1615 case DATETIME: 1616 case TRUE: 1617 case FALSE: 1618 { 1619 alt19 = 2; 1620 } 1621 break; 1622 case ID: 1623 case NAME: 1624 { 1625 alt19 = 3; 1626 } 1627 break; 1628 default: 1629 var nvae_d19s0 = 1630 new NoViableAltException("", 19, 0, input); 1631 1632 throw nvae_d19s0; 1633 } 1634 1635 switch (alt19) 1636 { 1637 case 1: 1638 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:202:4: '(' logicalExpression ')' 1639 { 1640 root_0 = (CommonTree)adaptor.GetNilNode(); 1641 1642 char_literal30 = (IToken)Match(input, 46, FOLLOW_46_in_primaryExpression829); 1643 char_literal30_tree = (CommonTree)adaptor.Create(char_literal30); 1644 adaptor.AddChild(root_0, char_literal30_tree); 1645 1646 PushFollow(FOLLOW_logicalExpression_in_primaryExpression831); 1647 logicalExpression31 = logicalExpression(); 1648 state.followingStackPointer--; 1649 1650 adaptor.AddChild(root_0, logicalExpression31.Tree); 1651 char_literal32 = (IToken)Match(input, 47, FOLLOW_47_in_primaryExpression833); 1652 char_literal32_tree = (CommonTree)adaptor.Create(char_literal32); 1653 adaptor.AddChild(root_0, char_literal32_tree); 1654 1655 retval.value = logicalExpression31 != null ? logicalExpression31.value : null; 1656 } 1657 break; 1658 case 2: 1659 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:203:4: expr= value 1660 { 1661 root_0 = (CommonTree)adaptor.GetNilNode(); 1662 1663 PushFollow(FOLLOW_value_in_primaryExpression843); 1664 expr = value(); 1665 state.followingStackPointer--; 1666 1667 adaptor.AddChild(root_0, expr.Tree); 1668 retval.value = expr != null ? expr.value : null; 1669 } 1670 break; 1671 case 3: 1672 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:204:4: identifier ( arguments )? 1673 { 1674 root_0 = (CommonTree)adaptor.GetNilNode(); 1675 1676 PushFollow(FOLLOW_identifier_in_primaryExpression851); 1677 identifier33 = identifier(); 1678 state.followingStackPointer--; 1679 1680 adaptor.AddChild(root_0, identifier33.Tree); 1681 retval.value = (LogicalExpression)(identifier33 != null ? identifier33.value : null); 1682 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:204:66: ( arguments )? 1683 var alt18 = 2; 1684 var LA18_0 = input.LA(1); 1685 1686 if (LA18_0 == 46) 1687 { 1688 alt18 = 1; 1689 } 1690 switch (alt18) 1691 { 1692 case 1: 1693 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:204:67: arguments 1694 { 1695 PushFollow(FOLLOW_arguments_in_primaryExpression856); 1696 arguments34 = arguments(); 1697 state.followingStackPointer--; 1698 1699 adaptor.AddChild(root_0, arguments34.Tree); 1700 retval.value = new FunctionExpression(identifier33 != null ? identifier33.value : null, (arguments34 != null ? arguments34.value : null).ToArray()); 1701 } 1702 break; 1703 } 1704 } 1705 break; 1706 } 1707 retval.Stop = input.LT(-1); 1708 1709 retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0); 1710 adaptor.SetTokenBoundaries(retval.Tree, (IToken)retval.Start, (IToken)retval.Stop); 1711 } 1712 catch (RecognitionException re) 1713 { 1714 ReportError(re); 1715 Recover(input, re); 1716 // Conversion of the second argument necessary, but harmless 1717 retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken)retval.Start, input.LT(-1), re); 1718 } 1719 finally { } 1720 return retval; 1721 } 1722 1723 // $ANTLR start "value" 1724 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:207:1: value returns [ValueExpression value] : ( INTEGER | FLOAT | STRING | DATETIME | TRUE | FALSE ); 1725 public value_return value() // throws RecognitionException [1] 1726 { 1727 var retval = new value_return(); 1728 retval.Start = input.LT(1); 1729 1730 CommonTree root_0 = null; 1731 1732 IToken INTEGER35 = null; 1733 IToken FLOAT36 = null; 1734 IToken STRING37 = null; 1735 IToken DATETIME38 = null; 1736 IToken TRUE39 = null; 1737 IToken FALSE40 = null; 1738 1739 CommonTree INTEGER35_tree = null; 1740 CommonTree FLOAT36_tree = null; 1741 CommonTree STRING37_tree = null; 1742 CommonTree DATETIME38_tree = null; 1743 CommonTree TRUE39_tree = null; 1744 CommonTree FALSE40_tree = null; 1745 1746 try 1747 { 1748 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:208:2: ( INTEGER | FLOAT | STRING | DATETIME | TRUE | FALSE ) 1749 var alt20 = 6; 1750 switch (input.LA(1)) 1751 { 1752 case INTEGER: 1753 { 1754 alt20 = 1; 1755 } 1756 break; 1757 case FLOAT: 1758 { 1759 alt20 = 2; 1760 } 1761 break; 1762 case STRING: 1763 { 1764 alt20 = 3; 1765 } 1766 break; 1767 case DATETIME: 1768 { 1769 alt20 = 4; 1770 } 1771 break; 1772 case TRUE: 1773 { 1774 alt20 = 5; 1775 } 1776 break; 1777 case FALSE: 1778 { 1779 alt20 = 6; 1780 } 1781 break; 1782 default: 1783 var nvae_d20s0 = 1784 new NoViableAltException("", 20, 0, input); 1785 1786 throw nvae_d20s0; 1787 } 1788 1789 switch (alt20) 1790 { 1791 case 1: 1792 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:208:5: INTEGER 1793 { 1794 root_0 = (CommonTree)adaptor.GetNilNode(); 1795 1796 INTEGER35 = (IToken)Match(input, INTEGER, FOLLOW_INTEGER_in_value876); 1797 INTEGER35_tree = (CommonTree)adaptor.Create(INTEGER35); 1798 adaptor.AddChild(root_0, INTEGER35_tree); 1799 1800 try 1801 { 1802 retval.value = new ValueExpression(int.Parse(INTEGER35 != null ? INTEGER35.Text : null)); 1803 } 1804 catch (OverflowException) 1805 { 1806 retval.value = new ValueExpression(long.Parse(INTEGER35 != null ? INTEGER35.Text : null)); 1807 } 1808 } 1809 break; 1810 case 2: 1811 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:209:4: FLOAT 1812 { 1813 root_0 = (CommonTree)adaptor.GetNilNode(); 1814 1815 FLOAT36 = (IToken)Match(input, FLOAT, FOLLOW_FLOAT_in_value884); 1816 FLOAT36_tree = (CommonTree)adaptor.Create(FLOAT36); 1817 adaptor.AddChild(root_0, FLOAT36_tree); 1818 1819 retval.value = new ValueExpression(double.Parse(FLOAT36 != null ? FLOAT36.Text : null, NumberStyles.Float, numberFormatInfo)); 1820 } 1821 break; 1822 case 3: 1823 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:210:4: STRING 1824 { 1825 root_0 = (CommonTree)adaptor.GetNilNode(); 1826 1827 STRING37 = (IToken)Match(input, STRING, FOLLOW_STRING_in_value892); 1828 STRING37_tree = (CommonTree)adaptor.Create(STRING37); 1829 adaptor.AddChild(root_0, STRING37_tree); 1830 1831 retval.value = new ValueExpression(extractString(STRING37 != null ? STRING37.Text : null)); 1832 } 1833 break; 1834 case 4: 1835 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:211:5: DATETIME 1836 { 1837 root_0 = (CommonTree)adaptor.GetNilNode(); 1838 1839 DATETIME38 = (IToken)Match(input, DATETIME, FOLLOW_DATETIME_in_value901); 1840 DATETIME38_tree = (CommonTree)adaptor.Create(DATETIME38); 1841 adaptor.AddChild(root_0, DATETIME38_tree); 1842 1843 retval.value = new ValueExpression(DateTime.Parse((DATETIME38 != null ? DATETIME38.Text : null).Substring(1, (DATETIME38 != null ? DATETIME38.Text : null).Length - 2))); 1844 } 1845 break; 1846 case 5: 1847 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:212:4: TRUE 1848 { 1849 root_0 = (CommonTree)adaptor.GetNilNode(); 1850 1851 TRUE39 = (IToken)Match(input, TRUE, FOLLOW_TRUE_in_value908); 1852 TRUE39_tree = (CommonTree)adaptor.Create(TRUE39); 1853 adaptor.AddChild(root_0, TRUE39_tree); 1854 1855 retval.value = new ValueExpression(true); 1856 } 1857 break; 1858 case 6: 1859 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:213:4: FALSE 1860 { 1861 root_0 = (CommonTree)adaptor.GetNilNode(); 1862 1863 FALSE40 = (IToken)Match(input, FALSE, FOLLOW_FALSE_in_value916); 1864 FALSE40_tree = (CommonTree)adaptor.Create(FALSE40); 1865 adaptor.AddChild(root_0, FALSE40_tree); 1866 1867 retval.value = new ValueExpression(false); 1868 } 1869 break; 1870 } 1871 retval.Stop = input.LT(-1); 1872 1873 retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0); 1874 adaptor.SetTokenBoundaries(retval.Tree, (IToken)retval.Start, (IToken)retval.Stop); 1875 } 1876 catch (RecognitionException re) 1877 { 1878 ReportError(re); 1879 Recover(input, re); 1880 // Conversion of the second argument necessary, but harmless 1881 retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken)retval.Start, input.LT(-1), re); 1882 } 1883 finally { } 1884 return retval; 1885 } 1886 1887 // $ANTLR start "identifier" 1888 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:216:1: identifier returns [Identifier value] : ( ID | NAME ); 1889 public identifier_return identifier() // throws RecognitionException [1] 1890 { 1891 var retval = new identifier_return(); 1892 retval.Start = input.LT(1); 1893 1894 CommonTree root_0 = null; 1895 1896 IToken ID41 = null; 1897 IToken NAME42 = null; 1898 1899 CommonTree ID41_tree = null; 1900 CommonTree NAME42_tree = null; 1901 1902 try 1903 { 1904 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:217:2: ( ID | NAME ) 1905 var alt21 = 2; 1906 var LA21_0 = input.LA(1); 1907 1908 if (LA21_0 == ID) 1909 { 1910 alt21 = 1; 1911 } 1912 else if (LA21_0 == NAME) 1913 { 1914 alt21 = 2; 1915 } 1916 else 1917 { 1918 var nvae_d21s0 = 1919 new NoViableAltException("", 21, 0, input); 1920 1921 throw nvae_d21s0; 1922 } 1923 switch (alt21) 1924 { 1925 case 1: 1926 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:217:5: ID 1927 { 1928 root_0 = (CommonTree)adaptor.GetNilNode(); 1929 1930 ID41 = (IToken)Match(input, ID, FOLLOW_ID_in_identifier934); 1931 ID41_tree = (CommonTree)adaptor.Create(ID41); 1932 adaptor.AddChild(root_0, ID41_tree); 1933 1934 retval.value = new IdentifierExpression(ID41 != null ? ID41.Text : null); 1935 } 1936 break; 1937 case 2: 1938 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:218:5: NAME 1939 { 1940 root_0 = (CommonTree)adaptor.GetNilNode(); 1941 1942 NAME42 = (IToken)Match(input, NAME, FOLLOW_NAME_in_identifier942); 1943 NAME42_tree = (CommonTree)adaptor.Create(NAME42); 1944 adaptor.AddChild(root_0, NAME42_tree); 1945 1946 retval.value = new IdentifierExpression((NAME42 != null ? NAME42.Text : null).Substring(1, (NAME42 != null ? NAME42.Text : null).Length - 2)); 1947 } 1948 break; 1949 } 1950 retval.Stop = input.LT(-1); 1951 1952 retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0); 1953 adaptor.SetTokenBoundaries(retval.Tree, (IToken)retval.Start, (IToken)retval.Stop); 1954 } 1955 catch (RecognitionException re) 1956 { 1957 ReportError(re); 1958 Recover(input, re); 1959 // Conversion of the second argument necessary, but harmless 1960 retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken)retval.Start, input.LT(-1), re); 1961 } 1962 finally { } 1963 return retval; 1964 } 1965 1966 // $ANTLR start "expressionList" 1967 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:221:1: expressionList returns [List<LogicalExpression> value] : first= logicalExpression ( ',' follow= logicalExpression )* ; 1968 public expressionList_return expressionList() // throws RecognitionException [1] 1969 { 1970 var retval = new expressionList_return(); 1971 retval.Start = input.LT(1); 1972 1973 CommonTree root_0 = null; 1974 1975 IToken char_literal43 = null; 1976 logicalExpression_return first = null; 1977 1978 logicalExpression_return follow = null; 1979 1980 CommonTree char_literal43_tree = null; 1981 1982 var expressions = new List<LogicalExpression>(); 1983 1984 try 1985 { 1986 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:225:2: (first= logicalExpression ( ',' follow= logicalExpression )* ) 1987 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:225:4: first= logicalExpression ( ',' follow= logicalExpression )* 1988 { 1989 root_0 = (CommonTree)adaptor.GetNilNode(); 1990 1991 PushFollow(FOLLOW_logicalExpression_in_expressionList966); 1992 first = logicalExpression(); 1993 state.followingStackPointer--; 1994 1995 adaptor.AddChild(root_0, first.Tree); 1996 expressions.Add(first != null ? first.value : null); 1997 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:225:62: ( ',' follow= logicalExpression )* 1998 do 1999 { 2000 var alt22 = 2; 2001 var LA22_0 = input.LA(1); 2002 2003 if (LA22_0 == 48) 2004 { 2005 alt22 = 1; 2006 } 2007 2008 switch (alt22) 2009 { 2010 case 1: 2011 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:225:64: ',' follow= logicalExpression 2012 { 2013 char_literal43 = (IToken)Match(input, 48, FOLLOW_48_in_expressionList973); 2014 char_literal43_tree = (CommonTree)adaptor.Create(char_literal43); 2015 adaptor.AddChild(root_0, char_literal43_tree); 2016 2017 PushFollow(FOLLOW_logicalExpression_in_expressionList977); 2018 follow = logicalExpression(); 2019 state.followingStackPointer--; 2020 2021 adaptor.AddChild(root_0, follow.Tree); 2022 expressions.Add(follow != null ? follow.value : null); 2023 } 2024 break; 2025 2026 default: 2027 goto loop22; 2028 } 2029 } 2030 while (true); 2031 2032 loop22: 2033 ; // Stops C# compiler whining that label 'loop22' has no statements 2034 2035 retval.value = expressions; 2036 } 2037 2038 retval.Stop = input.LT(-1); 2039 2040 retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0); 2041 adaptor.SetTokenBoundaries(retval.Tree, (IToken)retval.Start, (IToken)retval.Stop); 2042 } 2043 catch (RecognitionException re) 2044 { 2045 ReportError(re); 2046 Recover(input, re); 2047 // Conversion of the second argument necessary, but harmless 2048 retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken)retval.Start, input.LT(-1), re); 2049 } 2050 finally { } 2051 return retval; 2052 } 2053 2054 // $ANTLR start "arguments" 2055 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:229:1: arguments returns [List<LogicalExpression> value] : '(' ( expressionList )? ')' ; 2056 public arguments_return arguments() // throws RecognitionException [1] 2057 { 2058 var retval = new arguments_return(); 2059 retval.Start = input.LT(1); 2060 2061 CommonTree root_0 = null; 2062 2063 IToken char_literal44 = null; 2064 IToken char_literal46 = null; 2065 expressionList_return expressionList45 = null; 2066 2067 CommonTree char_literal44_tree = null; 2068 CommonTree char_literal46_tree = null; 2069 2070 retval.value = new List<LogicalExpression>(); 2071 2072 try 2073 { 2074 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:233:2: ( '(' ( expressionList )? ')' ) 2075 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:233:4: '(' ( expressionList )? ')' 2076 { 2077 root_0 = (CommonTree)adaptor.GetNilNode(); 2078 2079 char_literal44 = (IToken)Match(input, 46, FOLLOW_46_in_arguments1006); 2080 char_literal44_tree = (CommonTree)adaptor.Create(char_literal44); 2081 adaptor.AddChild(root_0, char_literal44_tree); 2082 2083 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:233:8: ( expressionList )? 2084 var alt23 = 2; 2085 var LA23_0 = input.LA(1); 2086 2087 if (LA23_0 >= INTEGER && LA23_0 <= NAME || LA23_0 == 39 || LA23_0 >= 43 && LA23_0 <= 46) 2088 { 2089 alt23 = 1; 2090 } 2091 switch (alt23) 2092 { 2093 case 1: 2094 // C:\\Users\\s.ros\\Documents\\D�veloppement\\NCalc\\Grammar\\NCalc.g:233:10: expressionList 2095 { 2096 PushFollow(FOLLOW_expressionList_in_arguments1010); 2097 expressionList45 = expressionList(); 2098 state.followingStackPointer--; 2099 2100 adaptor.AddChild(root_0, expressionList45.Tree); 2101 retval.value = expressionList45 != null ? expressionList45.value : null; 2102 } 2103 break; 2104 } 2105 2106 char_literal46 = (IToken)Match(input, 47, FOLLOW_47_in_arguments1017); 2107 char_literal46_tree = (CommonTree)adaptor.Create(char_literal46); 2108 adaptor.AddChild(root_0, char_literal46_tree); 2109 } 2110 2111 retval.Stop = input.LT(-1); 2112 2113 retval.Tree = (CommonTree)adaptor.RulePostProcessing(root_0); 2114 adaptor.SetTokenBoundaries(retval.Tree, (IToken)retval.Start, (IToken)retval.Stop); 2115 } 2116 catch (RecognitionException re) 2117 { 2118 ReportError(re); 2119 Recover(input, re); 2120 // Conversion of the second argument necessary, but harmless 2121 retval.Tree = (CommonTree)adaptor.ErrorNode(input, (IToken)retval.Start, input.LT(-1), re); 2122 } 2123 finally { } 2124 return retval; 2125 } 2126 2127 public const int T__29 = 29; 2128 public const int T__28 = 28; 2129 public const int T__27 = 27; 2130 public const int T__26 = 26; 2131 public const int T__25 = 25; 2132 public const int T__24 = 24; 2133 public const int T__23 = 23; 2134 public const int LETTER = 12; 2135 public const int T__22 = 22; 2136 public const int T__21 = 21; 2137 public const int T__20 = 20; 2138 public const int FLOAT = 5; 2139 public const int ID = 10; 2140 public const int EOF = -1; 2141 public const int HexDigit = 17; 2142 public const int T__19 = 19; 2143 public const int NAME = 11; 2144 public const int DIGIT = 13; 2145 public const int T__42 = 42; 2146 public const int INTEGER = 4; 2147 public const int E = 14; 2148 public const int T__43 = 43; 2149 public const int T__40 = 40; 2150 public const int T__41 = 41; 2151 public const int T__46 = 46; 2152 public const int T__47 = 47; 2153 public const int T__44 = 44; 2154 public const int T__45 = 45; 2155 public const int T__48 = 48; 2156 public const int DATETIME = 7; 2157 public const int TRUE = 8; 2158 public const int T__30 = 30; 2159 public const int T__31 = 31; 2160 public const int T__32 = 32; 2161 public const int WS = 18; 2162 public const int T__33 = 33; 2163 public const int T__34 = 34; 2164 public const int T__35 = 35; 2165 public const int T__36 = 36; 2166 public const int T__37 = 37; 2167 public const int T__38 = 38; 2168 public const int T__39 = 39; 2169 public const int UnicodeEscape = 16; 2170 public const int FALSE = 9; 2171 public const int EscapeSequence = 15; 2172 public const int STRING = 6; 2173 2174 private const char BS = '\\'; 2175 2176 public static readonly string[] tokenNames = new[] 2177 { 2178 "<invalid>", 2179 "<EOR>", 2180 "<DOWN>", 2181 "<UP>", 2182 "INTEGER", 2183 "FLOAT", 2184 "STRING", 2185 "DATETIME", 2186 "TRUE", 2187 "FALSE", 2188 "ID", 2189 "NAME", 2190 "LETTER", 2191 "DIGIT", 2192 "E", 2193 "EscapeSequence", 2194 "UnicodeEscape", 2195 "HexDigit", 2196 "WS", 2197 "'?'", 2198 "':'", 2199 "'||'", 2200 "'or'", 2201 "'&&'", 2202 "'and'", 2203 "'|'", 2204 "'^'", 2205 "'&'", 2206 "'=='", 2207 "'='", 2208 "'!='", 2209 "'<>'", 2210 "'<'", 2211 "'<='", 2212 "'>'", 2213 "'>='", 2214 "'<<'", 2215 "'>>'", 2216 "'+'", 2217 "'-'", 2218 "'*'", 2219 "'/'", 2220 "'%'", 2221 "'!'", 2222 "'not'", 2223 "'~'", 2224 "'('", 2225 "')'", 2226 "','" 2227 }; 2228 2229 private static NumberFormatInfo numberFormatInfo = new NumberFormatInfo(); 2230 2231 public static readonly BitSet FOLLOW_logicalExpression_in_ncalcExpression56 = new BitSet(new[] { 0x0000000000000000UL }); 2232 public static readonly BitSet FOLLOW_EOF_in_ncalcExpression58 = new BitSet(new[] { 0x0000000000000002UL }); 2233 public static readonly BitSet FOLLOW_conditionalExpression_in_logicalExpression78 = new BitSet(new[] { 0x0000000000080002UL }); 2234 public static readonly BitSet FOLLOW_19_in_logicalExpression84 = new BitSet(new[] { 0x0000788000000FF0UL }); 2235 public static readonly BitSet FOLLOW_conditionalExpression_in_logicalExpression88 = new BitSet(new[] { 0x0000000000100000UL }); 2236 public static readonly BitSet FOLLOW_20_in_logicalExpression90 = new BitSet(new[] { 0x0000788000000FF0UL }); 2237 public static readonly BitSet FOLLOW_conditionalExpression_in_logicalExpression94 = new BitSet(new[] { 0x0000000000000002UL }); 2238 public static readonly BitSet FOLLOW_booleanAndExpression_in_conditionalExpression121 = new BitSet(new[] { 0x0000000000600002UL }); 2239 public static readonly BitSet FOLLOW_set_in_conditionalExpression130 = new BitSet(new[] { 0x0000788000000FF0UL }); 2240 public static readonly BitSet FOLLOW_conditionalExpression_in_conditionalExpression146 = new BitSet(new[] { 0x0000000000600002UL }); 2241 public static readonly BitSet FOLLOW_bitwiseOrExpression_in_booleanAndExpression180 = new BitSet(new[] { 0x0000000001800002UL }); 2242 public static readonly BitSet FOLLOW_set_in_booleanAndExpression189 = new BitSet(new[] { 0x0000788000000FF0UL }); 2243 public static readonly BitSet FOLLOW_bitwiseOrExpression_in_booleanAndExpression205 = new BitSet(new[] { 0x0000000001800002UL }); 2244 public static readonly BitSet FOLLOW_bitwiseXOrExpression_in_bitwiseOrExpression237 = new BitSet(new[] { 0x0000000002000002UL }); 2245 public static readonly BitSet FOLLOW_25_in_bitwiseOrExpression246 = new BitSet(new[] { 0x0000788000000FF0UL }); 2246 public static readonly BitSet FOLLOW_bitwiseOrExpression_in_bitwiseOrExpression256 = new BitSet(new[] { 0x0000000002000002UL }); 2247 public static readonly BitSet FOLLOW_bitwiseAndExpression_in_bitwiseXOrExpression290 = new BitSet(new[] { 0x0000000004000002UL }); 2248 public static readonly BitSet FOLLOW_26_in_bitwiseXOrExpression299 = new BitSet(new[] { 0x0000788000000FF0UL }); 2249 public static readonly BitSet FOLLOW_bitwiseAndExpression_in_bitwiseXOrExpression309 = new BitSet(new[] { 0x0000000004000002UL }); 2250 public static readonly BitSet FOLLOW_equalityExpression_in_bitwiseAndExpression341 = new BitSet(new[] { 0x0000000008000002UL }); 2251 public static readonly BitSet FOLLOW_27_in_bitwiseAndExpression350 = new BitSet(new[] { 0x0000788000000FF0UL }); 2252 public static readonly BitSet FOLLOW_equalityExpression_in_bitwiseAndExpression360 = new BitSet(new[] { 0x0000000008000002UL }); 2253 public static readonly BitSet FOLLOW_relationalExpression_in_equalityExpression394 = new BitSet(new[] { 0x00000000F0000002UL }); 2254 public static readonly BitSet FOLLOW_set_in_equalityExpression405 = new BitSet(new[] { 0x0000788000000FF0UL }); 2255 public static readonly BitSet FOLLOW_set_in_equalityExpression422 = new BitSet(new[] { 0x0000788000000FF0UL }); 2256 public static readonly BitSet FOLLOW_relationalExpression_in_equalityExpression441 = new BitSet(new[] { 0x00000000F0000002UL }); 2257 public static readonly BitSet FOLLOW_shiftExpression_in_relationalExpression474 = new BitSet(new[] { 0x0000000F00000002UL }); 2258 public static readonly BitSet FOLLOW_32_in_relationalExpression485 = new BitSet(new[] { 0x0000788000000FF0UL }); 2259 public static readonly BitSet FOLLOW_33_in_relationalExpression495 = new BitSet(new[] { 0x0000788000000FF0UL }); 2260 public static readonly BitSet FOLLOW_34_in_relationalExpression506 = new BitSet(new[] { 0x0000788000000FF0UL }); 2261 public static readonly BitSet FOLLOW_35_in_relationalExpression516 = new BitSet(new[] { 0x0000788000000FF0UL }); 2262 public static readonly BitSet FOLLOW_shiftExpression_in_relationalExpression528 = new BitSet(new[] { 0x0000000F00000002UL }); 2263 public static readonly BitSet FOLLOW_additiveExpression_in_shiftExpression560 = new BitSet(new[] { 0x0000003000000002UL }); 2264 public static readonly BitSet FOLLOW_36_in_shiftExpression571 = new BitSet(new[] { 0x0000788000000FF0UL }); 2265 public static readonly BitSet FOLLOW_37_in_shiftExpression581 = new BitSet(new[] { 0x0000788000000FF0UL }); 2266 public static readonly BitSet FOLLOW_additiveExpression_in_shiftExpression593 = new BitSet(new[] { 0x0000003000000002UL }); 2267 public static readonly BitSet FOLLOW_multiplicativeExpression_in_additiveExpression625 = new BitSet(new[] { 0x000000C000000002UL }); 2268 public static readonly BitSet FOLLOW_38_in_additiveExpression636 = new BitSet(new[] { 0x0000788000000FF0UL }); 2269 public static readonly BitSet FOLLOW_39_in_additiveExpression646 = new BitSet(new[] { 0x0000788000000FF0UL }); 2270 public static readonly BitSet FOLLOW_multiplicativeExpression_in_additiveExpression658 = new BitSet(new[] { 0x000000C000000002UL }); 2271 public static readonly BitSet FOLLOW_unaryExpression_in_multiplicativeExpression690 = new BitSet(new[] { 0x0000070000000002UL }); 2272 public static readonly BitSet FOLLOW_40_in_multiplicativeExpression701 = new BitSet(new[] { 0x0000788000000FF0UL }); 2273 public static readonly BitSet FOLLOW_41_in_multiplicativeExpression711 = new BitSet(new[] { 0x0000788000000FF0UL }); 2274 public static readonly BitSet FOLLOW_42_in_multiplicativeExpression721 = new BitSet(new[] { 0x0000788000000FF0UL }); 2275 public static readonly BitSet FOLLOW_unaryExpression_in_multiplicativeExpression733 = new BitSet(new[] { 0x0000070000000002UL }); 2276 public static readonly BitSet FOLLOW_primaryExpression_in_unaryExpression760 = new BitSet(new[] { 0x0000000000000002UL }); 2277 public static readonly BitSet FOLLOW_set_in_unaryExpression771 = new BitSet(new[] { 0x0000400000000FF0UL }); 2278 public static readonly BitSet FOLLOW_primaryExpression_in_unaryExpression779 = new BitSet(new[] { 0x0000000000000002UL }); 2279 public static readonly BitSet FOLLOW_45_in_unaryExpression791 = new BitSet(new[] { 0x0000400000000FF0UL }); 2280 public static readonly BitSet FOLLOW_primaryExpression_in_unaryExpression794 = new BitSet(new[] { 0x0000000000000002UL }); 2281 public static readonly BitSet FOLLOW_39_in_unaryExpression805 = new BitSet(new[] { 0x0000400000000FF0UL }); 2282 public static readonly BitSet FOLLOW_primaryExpression_in_unaryExpression807 = new BitSet(new[] { 0x0000000000000002UL }); 2283 public static readonly BitSet FOLLOW_46_in_primaryExpression829 = new BitSet(new[] { 0x0000788000000FF0UL }); 2284 public static readonly BitSet FOLLOW_logicalExpression_in_primaryExpression831 = new BitSet(new[] { 0x0000800000000000UL }); 2285 public static readonly BitSet FOLLOW_47_in_primaryExpression833 = new BitSet(new[] { 0x0000000000000002UL }); 2286 public static readonly BitSet FOLLOW_value_in_primaryExpression843 = new BitSet(new[] { 0x0000000000000002UL }); 2287 public static readonly BitSet FOLLOW_identifier_in_primaryExpression851 = new BitSet(new[] { 0x0000400000000002UL }); 2288 public static readonly BitSet FOLLOW_arguments_in_primaryExpression856 = new BitSet(new[] { 0x0000000000000002UL }); 2289 public static readonly BitSet FOLLOW_INTEGER_in_value876 = new BitSet(new[] { 0x0000000000000002UL }); 2290 public static readonly BitSet FOLLOW_FLOAT_in_value884 = new BitSet(new[] { 0x0000000000000002UL }); 2291 public static readonly BitSet FOLLOW_STRING_in_value892 = new BitSet(new[] { 0x0000000000000002UL }); 2292 public static readonly BitSet FOLLOW_DATETIME_in_value901 = new BitSet(new[] { 0x0000000000000002UL }); 2293 public static readonly BitSet FOLLOW_TRUE_in_value908 = new BitSet(new[] { 0x0000000000000002UL }); 2294 public static readonly BitSet FOLLOW_FALSE_in_value916 = new BitSet(new[] { 0x0000000000000002UL }); 2295 public static readonly BitSet FOLLOW_ID_in_identifier934 = new BitSet(new[] { 0x0000000000000002UL }); 2296 public static readonly BitSet FOLLOW_NAME_in_identifier942 = new BitSet(new[] { 0x0000000000000002UL }); 2297 public static readonly BitSet FOLLOW_logicalExpression_in_expressionList966 = new BitSet(new[] { 0x0001000000000002UL }); 2298 public static readonly BitSet FOLLOW_48_in_expressionList973 = new BitSet(new[] { 0x0000788000000FF0UL }); 2299 public static readonly BitSet FOLLOW_logicalExpression_in_expressionList977 = new BitSet(new[] { 0x0001000000000002UL }); 2300 public static readonly BitSet FOLLOW_46_in_arguments1006 = new BitSet(new[] { 0x0000F88000000FF0UL }); 2301 public static readonly BitSet FOLLOW_expressionList_in_arguments1010 = new BitSet(new[] { 0x0000800000000000UL }); 2302 public static readonly BitSet FOLLOW_47_in_arguments1017 = new BitSet(new[] { 0x0000000000000002UL }); 2303 2304 public class ncalcExpression_return : ParserRuleReturnScope 2305 { 2306 public LogicalExpression value; 2307 private CommonTree tree; 2308 2309 override public object Tree 2310 { 2311 get 2312 { 2313 return tree; 2314 } 2315 set 2316 { 2317 tree = (CommonTree)value; 2318 } 2319 } 2320 }; 2321 2322 // $ANTLR end "ncalcExpression" 2323 2324 public class logicalExpression_return : ParserRuleReturnScope 2325 { 2326 public LogicalExpression value; 2327 private CommonTree tree; 2328 2329 override public object Tree 2330 { 2331 get 2332 { 2333 return tree; 2334 } 2335 set 2336 { 2337 tree = (CommonTree)value; 2338 } 2339 } 2340 }; 2341 2342 // $ANTLR end "logicalExpression" 2343 2344 public class conditionalExpression_return : ParserRuleReturnScope 2345 { 2346 public LogicalExpression value; 2347 private CommonTree tree; 2348 2349 override public object Tree 2350 { 2351 get 2352 { 2353 return tree; 2354 } 2355 set 2356 { 2357 tree = (CommonTree)value; 2358 } 2359 } 2360 }; 2361 2362 // $ANTLR end "conditionalExpression" 2363 2364 public class booleanAndExpression_return : ParserRuleReturnScope 2365 { 2366 public LogicalExpression value; 2367 private CommonTree tree; 2368 2369 override public object Tree 2370 { 2371 get 2372 { 2373 return tree; 2374 } 2375 set 2376 { 2377 tree = (CommonTree)value; 2378 } 2379 } 2380 }; 2381 2382 // $ANTLR end "booleanAndExpression" 2383 2384 public class bitwiseOrExpression_return : ParserRuleReturnScope 2385 { 2386 public LogicalExpression value; 2387 private CommonTree tree; 2388 2389 override public object Tree 2390 { 2391 get 2392 { 2393 return tree; 2394 } 2395 set 2396 { 2397 tree = (CommonTree)value; 2398 } 2399 } 2400 }; 2401 2402 // $ANTLR end "bitwiseOrExpression" 2403 2404 public class bitwiseXOrExpression_return : ParserRuleReturnScope 2405 { 2406 public LogicalExpression value; 2407 private CommonTree tree; 2408 2409 override public object Tree 2410 { 2411 get 2412 { 2413 return tree; 2414 } 2415 set 2416 { 2417 tree = (CommonTree)value; 2418 } 2419 } 2420 }; 2421 2422 // $ANTLR end "bitwiseXOrExpression" 2423 2424 public class bitwiseAndExpression_return : ParserRuleReturnScope 2425 { 2426 public LogicalExpression value; 2427 private CommonTree tree; 2428 2429 override public object Tree 2430 { 2431 get 2432 { 2433 return tree; 2434 } 2435 set 2436 { 2437 tree = (CommonTree)value; 2438 } 2439 } 2440 }; 2441 2442 // $ANTLR end "bitwiseAndExpression" 2443 2444 public class equalityExpression_return : ParserRuleReturnScope 2445 { 2446 public LogicalExpression value; 2447 private CommonTree tree; 2448 2449 override public object Tree 2450 { 2451 get 2452 { 2453 return tree; 2454 } 2455 set 2456 { 2457 tree = (CommonTree)value; 2458 } 2459 } 2460 }; 2461 2462 // $ANTLR end "equalityExpression" 2463 2464 public class relationalExpression_return : ParserRuleReturnScope 2465 { 2466 public LogicalExpression value; 2467 private CommonTree tree; 2468 2469 override public object Tree 2470 { 2471 get 2472 { 2473 return tree; 2474 } 2475 set 2476 { 2477 tree = (CommonTree)value; 2478 } 2479 } 2480 }; 2481 2482 // $ANTLR end "relationalExpression" 2483 2484 public class shiftExpression_return : ParserRuleReturnScope 2485 { 2486 public LogicalExpression value; 2487 private CommonTree tree; 2488 2489 override public object Tree 2490 { 2491 get 2492 { 2493 return tree; 2494 } 2495 set 2496 { 2497 tree = (CommonTree)value; 2498 } 2499 } 2500 }; 2501 2502 // $ANTLR end "shiftExpression" 2503 2504 public class additiveExpression_return : ParserRuleReturnScope 2505 { 2506 public LogicalExpression value; 2507 private CommonTree tree; 2508 2509 override public object Tree 2510 { 2511 get 2512 { 2513 return tree; 2514 } 2515 set 2516 { 2517 tree = (CommonTree)value; 2518 } 2519 } 2520 }; 2521 2522 // $ANTLR end "additiveExpression" 2523 2524 public class multiplicativeExpression_return : ParserRuleReturnScope 2525 { 2526 public LogicalExpression value; 2527 private CommonTree tree; 2528 2529 override public object Tree 2530 { 2531 get 2532 { 2533 return tree; 2534 } 2535 set 2536 { 2537 tree = (CommonTree)value; 2538 } 2539 } 2540 }; 2541 2542 // $ANTLR end "multiplicativeExpression" 2543 2544 public class unaryExpression_return : ParserRuleReturnScope 2545 { 2546 public LogicalExpression value; 2547 private CommonTree tree; 2548 2549 override public object Tree 2550 { 2551 get 2552 { 2553 return tree; 2554 } 2555 set 2556 { 2557 tree = (CommonTree)value; 2558 } 2559 } 2560 }; 2561 2562 // $ANTLR end "unaryExpression" 2563 2564 public class primaryExpression_return : ParserRuleReturnScope 2565 { 2566 public LogicalExpression value; 2567 private CommonTree tree; 2568 2569 override public object Tree 2570 { 2571 get 2572 { 2573 return tree; 2574 } 2575 set 2576 { 2577 tree = (CommonTree)value; 2578 } 2579 } 2580 }; 2581 2582 // $ANTLR end "primaryExpression" 2583 2584 public class value_return : ParserRuleReturnScope 2585 { 2586 public ValueExpression value; 2587 private CommonTree tree; 2588 2589 override public object Tree 2590 { 2591 get 2592 { 2593 return tree; 2594 } 2595 set 2596 { 2597 tree = (CommonTree)value; 2598 } 2599 } 2600 }; 2601 2602 // $ANTLR end "value" 2603 2604 public class identifier_return : ParserRuleReturnScope 2605 { 2606 public IdentifierExpression value; 2607 private CommonTree tree; 2608 2609 override public object Tree 2610 { 2611 get 2612 { 2613 return tree; 2614 } 2615 set 2616 { 2617 tree = (CommonTree)value; 2618 } 2619 } 2620 }; 2621 2622 // $ANTLR end "identifier" 2623 2624 public class expressionList_return : ParserRuleReturnScope 2625 { 2626 public List<LogicalExpression> value; 2627 private CommonTree tree; 2628 2629 override public object Tree 2630 { 2631 get 2632 { 2633 return tree; 2634 } 2635 set 2636 { 2637 tree = (CommonTree)value; 2638 } 2639 } 2640 }; 2641 2642 // $ANTLR end "expressionList" 2643 2644 public class arguments_return : ParserRuleReturnScope 2645 { 2646 public List<LogicalExpression> value; 2647 private CommonTree tree; 2648 2649 override public object Tree 2650 { 2651 get 2652 { 2653 return tree; 2654 } 2655 set 2656 { 2657 tree = (CommonTree)value; 2658 } 2659 } 2660 }; 2661 } 2662}