暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

NCalcParser.cs 117KB

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