token_list.h 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194
  1. /*
  2. * Copyright (c) 2021 Noah Vogt <noah@noahvogt.com>
  3. * Copyright (c) 2011 Matthew Iselin
  4. *
  5. * Permission to use, copy, modify, and distribute this software for any
  6. * purpose with or without fee is hereby granted, provided that the above
  7. * copyright notice and this permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14. * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15. * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. */
  17. /* Describes a potential token to be read by the compiler */
  18. struct Token {
  19. /* The compiled byte for the token */
  20. unsigned char data;
  21. /* The actual text to be converted by the interpreter */
  22. const char* text;
  23. };
  24. /* A two byte token (0xBB, 0x7E and SysVar) */
  25. struct TwoByte {
  26. unsigned short data;
  27. const char* text;
  28. };
  29. /* Direct ASCII character to token conversion. */
  30. struct ConvertRule {
  31. char c; /* the character */
  32. unsigned char tok; /* the equivalent token */
  33. };
  34. extern struct Token StandardTokens[200];
  35. extern struct TwoByte CalcVars[302];
  36. extern struct ConvertRule Replacements[39];
  37. /* Token List */
  38. #define TO_DMS 0x01
  39. #define TO_DEC 0x02
  40. #define TO_FRAC 0x03
  41. #define STORE 0x04
  42. #define BOXPLOT 0x05
  43. #define LEFTSBRACK 0x06
  44. #define RIGHTSBRACK 0x07
  45. #define LEFTBRACE 0x08
  46. #define RIGHTBRACE 0x09
  47. #define RADIANS 0x0A
  48. #define DEGREES 0x0B
  49. #define INVERSE 0x0C
  50. #define SQUARE 0x0D
  51. #define TRANSPOSE 0x0E
  52. #define CUBE 0x0F
  53. #define LEFTBRACKET 0x10
  54. #define RIGHTBRACKET 0x11
  55. #define ROUND 0x12
  56. #define PXLTEST 0x13
  57. #define AUGMENT 0x14
  58. #define ROWSWAP 0x15
  59. #define ROWPLUS 0x16
  60. #define STARROW 0x17
  61. #define STARROWPLUS 0x18
  62. #define MAX 0x19
  63. #define MIN 0x1B
  64. #define MEDIAN 0x1F
  65. #define RANDM 0x20
  66. #define MEAN 0x21
  67. #define SOLVE 0x22
  68. #define SEQFUNC 0x23
  69. #define FNINT 0x24
  70. #define NDERIV 0x25
  71. #define FMIN 0x27
  72. #define FMAX 0x28
  73. #define SPACE 0x29
  74. #define DOUBLEQUOTE 0x2A
  75. #define COMMA 0x2B
  76. #define IMAG_I 0x2C
  77. #define FACTORIAL 0x2D
  78. #define CUBICREG 0x2E
  79. #define QUARTREG 0x2F
  80. #define NUM_0 0x30
  81. #define NUM_1 0x31
  82. #define NUM_2 0x32
  83. #define NUM_3 0x33
  84. #define NUM_4 0x34
  85. #define NUM_5 0x35
  86. #define NUM_6 0x36
  87. #define NUM_7 0x37
  88. #define NUM_8 0x38
  89. #define NUM_9 0x39
  90. #define PERIOD 0x3A
  91. #define EXPONENT 0x3B
  92. #define LOGIC_OR 0x3C
  93. #define LOGIC_XOR 0x3D
  94. #define COLON 0x3E
  95. #define HARD_RETURN 0x3F
  96. #define LOGIC_AND 0x40
  97. #define STR_A 0x41
  98. #define STR_B 0x42
  99. #define STR_C 0x43
  100. #define STR_D 0x44
  101. #define STR_E 0x45
  102. #define STR_F 0x46
  103. #define STR_G 0x47
  104. #define STR_H 0x48
  105. #define STR_I 0x49
  106. #define STR_J 0x4A
  107. #define STR_K 0x4B
  108. #define STR_L 0x4C
  109. #define STR_M 0x4D
  110. #define STR_N 0x4E
  111. #define STR_O 0x4F
  112. #define STR_P 0x50
  113. #define STR_Q 0x51
  114. #define STR_R 0x52
  115. #define STR_S 0x53
  116. #define STR_T 0x54
  117. #define STR_U 0x55
  118. #define STR_V 0x56
  119. #define STR_W 0x57
  120. #define STR_X 0x58
  121. #define STR_Y 0x59
  122. #define STR_Z 0x5A
  123. #define STR_THETA 0x5B
  124. #define PROGRAM 0x5F
  125. /** SysVar **/
  126. #define RADIAN 0x64
  127. #define DEGREE 0x65
  128. #define NORMAL 0x66
  129. #define SCI 0x67
  130. #define ENG 0x68
  131. #define FLOAT 0x69
  132. #define TEST_EQUAL 0x6A
  133. #define TEST_LESSTHAN 0x6B
  134. #define TEST_HIGHTHAN 0x6C
  135. #define TEST_LOREQU 0x6D
  136. #define TEST_GOREQU 0x6E
  137. #define TEST_NOTEQUAL 0x6F
  138. #define ADD 0x70
  139. #define SUBTRACT 0x71
  140. #define ANSWER 0x72
  141. #define FIX 0x73
  142. #define HORIZ 0x74
  143. #define FULL 0x75
  144. #define FUNC 0x76
  145. #define PARAM 0x77
  146. #define POLAR 0x78
  147. #define SEQ 0x79
  148. #define INDPNTAUTO 0x7A
  149. #define INDPNTASK 0x7B
  150. #define DEPENDAUTO 0x7C
  151. #define DEPENDASK 0x7D
  152. /** 7E VARIABLES, ie. graph manipulation **/
  153. #define BOX 0x7F
  154. #define DIVIDE 0x80
  155. #define DOT 0x81
  156. #define MULTIPLY 0x82
  157. #define DIVIDE_SLASH 0x83
  158. #define TRACE 0x84
  159. #define CLRDRAW 0x85
  160. #define ZSTANDARD 0x86
  161. #define ZTRIG 0x87
  162. #define ZBOX 0x88
  163. #define ZOOMIN 0x89
  164. #define ZOOMOUT 0x8A
  165. #define ZSQUARE 0x8B
  166. #define ZINTEGER 0x8C
  167. #define ZPREVIOUS 0x8D
  168. #define ZDECIMAL 0x8E
  169. #define ZOOMSTAT 0x8F
  170. #define ZOOMRCL 0x90
  171. #define PRINTSCREEN 0x91
  172. #define ZOOMSTO 0x92
  173. #define TEXTFUNC 0x93
  174. #define NPR 0x94
  175. #define NCR 0x95
  176. #define FNON 0x96
  177. #define FNOFF 0x97
  178. #define STOREPIC 0x98
  179. #define RECALLPIC 0x99
  180. #define STOREGDB 0x9A
  181. #define RECALLGDB 0x9B
  182. #define LINE 0x9C
  183. #define VERTICAL 0x9D
  184. #define PTON 0x9E
  185. #define PTOFF 0x9F
  186. #define PTCHANGE 0xA0
  187. #define PXLON 0xA1
  188. #define PXLOFF 0xA2
  189. #define PXLCHANGE 0xA3
  190. #define SHADE 0xA4
  191. #define CIRCLE 0xA5
  192. #define HORIZONTAL 0xA6
  193. #define TANGENT 0xA7
  194. #define DRAWINV 0xA8
  195. #define DRAWF 0xA9
  196. #define RAND 0xAB
  197. #define PI 0xAC
  198. #define GETKEY 0xAD
  199. #define APOSTROPHE 0xAE
  200. #define QUESTIONMARK 0xAF
  201. /** SysVar **/
  202. #define NEGATIVE 0xB0
  203. #define CONV_INT 0xB1
  204. #define ABS 0xB2
  205. #define DETERMINANT 0xB3
  206. #define IDENTITY 0xB4
  207. #define DIM 0xB5
  208. #define SUM 0xB6
  209. #define PROD 0xB7
  210. #define NOT 0xB8
  211. #define IPART 0xB9
  212. #define FPART 0xBA
  213. /** BB tokens **/
  214. #define SQR_ROOT 0xBC
  215. #define CUBE_ROOT 0xBD
  216. #define NATLOG 0xBE
  217. #define ETOPOWER 0xBF
  218. #define LOGARITHM 0xC0
  219. #define POWER10 0xC1
  220. #define SINE 0xC2
  221. #define INVSIN 0xC3
  222. #define COSINE 0xC4
  223. #define INVCOSINE 0xC5
  224. #define TANGENT_TRIG 0xC6
  225. #define INVTANGENT 0xC7
  226. #define HYP_SINE 0xC8
  227. #define HYP_ISINE 0xC9
  228. #define HYP_COSINE 0xCA
  229. #define HYP_ICOSINE 0xCB
  230. #define HYP_TANGENT 0xCC
  231. #define HYP_ITANGENT 0xCD
  232. #define LOGIC_IF 0xCE
  233. #define LOGIC_THEN 0xCF
  234. #define LOGIC_ELSE 0xD0
  235. #define CTL_WHILE 0xD1
  236. #define CTL_REPEAT 0xD2
  237. #define CTL_FOR 0xD3
  238. #define CTL_END 0xD4
  239. #define CTL_RETURN 0xD5
  240. #define LABEL 0xD6
  241. #define CTL_GOTO 0xD7
  242. #define CTL_PAUSE 0xD8
  243. #define CTL_STOP 0xD9
  244. #define INCSKIPIFHIGH 0xDA
  245. #define DECSKIPIFLOW 0xDB
  246. #define INPUT 0xDC
  247. #define PROMPT 0xDD
  248. #define DISP 0xDE
  249. #define DISPGRAPH 0xDF
  250. #define OUTPUT 0xE0
  251. #define CLRHOME 0xE1
  252. #define FILL 0xE2
  253. #define SORTA 0xE3
  254. #define SORTD 0xE4
  255. #define DISPTABLE 0xE5
  256. #define MENU 0xE6
  257. #define SEND 0xE7
  258. #define GET 0xE8
  259. #define PLOTSON 0xE9
  260. #define PLOTSOFF 0xEA
  261. #define LIST 0xEB
  262. #define PLOT1 0xEC
  263. #define PLOT2 0xED
  264. #define PLOT3 0xEE
  265. #define TOSTRING 0xEF
  266. #define POWEROF 0xF0
  267. #define XTHROOT 0xF1
  268. #define VARSTATS_1 0xF2
  269. #define VARSTATS_2 0xF3
  270. #define LINREG1 0xF4
  271. #define EXPREG 0xF5
  272. #define LNREG 0xF6
  273. #define PWRREG 0xF7
  274. #define MEDMED 0xF8
  275. #define QUADREG 0xF9
  276. #define CLRLIST 0xFA
  277. #define CLRTABLE 0xFB
  278. #define HISTOGRAM 0xFC
  279. #define XYLINE 0xFD
  280. #define SCATTER 0xFE
  281. #define LINREG2 0xFF
  282. /** SYSTEM VARIABLES **/
  283. /* Matrices */
  284. #define MAT_A 0x005C
  285. #define MAT_B 0x015C
  286. #define MAT_C 0x025C
  287. #define MAT_D 0x035C
  288. #define MAT_E 0x045C
  289. #define MAT_F 0x055C
  290. #define MAT_G 0x065C
  291. #define MAT_H 0x075C
  292. #define MAT_I 0x085C
  293. #define MAT_J 0x095C
  294. /* Lists */
  295. #define L1 0x005D
  296. #define L2 0x015D
  297. #define L3 0x025D
  298. #define L4 0x035D
  299. #define L5 0x045D
  300. #define L6 0x055D
  301. #define L7 0x065D
  302. #define L8 0x075D
  303. #define L9 0x085D
  304. #define L0 0x095D
  305. /* Graph (function) */
  306. #define Y1 0x105E
  307. #define Y2 0x115E
  308. #define Y3 0x125E
  309. #define Y4 0x135E
  310. #define Y5 0x145E
  311. #define Y6 0x155E
  312. #define Y7 0x165E
  313. #define Y8 0x175E
  314. #define Y9 0x185E
  315. #define Y0 0x195E
  316. /* Graph (parametric) */
  317. #define X1T 0x205E
  318. #define Y1T 0x215E
  319. #define X2T 0x225E
  320. #define Y2T 0x235E
  321. #define X3T 0x245E
  322. #define Y3T 0x255E
  323. #define X4T 0x265E
  324. #define Y4T 0x275E
  325. #define X5T 0x285E
  326. #define Y5T 0x295E
  327. #define X6T 0x2A5E
  328. #define Y6T 0x2B5E
  329. /* Graph (polar) */
  330. #define R1 0x405E
  331. #define R2 0x415E
  332. #define R3 0x425E
  333. #define R4 0x435E
  334. #define R5 0x445E
  335. #define R6 0x455E
  336. #define SYSVAR_U 0x805E
  337. #define SYSVAR_V 0x815E
  338. /* Pictures */
  339. #define PIC1 0x0060
  340. #define PIC2 0x0160
  341. #define PIC3 0x0260
  342. #define PIC4 0x0360
  343. #define PIC5 0x0460
  344. #define PIC6 0x0560
  345. #define PIC7 0x0660
  346. #define PIC8 0x0760
  347. #define PIC9 0x0860
  348. #define PIC0 0x0960
  349. /* Graph databases */
  350. #define GDB1 0x0061
  351. #define GDB2 0x0161
  352. #define GDB3 0x0261
  353. #define GDB4 0x0361
  354. #define GDB5 0x0461
  355. #define GDB6 0x0561
  356. #define GDB7 0x0661
  357. #define GDB8 0x0761
  358. #define GDB9 0x0861
  359. #define GDB0 0x0961
  360. /* Stat data */
  361. #define REGEQ 0x0162
  362. #define STAT_N 0x0262
  363. #define MEANX 0x0362
  364. #define SUMX 0x0462
  365. #define SUMXSQUARED 0x0562
  366. #define SX 0x0662
  367. #define SIGMAX 0x0762
  368. #define MINX 0x0862
  369. #define MAXX 0x0962
  370. #define MINY 0x0A62
  371. #define MAXY 0x0B02
  372. #define MEANY 0x0C62
  373. #define SUMY 0x0D62
  374. #define SUMYSQUARED 0x0E62
  375. #define SY 0x0F62
  376. #define SIGMAY 0x1062
  377. #define SUMXY 0x1162
  378. #define SYSVAR_R 0x1262
  379. #define MED 0x1362
  380. #define Q1 0x1462
  381. #define Q3 0x1562
  382. #define SYSVAR_A 0x1662
  383. #define SYSVAR_B 0x1762
  384. #define SYSVAR_C 0x1862
  385. #define SYSVAR_D 0x1962
  386. #define SYSVAR_E 0x1A62
  387. #define X1 0x1B62
  388. #define X2 0x1C62
  389. #define X3 0x1D62
  390. #define Y1_1 0x1E62
  391. #define Y2_1 0x1F62
  392. #define Y3_1 0x2062
  393. #define SYSVAR_N 0x2162
  394. #define SYSVAR_P 0x2262
  395. #define SYSVAR_Z 0x2362
  396. #define SYSVAR_T 0x2462
  397. #define CHISQUARED 0x2562
  398. #define FIN 0x2662
  399. #define DF 0x2762
  400. #define PHAT 0x2862
  401. #define PHAT1 0x2962
  402. #define PHAT2 0x2A62
  403. #define MEANX1 0x2B62
  404. #define SX1 0x2C62
  405. #define N1 0x2D62
  406. #define MEANX2 0x2E62
  407. #define SX2 0x2F62
  408. #define N2 0x3062
  409. #define SXP 0x3162
  410. #define LOWER 0x3262
  411. #define UPPER 0x3362
  412. #define SYSVAR_S 0x3462
  413. #define RSQUARED 0x3562
  414. #define CAPRSQUARED 0x3662
  415. #define DF2 0x3762 /* not sure about this one */
  416. #define SS 0x3862
  417. #define MS 0x3962
  418. #define DF3 0x3A62 /* again here? */
  419. #define SS1 0x3B62 /* another double */
  420. #define MS1 0x3C62 /* " " */
  421. /* Graph data */
  422. #define ZXSCL 0x0063
  423. #define ZYSCL 0x0163
  424. #define XSCL 0x0263
  425. #define YSCL 0x0363
  426. #define UNSTART 0x0463
  427. #define VNSTART 0x0563
  428. #define UNINVERSE 0x0663
  429. #define VNINVERSE 0x0763
  430. #define ZUNSTART 0x0863
  431. #define ZVNSTART 0x0963
  432. #define XMIN 0x0A63
  433. #define XMAX 0x0B63
  434. #define YMIN 0x0C63
  435. #define YMAX 0x0D63
  436. #define TMIN 0x0E63
  437. #define TMAX 0x0F63
  438. #define THETAMIN 0x1063
  439. #define THETAMAX 0x1163
  440. #define ZXMIN 0x1263
  441. #define ZXMAX 0x1363
  442. #define ZYMIN 0x1463
  443. #define ZYMAX 0x1563
  444. #define ZTHETAMIN 0x1663
  445. #define ZTHETAMAX 0x1763
  446. #define ZTMIN 0x1863
  447. #define ZTMAX 0x1963
  448. #define TBLMIN 0x1A63
  449. #define NMIN 0x1B63
  450. #define ZNMIN 0x1C63
  451. #define NMAX 0x1D63
  452. #define ZNMAX 0x1E63
  453. #define NSTART 0x1F63
  454. #define ZNSTART 0x2063
  455. #define DELTATABLE 0x2163
  456. #define TSTEP 0x2263
  457. #define THETASTEP 0x2363
  458. #define ZTSTEP 0x2463
  459. #define ZTHETASTEP 0x2563
  460. #define DELTAX 0x2663
  461. #define DELTAY 0x2763
  462. #define XFACT 0x2863
  463. #define YFACT 0x2963
  464. #define TBLINPUT 0x2A63
  465. #define SYSVAR_CAPN 0x2B63
  466. #define IPERCENT 0x2C63
  467. #define PV 0x2D63
  468. #define PMT 0x2E63
  469. #define FV 0x2F63
  470. #define XRES 0x3063
  471. #define ZXRES 0x3163
  472. /* Strings */
  473. #define STR1 0x00AA
  474. #define STR2 0x01AA
  475. #define STR3 0x02AA
  476. #define STR4 0x03AA
  477. #define STR5 0x04AA
  478. #define STR6 0x05AA
  479. #define STR7 0x06AA
  480. #define STR8 0x07AA
  481. #define STR9 0x08AA
  482. #define STR0 0x09AA
  483. /** 7E VARIABLES **/
  484. #define SEQUENTIAL_7E 0x007E
  485. #define SIMUL 0x017E
  486. #define POLARGC 0x027E
  487. #define RECTGC 0x037E
  488. #define COORDON 0x047E
  489. #define COORDOFF 0x057E
  490. #define CONNECTED 0x067E
  491. #define DOT_7E 0x077E
  492. #define AXESON 0x087E
  493. #define AXESOFF 0x097E
  494. #define GRIDON 0x0A7E
  495. #define GRIDOFF 0x0B7E
  496. #define LABELON 0x0C7E
  497. #define LABELOFF 0x0D7E
  498. #define WEB 0x0E7E
  499. #define TIME 0x0F7E
  500. #define UVAXES 0x107E
  501. #define VWAXES 0x117E
  502. #define UWAXES 0x127E
  503. /** BB VARIABLES **/
  504. #define NPV 0x00BB
  505. #define IRR 0x01BB
  506. #define BAL 0x02BB
  507. #define SUMPRN 0x03BB
  508. #define SUMINT 0x04BB
  509. #define TONOM 0x05BB
  510. #define TOEFF 0x06BB
  511. #define DBD 0x07BB
  512. #define LCM 0x08BB
  513. #define GCD 0x09BB
  514. #define RANDINT 0x0ABB
  515. #define RANDBIN 0x0BBB
  516. #define SUB 0x0CBB
  517. #define STDDEV 0x0DBB
  518. #define VARIANCE 0x0EBB
  519. #define INSTRING 0x0FBB
  520. #define NORMALCDF 0x10BB
  521. #define INVNORM 0x11BB
  522. #define TCDF 0x12BB
  523. #define XSQUCDF 0x13BB
  524. #define FCDF 0x14BB
  525. #define BINOMPDF 0x15BB
  526. #define BINOMCDF 0x16BB
  527. #define POISSONPDF 0x17BB
  528. #define POISSONCDF 0x18BB
  529. #define GEOMETPDF 0x19BB
  530. #define GEOMETCDF 0x1ABB
  531. #define NORMALPDF 0x1BBB
  532. #define TPDF 0x1CBB
  533. #define XSQUPDF 0x1DBB
  534. #define FPDF 0x1EBB
  535. #define RANDNORM 0x1FBB
  536. #define TVM_PMT 0x20BB
  537. #define TVM_I_PERCENT 0x21BB
  538. #define TVM_PV 0x22BB
  539. #define TVM_N 0x23BB
  540. #define TVM_FV 0x24BB
  541. #define CONJ 0x25BB
  542. #define REAL 0x26BB
  543. #define IMAG 0x27BB
  544. #define ANGLE 0x28BB
  545. #define CUMSUM 0x29BB
  546. #define EXPR 0x2ABB
  547. #define LENGTH 0x2BBB
  548. #define DELTA_LIST 0x2CBB
  549. #define REF 0x2DBB
  550. #define RREF 0x2EBB
  551. #define TORECT 0x2FBB
  552. #define TOPOLAR 0x30BB
  553. #define VAR_E 0x31BB
  554. #define SINREG 0x32BB
  555. #define LOGISTIC 0x33BB
  556. #define LINREGTTEST 0x34BB
  557. #define SHADENORM 0x35BB
  558. #define SHADE_T 0x36BB
  559. #define SHADEXSQU 0x37BB
  560. #define SHADEF 0x38BB
  561. #define MATRTOLIST 0x39BB
  562. #define LISTTOMATR 0x3ABB
  563. #define ZTEST 0x3BBB
  564. #define TTEST 0x3CBB
  565. #define TWO_SAMPZTEST 0x3DBB
  566. #define ONE_PROPZTEST 0x3EBB
  567. #define TWO_PROPZTEST 0x3FBB
  568. #define XSQUTEST 0x40BB
  569. #define ZINTERVAL 0x41BB
  570. #define TWO_SAMPZINT 0x42BB
  571. #define ONE_PROPZINT 0x43BB
  572. #define TWO_PROPZINT 0x44BB
  573. #define GRAPHSTYLE 0x45BB
  574. #define TWO_SAMPTTEST 0x46BB
  575. #define TWO_SAMPFTEST 0x47BB
  576. #define TINTERVAL 0x48BB
  577. #define TWO_SAMPTINT 0x49BB
  578. #define SETUPEDITOR 0x4ABB
  579. #define PMT_END 0x4BBB
  580. #define PMT_BGN 0x4CBB
  581. #define REAL_BB 0x4DBB
  582. #define REPOWTHETAI 0x4EBB
  583. #define APLUSBI 0x4FBB
  584. #define EXPRON 0x50BB
  585. #define EXPROFF 0x51BB
  586. #define CLRALLLISTS 0x52BB
  587. #define GETCALC 0x53BB
  588. #define DELVAR 0x54BB
  589. #define EQUTOSTRING 0x55BB
  590. #define STRINGTOEQU 0x56BB
  591. #define CLEARENTRIES 0x57BB
  592. #define SELECT 0x58BB
  593. #define ANOVA 0x59BB
  594. #define MODBOXPLOT 0x5ABB
  595. #define NORMPROBPLOT 0x5BBB
  596. /* Standard Tokens are any token that can be used anywhere in the line. */
  597. struct Token StandardTokens[] = {
  598. /** CONTROL page of PROGRAM EDITOR (press PRGM when EDITING a program) **/
  599. { LOGIC_IF, "If " },
  600. { LOGIC_THEN, "Then" },
  601. { LOGIC_ELSE, "Else" },
  602. { CTL_FOR, "For(" },
  603. { CTL_WHILE, "While " },
  604. { CTL_REPEAT, "Repeat " },
  605. { CTL_END, "End" },
  606. { CTL_PAUSE, "Pause " },
  607. { CTL_PAUSE, "Pause" }, /* note the space above */
  608. { LABEL, "Lbl " },
  609. { CTL_GOTO, "Goto " },
  610. { INCSKIPIFHIGH, "IS>(" },
  611. { DECSKIPIFLOW, "DS<(" },
  612. { MENU, "Menu(" },
  613. { PROGRAM, "prgm" },
  614. { CTL_RETURN, "Return" },
  615. { CTL_STOP, "Stop" },
  616. /** I/O page **/
  617. { INPUT, "Input " },
  618. { PROMPT, "Prompt " },
  619. { DISP, "Disp " },
  620. { DISPGRAPH, "DispGraph" },
  621. { DISPTABLE, "DispTable" },
  622. { OUTPUT, "Output(" },
  623. { GETKEY, "getKey" },
  624. { CLRHOME, "ClrHome" },
  625. { CLRTABLE, "ClrTable" },
  626. { TOSTRING, "toString(" },
  627. /** GetCalc **/
  628. { GET, "Get(" },
  629. { SEND, "Send(" },
  630. /** Plots **/
  631. { PLOTSON, "PlotsOn " },
  632. { PLOTSOFF, "PlotsOff " },
  633. /** Others **/
  634. { TRACE, "Trace" },
  635. { ZSTANDARD, "ZStandard" },
  636. { ZTRIG, "ZTrig" },
  637. { ZBOX, "ZBox" },
  638. { ZOOMIN, "ZoomIn" },
  639. { ZOOMOUT, "ZoomOut" },
  640. { ZSQUARE, "ZSquare" },
  641. { ZINTEGER, "ZInteger" },
  642. { ZPREVIOUS, "ZPrevious" },
  643. { ZDECIMAL, "ZDecimal" },
  644. { ZOOMSTAT, "ZoomStat" },
  645. { ZOOMRCL, "ZoomRcl" },
  646. { ZOOMSTO, "ZoomSto" },
  647. { TEXTFUNC, "Text(" },
  648. { STOREPIC, "StorePic" },
  649. { RECALLPIC, "RecallPic" },
  650. { STOREGDB, "StoreGDB" },
  651. /** OTHERS **/
  652. { TO_DMS, "->DMS" },
  653. { TO_DEC, "->DEC" },
  654. { TO_FRAC, "->FRAC" },
  655. { STORE, "->" },
  656. { BOXPLOT, "BoxPlot" },
  657. { RADIANS, "[radians]" },
  658. { DEGREES, "[degrees]" },
  659. { INVERSE, "^-1" },
  660. { SQUARE, "^2" },
  661. { TRANSPOSE, "[transpose]" },
  662. { CUBE, "^3" },
  663. { ROUND, "round(" },
  664. { PXLTEST, "pxl-Test(" },
  665. { AUGMENT, "augment(" },
  666. { ROWSWAP, "RowSwap(" },
  667. { ROWPLUS, "row+(" },
  668. { STARROW, "*row(" },
  669. { STARROWPLUS, "*row+(" },
  670. { MAX, "max(" },
  671. { MIN, "min(" },
  672. { MEDIAN, "median(" },
  673. { RANDM, "randM(" },
  674. { MEAN, "mean(" },
  675. { SOLVE, "solve(" },
  676. { SEQFUNC, "seq(" },
  677. { FNINT, "fnInt(" },
  678. { NDERIV, "NDeriv(" },
  679. { FMIN, "FMin(" },
  680. { FMAX, "FMax(" },
  681. { CUBICREG, "CubicReg " },
  682. { QUARTREG, "QuartReg " },
  683. { LOGIC_OR, " or " },
  684. { LOGIC_XOR, " xor " },
  685. { LOGIC_AND, "and" },
  686. { STR_THETA, "[theta]" },
  687. { PROGRAM, "prgm" },
  688. { RADIAN, "Radian" },
  689. { DEGREE, "Degree" },
  690. { NORMAL, "Normal" },
  691. { SCI, "Sci" },
  692. { ENG, "Eng" },
  693. { FLOAT, "Float" },
  694. { TEST_LOREQU, "<=" },
  695. { TEST_GOREQU, ">=" },
  696. { TEST_NOTEQUAL, "!=" },
  697. { ANSWER, "Ans" },
  698. { FIX, "Fix " },
  699. { HORIZ, "Horiz" },
  700. { FULL, "Full" },
  701. { FUNC, "Func" },
  702. { PARAM, "Param" },
  703. { POLAR, "Polar" },
  704. { SEQ, "Seq" },
  705. { INDPNTAUTO, "IndpntAuto" },
  706. { INDPNTASK, "IndpntAsk" },
  707. { DEPENDAUTO, "DependAuto" },
  708. { DEPENDASK, "DependAsk" },
  709. { BOX, "[box]" },
  710. { DOT, "[dot]" },
  711. { TRACE, "Trace" },
  712. { CLRDRAW, "ClrDraw" },
  713. { ZSTANDARD, "ZStandard" },
  714. { ZTRIG, "ZTrig" },
  715. { ZBOX, "ZBox" },
  716. { ZOOMIN, "Zoom In" },
  717. { ZOOMOUT, "Zoom Out" },
  718. { ZSQUARE, "ZSquare" },
  719. { ZINTEGER, "ZInteger" },
  720. { ZPREVIOUS, "ZPrevious" },
  721. { ZDECIMAL, "ZDecimal" },
  722. { ZOOMSTAT, "ZoomStat" },
  723. { ZOOMRCL, "ZoomRcl" },
  724. { PRINTSCREEN, "PrintScreen" },
  725. { ZOOMSTO, "ZoomSto" },
  726. { TEXTFUNC, "Text(" },
  727. { NPR, "nPr" },
  728. { NCR, "nCr" },
  729. { FNON, "FnOn " },
  730. { FNOFF, "FnOff " },
  731. { STOREPIC, "StorePic " },
  732. { RECALLPIC, "RecallPic " },
  733. { STOREGDB, "StoreGDB " },
  734. { RECALLGDB, "RecallGDB " },
  735. { LINE, "Line(" },
  736. { VERTICAL, "Vertical " },
  737. { PTON, "Pt-On(" },
  738. { PTOFF, "Pt-Off(" },
  739. { PTCHANGE, "Pt-Change(" },
  740. { PXLON, "Pxl-On(" },
  741. { PXLOFF, "Pxl-Off(" },
  742. { PXLCHANGE, "Pxl-Change(" },
  743. { SHADE, "Shade(" },
  744. { CIRCLE, "Circle(" },
  745. { HORIZONTAL, "Horizontal " },
  746. { TANGENT, "Tangent(" },
  747. { DRAWINV, "DrawInv " },
  748. { DRAWF, "DrawF " },
  749. { PI, "[pi]" },
  750. { GETKEY, "getKey" },
  751. { NEGATIVE, "[neg]" },
  752. { CONV_INT, "int(" },
  753. { ABS, "abs(" },
  754. { DETERMINANT, "det(" },
  755. { IDENTITY, "identity(" },
  756. { DIM, "dim(" },
  757. { SUM, "sum(" },
  758. { PROD, "prod(" },
  759. { NOT, "not(" },
  760. { IPART, "iPart(" },
  761. { FPART, "fPart(" },
  762. { SQR_ROOT, "[root]^2" },
  763. { CUBE_ROOT, "[root]^3" },
  764. { NATLOG, "ln(" },
  765. { ETOPOWER, "e^" },
  766. { LOGARITHM, "log(" },
  767. { POWER10, "10^(" },
  768. { SINE, "sin(" },
  769. { INVSIN, "asin(" },
  770. { COSINE, "cos(" },
  771. { INVCOSINE, "acos(" },
  772. { TANGENT_TRIG, "tan(" },
  773. { INVTANGENT, "atan(" },
  774. { HYP_SINE, "sinh(" },
  775. { HYP_ISINE, "asinh(" },
  776. { HYP_COSINE, "cosh(" },
  777. { HYP_ICOSINE, "acosh(" },
  778. { HYP_TANGENT, "tanh(" },
  779. { HYP_ITANGENT, "atanh(" },
  780. { LOGIC_ELSE, "Else" },
  781. { FILL, "Fill(" },
  782. { SORTA, "SortA(" },
  783. { SORTD, "SortD(" },
  784. { LIST, "[list]" },
  785. { PLOT1, "Plot1(" },
  786. { PLOT2, "Plot2(" },
  787. { PLOT3, "Plot3(" },
  788. { XTHROOT, "[root]^" },
  789. { VARSTATS_1, "1-Var Stats " },
  790. { VARSTATS_2, "2-Var Stats " },
  791. { LINREG1, "LinReg(a+bx) " },
  792. { EXPREG, "ExpReg " },
  793. { LNREG, "LnReg " },
  794. { PWRREG, "PwrReg " },
  795. { MEDMED, "Med-Med " },
  796. { QUADREG, "QuadReg " },
  797. { CLRLIST, "ClrList " },
  798. { CLRTABLE, "ClrTable" },
  799. { HISTOGRAM, "Histogram" },
  800. { XYLINE, "xyLine" },
  801. { SCATTER, "Scatter" },
  802. { LINREG2, "LinReg(ax+b) " },
  803. { RAND, "rand" },
  804. };
  805. /* two-byte variables */
  806. struct TwoByte CalcVars[] = {
  807. /* AsmPrgm (uncompiled) */
  808. { 0x6CBB, "AsmPrgm" },
  809. { 0x6DBB, "AsmPrgm" }, /* this means decompilation works, but compilation won't hit this */
  810. /* SysVar */
  811. { MAT_A, "[A]" },
  812. { MAT_B, "[B]" },
  813. { MAT_C, "[C]" },
  814. { MAT_D, "[D]" },
  815. { MAT_E, "[E]" },
  816. { MAT_F, "[F]" },
  817. { MAT_G, "[G]" },
  818. { MAT_H, "[H]" },
  819. { MAT_I, "[I]" },
  820. { MAT_J, "[J]" },
  821. { L1, "L1" },
  822. { L2, "L2" },
  823. { L3, "L3" },
  824. { L4, "L4" },
  825. { L5, "L5" },
  826. { L6, "L6" },
  827. { L7, "L7" },
  828. { L8, "L8" },
  829. { L9, "L9" },
  830. { L0, "L0" },
  831. { Y1, "Y1" },
  832. { Y2, "Y2" },
  833. { Y3, "Y3" },
  834. { Y4, "Y4" },
  835. { Y5, "Y5" },
  836. { Y6, "Y6" },
  837. { Y7, "Y7" },
  838. { Y8, "Y8" },
  839. { Y9, "Y9" },
  840. { Y0, "Y0" },
  841. { X1T, "X1T" },
  842. { Y1T, "Y1T" },
  843. { X2T, "X2T" },
  844. { Y2T, "Y2T" },
  845. { X3T, "X3T" },
  846. { Y3T, "Y3T" },
  847. { X4T, "X4T" },
  848. { Y4T, "Y4T" },
  849. { X5T, "X5T" },
  850. { Y5T, "Y5T" },
  851. { X6T, "X6T" },
  852. { Y6T, "Y6T" },
  853. { R1, "R1" },
  854. { R2, "R2" },
  855. { R3, "R3" },
  856. { R4, "R4" },
  857. { R5, "R5" },
  858. { R6, "R6" },
  859. { SYSVAR_U, "[u]" },
  860. { SYSVAR_V, "[v]" },
  861. { PIC1, "PIC1" },
  862. { PIC2, "PIC2" },
  863. { PIC3, "PIC3" },
  864. { PIC4, "PIC4" },
  865. { PIC5, "PIC5" },
  866. { PIC6, "PIC6" },
  867. { PIC7, "PIC7" },
  868. { PIC8, "PIC8" },
  869. { PIC9, "PIC9" },
  870. { PIC0, "PIC0" },
  871. { GDB1, "GDB1" },
  872. { GDB2, "GDB2" },
  873. { GDB3, "GDB3" },
  874. { GDB4, "GDB4" },
  875. { GDB5, "GDB5" },
  876. { GDB6, "GDB6" },
  877. { GDB7, "GDB7" },
  878. { GDB8, "GDB8" },
  879. { GDB9, "GDB9" },
  880. { GDB0, "GDB0" },
  881. /* finally, StatVars */
  882. { SX1, "Sx1" },
  883. { SX2, "Sx2" },
  884. { SXP, "Sxp" },
  885. { REGEQ, "RegEq" },
  886. { STAT_N, "[n]" },
  887. { MEANX, "mean(x)" },
  888. { SUMXSQUARED, "sum(x)^2" },
  889. { SUMX, "sum(x)" },
  890. { SX, "Sx" },
  891. { SIGMAX, "[sigma]x" },
  892. { MINX, "minX" },
  893. { MAXX, "maxX" },
  894. { MINY, "minY" },
  895. { MAXY, "maxY" },
  896. { MEANY, "mean(y)" },
  897. { SUMYSQUARED, "sum(y)^2" },
  898. { SUMY, "sum(y)" },
  899. { SY, "Sy" },
  900. { SIGMAY, "[sigma]y" },
  901. { SUMXY, "sum(xy)" },
  902. { SYSVAR_R, "[r]" },
  903. { MED, "Med" },
  904. { Q1, "Q1" },
  905. { Q3, "Q3" },
  906. { SYSVAR_A, "[a]" },
  907. { SYSVAR_B, "[b]" },
  908. { SYSVAR_C, "[c]" },
  909. { SYSVAR_D, "[d]" },
  910. { SYSVAR_E, "[stat_e]" }, /* because '[e]' refers to the constant e */
  911. { X1, "x1" },
  912. { X2, "x2" },
  913. { X3, "x3" },
  914. { Y1_1, "y1" },
  915. { Y2_1, "y2" },
  916. { Y3_1, "y3" },
  917. { SYSVAR_N, "[n]" }, /* somebody please tell me why there are so many variations on n */
  918. { SYSVAR_P, "[p]" },
  919. { SYSVAR_Z, "[z]" },
  920. { SYSVAR_T, "[t]" },
  921. { CHISQUARED, "[chi]^2" },
  922. { FIN, "[fin]" },
  923. { DF, "[df]" },
  924. { PHAT, "[p^]" },
  925. { PHAT1, "[p^1]" },
  926. { PHAT2, "[p^2]" },
  927. { MEANX1, "mean(x1)" },
  928. { N1, "[n1]" },
  929. { MEANX2, "mean(x2)" },
  930. { N2, "[n2]" },
  931. { LOWER, "[lower]" },
  932. { UPPER, "[upper]" },
  933. { SYSVAR_S, "[s]" },
  934. { RSQUARED, "r^2" },
  935. { CAPRSQUARED, "R^2" },
  936. { DF2, "[df]" }, /* somebody was high when they invented the token tables */
  937. { SS, "SS" },
  938. { DF3, "[df]" }, /* see previous comment */
  939. { SS1, "SS" }, /* again... */
  940. { MS1, "MS" }, /* and again! */
  941. /* graph data */
  942. { ZXSCL, "ZXscl" },
  943. { ZYSCL, "ZYscl" },
  944. { XSCL, "Xscl" },
  945. { YSCL, "Yscl" },
  946. { ZUNSTART, "ZUnStart" },
  947. { ZVNSTART, "ZVnStart" },
  948. { UNSTART, "UnStart" },
  949. { VNSTART, "VnStart" },
  950. { UNINVERSE, "Un-1" }, /* i read a ^-1, but it's actually a -1... */
  951. { VNINVERSE, "Vn-1" }, /* same as above */
  952. { ZXMIN, "ZXmin" },
  953. { ZXMAX, "ZXmax" },
  954. { ZYMIN, "ZYmin" },
  955. { ZYMAX, "ZYmax" },
  956. { ZTHETAMIN, "Ztheta_min"},
  957. { ZTHETAMAX, "Ztheta_max"},
  958. { ZTMIN, "ZTmin" },
  959. { ZTMAX, "ZTmax" },
  960. { XMIN, "Xmin" },
  961. { XMAX, "Xmax" },
  962. { YMIN, "Ymin" },
  963. { YMAX, "Ymax" },
  964. { TMIN, "Tmin" },
  965. { TMAX, "Tmax" },
  966. { THETAMIN, "theta_min" },
  967. { THETAMAX, "theta_max" },
  968. { TBLMIN, "TblMin" },
  969. { ZNMIN, "ZnMin" },
  970. { NMIN, "nMin" },
  971. { ZNMAX, "ZnMax" },
  972. { NMAX, "nMax" },
  973. { ZNSTART, "ZnStart" },
  974. { NSTART, "nStart" },
  975. { DELTATABLE, "delta_Tbl" },
  976. { ZTSTEP, "ZTstep" },
  977. { ZTHETASTEP, "Ztheta_step"},
  978. { TSTEP, "Tstep" },
  979. { THETASTEP, "theta_step"},
  980. { DELTAX, "delta_X" },
  981. { DELTAY, "delta_Y" },
  982. { XFACT, "XFact" },
  983. { YFACT, "YFact" },
  984. { TBLINPUT, "TblInput" },
  985. /* finance app */
  986. { SYSVAR_CAPN, "[N]" }, /* this is the N in the Finance app */
  987. { IPERCENT, "I%" },
  988. { PV, "PV" },
  989. { PMT, "PMT" },
  990. { FV, "FV" },
  991. { ZXRES, "ZXres" },
  992. { XRES, "Xres" },
  993. /* strings */
  994. { STR1, "STR1" },
  995. { STR2, "STR2" },
  996. { STR3, "STR3" },
  997. { STR4, "STR4" },
  998. { STR5, "STR5" },
  999. { STR6, "STR6" },
  1000. { STR7, "STR7" },
  1001. { STR8, "STR8" },
  1002. { STR9, "STR9" },
  1003. { STR0, "STR0" },
  1004. /* 7E Variables */
  1005. { SEQ, "Sequential" },
  1006. { SIMUL, "Simul" },
  1007. { POLARGC, "PolarGC" },
  1008. { RECTGC, "RectGC" },
  1009. { COORDON, "CoordOn" },
  1010. { COORDOFF, "CoordOff" },
  1011. { CONNECTED, "Connected" },
  1012. { DOT_7E, "Dot" },
  1013. { AXESON, "AxesOn" },
  1014. { AXESOFF, "AxesOff" },
  1015. { GRIDON, "GridOn" },
  1016. { GRIDOFF, "GridOff" },
  1017. { LABELON, "LabelOn" },
  1018. { LABELOFF, "LabelOff" },
  1019. { WEB, "Web" },
  1020. { TIME, "Time" },
  1021. { UVAXES, "uvAxes" },
  1022. { VWAXES, "vwAxes" },
  1023. { UWAXES, "uwAxes" },
  1024. /* BB Variables */
  1025. { NPV, "npv(" },
  1026. { IRR, "irr(" },
  1027. { BAL, "bal(" },
  1028. { SUMPRN, "sum_prn(" },
  1029. { SUMINT, "sum_int(" },
  1030. { TONOM, "->Nom" },
  1031. { TOEFF, "->Eff" },
  1032. { DBD, "dbd(" },
  1033. { LCM, "lcm(" },
  1034. { GCD, "gcd(" },
  1035. { RANDINT, "RandInt(" },
  1036. { RANDBIN, "RandBin(" },
  1037. { SUB, "sub(" },
  1038. { STDDEV, "StdDev(" },
  1039. { VARIANCE, "variance(" },
  1040. { INSTRING, "inString(" },
  1041. { NORMALCDF, "normalcdf(" },
  1042. { INVNORM, "invNorm(" },
  1043. { TCDF, "tcdf(" },
  1044. { XSQUCDF, "x^2cdf(" },
  1045. { FCDF, "fcdf(" },
  1046. { BINOMPDF, "binompdf(" },
  1047. { BINOMCDF, "binomcdf(" },
  1048. { POISSONPDF, "poissonpdf(" },
  1049. { POISSONCDF, "poissoncdf(" },
  1050. { GEOMETPDF, "geometpdf(" },
  1051. { GEOMETCDF, "geometcdf(" },
  1052. { NORMALPDF, "normalpdf(" },
  1053. { TPDF, "tpdf(" },
  1054. { XSQUPDF, "x^2pdf(" },
  1055. { FPDF, "fpdf(" },
  1056. { RANDNORM, "RandNorm(" },
  1057. { TVM_PMT, "tvm_pmt" },
  1058. { TVM_I_PERCENT, "tvm_i%" },
  1059. { TVM_PV, "tvm_PV" },
  1060. { TVM_N, "tvm_N" },
  1061. { TVM_FV, "tvm_FV" },
  1062. { CONJ, "conj(" },
  1063. { REAL, "real(" },
  1064. { IMAG, "imag(" },
  1065. { ANGLE, "angle(" },
  1066. { CUMSUM, "cumSum(" },
  1067. { EXPR, "expr(" },
  1068. { LENGTH, "length(" },
  1069. { DELTA_LIST, "delta_List(" },
  1070. { REF, "ref(" },
  1071. { RREF, "rref(" },
  1072. { TORECT, "->Rect" },
  1073. { TOPOLAR, "->Polar" },
  1074. { VAR_E, "[e]" }, /* e by itself is impossible, and dangerous (imagine Disp "Hello"!) */
  1075. { SINREG, "SinReg " },
  1076. { LOGISTIC, "Logistic " },
  1077. { LINREGTTEST, "LinRegTTest " },
  1078. { SHADENORM, "ShadeNorm(" },
  1079. { SHADE_T, "Shade_t(" },
  1080. { SHADEXSQU, "Shade_x^2(" },
  1081. { SHADEF, "ShadeF(" },
  1082. { MATRTOLIST, "Matr->list" },
  1083. { LISTTOMATR, "List->matr" },
  1084. { ZTEST, "Z-Test(" },
  1085. { TTEST, "T-Test " },
  1086. { TWO_SAMPZTEST, "2-SampZTest(" },
  1087. { ONE_PROPZTEST, "1-PropZTest(" },
  1088. { TWO_PROPZTEST, "2-PropZTest(" },
  1089. { XSQUTEST, "x^2_test(" },
  1090. { ZINTERVAL, "ZInterval" },
  1091. { TWO_SAMPZINT, "2-SampZInt(" },
  1092. { ONE_PROPZINT, "1-PropZInt(" },
  1093. { TWO_PROPZINT, "2-PropZInt(" },
  1094. { GRAPHSTYLE, "GraphStyle(" },
  1095. { TWO_SAMPTTEST, "2-SampTTest " },
  1096. { TWO_SAMPFTEST, "2-SampFTest_" },
  1097. { TINTERVAL, "TInterval " },
  1098. { TWO_SAMPTINT, "2-SampTInt " },
  1099. { SETUPEDITOR, "SetUpEditor " },
  1100. { PMT_END, "PMT_End" },
  1101. { PMT_BGN, "PMT_Bgn" },
  1102. { REAL_BB, "Real" },
  1103. { REPOWTHETAI, "re^[theta]i" },
  1104. { APLUSBI, "a+bi" },
  1105. { EXPRON, "ExprOn" },
  1106. { EXPROFF, "ExprOff" },
  1107. { CLRALLLISTS, "ClrAllLists" },
  1108. { GETCALC, "GetCalc(" },
  1109. { DELVAR, "DelVar " },
  1110. { EQUTOSTRING, "Equ->String(" },
  1111. { STRINGTOEQU, "String->Equ(" },
  1112. { CLEARENTRIES, "Clear Entries" },
  1113. { SELECT, "Select(" },
  1114. { ANOVA, "ANOVA(" },
  1115. { MODBOXPLOT, "ModBoxPlot" },
  1116. { NORMPROBPLOT, "NormProbPlot" },
  1117. };
  1118. /* Replacements
  1119. * Replacements are rules that define special characters that must be replaced
  1120. * with a token.
  1121. */
  1122. struct ConvertRule Replacements[] = {
  1123. { '"', DOUBLEQUOTE },
  1124. { '\'', APOSTROPHE },
  1125. { ',', COMMA },
  1126. { '?', QUESTIONMARK },
  1127. { ' ', SPACE },
  1128. { '=', TEST_EQUAL },
  1129. { '<', TEST_LESSTHAN },
  1130. { '>', TEST_HIGHTHAN },
  1131. { '+', ADD },
  1132. { '-', SUBTRACT },
  1133. { '/', DIVIDE_SLASH },
  1134. { '*', MULTIPLY },
  1135. { '!', FACTORIAL },
  1136. { ':', COLON },
  1137. { '\n', HARD_RETURN },
  1138. { '0', NUM_0 },
  1139. { '1', NUM_1 },
  1140. { '2', NUM_2 },
  1141. { '3', NUM_3 },
  1142. { '4', NUM_4 },
  1143. { '5', NUM_5 },
  1144. { '6', NUM_6 },
  1145. { '7', NUM_7 },
  1146. { '8', NUM_8 },
  1147. { '9', NUM_9 },
  1148. { '.', PERIOD },
  1149. { '[', LEFTSBRACK },
  1150. { ']', RIGHTSBRACK },
  1151. { '{', LEFTBRACE },
  1152. { '}', RIGHTBRACE },
  1153. { '(', LEFTBRACKET },
  1154. { ')', RIGHTBRACKET },
  1155. { '&', LOGIC_AND },
  1156. { '|', LOGIC_OR },
  1157. { '~', LOGIC_XOR },
  1158. { '=', TEST_EQUAL },
  1159. { '<', TEST_LESSTHAN },
  1160. { '>', TEST_HIGHTHAN },
  1161. { '^', POWEROF },
  1162. };