home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Educational / RasMol / Source / tokens.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-08-13  |  15.1 KB  |  513 lines

  1. /* tokens.h
  2.  * RasMol2 Molecular Graphics
  3.  * Roger Sayle, August 1995
  4.  * Version 2.6
  5.  */
  6.  
  7. /* Lexeme Tokens */
  8. #define IdentTok       256
  9. #define NumberTok      257
  10. #define FloatTok       258
  11. #define StringTok      259
  12.  
  13. /* Command Tokens */
  14. #define BackboneTok    260
  15. #define CartoonTok     261
  16. #define CentreTok      262
  17. #define ClipboardTok   263
  18. #define ColourTok      264
  19. #define ConnectTok     265
  20. #define DashTok        266
  21. #define DefineTok      267
  22. #define DisplayTok     268
  23. #define EchoTok        269
  24. #define HelpTok        270
  25. #define LabelTok       271
  26. #define LoadTok        272
  27. #define MonitorTok     273
  28. #define PrintTok       274
  29. #define QuitTok        275
  30. #define RefreshTok     276
  31. #define RenumTok       277
  32. #define ResetTok       278
  33. #define ResizeTok      279
  34. #define RestrictTok    280
  35. #define RotateTok      281
  36. #define SaveTok        282
  37. #define ScriptTok      283
  38. #define SelectTok      284
  39. #define SetTok         285
  40. #define ShowTok        286
  41. #define SlabTok        287
  42. #define SourceTok      288
  43. #define SpacefillTok   289
  44. #define StructureTok   290
  45. #define SymmetryTok    291
  46. #define TraceTok       292
  47. #define TranslateTok   293
  48. #define WaitTok        294
  49. #define WireframeTok   295
  50. #define WriteTok       296
  51. #define ZapTok         297
  52. #define ZoomTok        298
  53.  
  54. /* Predicate Tokens */
  55. #define IsPredTok(x)   (((x)>=300) && ((x)<=338))
  56. #define PredTokOrd(x)  ((x)-300)
  57. #define PredTokChr(x)  ((x)+300)
  58.  
  59. #define AlphaTok       300
  60. #define AminoTok       301
  61. #define ATTok          302
  62. #define BondedTok      303
  63. #define CGTok          304
  64. #define CystineTok     305
  65. #define DNATok         306
  66. #define HelixTok       307
  67. #define HeteroTok      308
  68. #define HydrogenTok    309
  69. #define IonTok         310
  70. #define LigandTok      311
  71. #define MainChainTok   312
  72. #define NucleicTok     313
  73. #define ProteinTok     314
  74. #define PurineTok      315
  75. #define PyrimidineTok  316
  76. #define RNATok         317
  77. #define SelectedTok    318
  78. #define SheetTok       319
  79. #define SidechainTok   320
  80. #define SolventTok     321
  81. #define TurnTok        322
  82. #define WaterTok       323
  83.  
  84. #define AcidicTok      324
  85. #define AcyclicTok     325
  86. #define AliphaticTok   326
  87. #define AromaticTok    327
  88. #define BasicTok       328
  89. #define BuriedTok      329
  90. #define ChargedTok     330
  91. #define CyclicTok      331
  92. #define HydrophobicTok 332
  93. #define LargeTok       333
  94. #define MediumTok      334
  95. #define NeutralTok     335
  96. #define PolarTok       336
  97. #define SmallTok       337
  98. #define SurfaceTok     338
  99.  
  100.  
  101. /* Property Tokens */
  102. #define IsPropTok(x)   (((x)>=340) && ((x)<=345))
  103. #define TemperatureTok 340
  104. #define RadiusTok      341
  105. #define AtomNoTok      342
  106. #define ElemNoTok      343
  107. #define ModelTok       344
  108. #define ResNoTok       345
  109.  
  110. /* File Format Tokens */
  111. /* Warning! Tokens are related to Format values */
  112. #define IsMoleculeFormat(x)  (((x)>=350) && ((x)<=365))
  113.  
  114. #define PDBTok         350
  115. #define MacroModelTok  351
  116. #define GaussianTok    352
  117. #define AlchemyTok     353
  118. #define NMRPDBTok      354
  119. #define CharmmTok      355
  120. #define BiosymTok      356
  121. #define MOPACTok       357
  122. #define SHELXTok       358
  123. #define Mol2Tok        359
  124. #define FDATTok        360
  125. #define MMDBTok        361
  126. #define MDLTok         362
  127. #define XYZTok         363
  128. #define CIFTok         364
  129. #define CEXTok         365
  130.  
  131. /* Raster Tokens */
  132. #define IsImageFormat(x) (((x)>=366) && ((x)<=378))
  133. #define GIFTok         366
  134. #define PPMTok         367
  135. #define SUNTok         368
  136. #define SUNRLETok      369
  137. #define EPSFTok        370
  138. #define PICTTok        371
  139. #define IRISTok        372
  140. #define BMPTok         373
  141. #define MonoPSTok      374
  142. #define VectPSTok      375
  143. #define KinemageTok    376
  144. #define MolScriptTok   377
  145. #define POVRayTok      378
  146.  
  147. /* Feature Tokens */
  148. #define AtomTok        380
  149. #define BondTok        381
  150. #define DotsTok        382
  151. #define HBondTok       383
  152. #define RibbonTok      384
  153. #define SSBondTok      385
  154. #define Ribbon1Tok     386
  155. #define Ribbon2Tok     387
  156.  
  157. /* Expression Tokens */
  158. #define TrueTok        390
  159. #define FalseTok       391
  160. #define AllTok         392
  161. #define NoneTok        393
  162. #define AndTok         394
  163. #define OrTok          395
  164. #define NotTok         396
  165. #define WithinTok      397
  166. #define XorTok         398
  167.  
  168. /* Colour Tokens */
  169. #define BlueTok        400
  170. #define BlueTintTok    401
  171. #define BlackTok       402
  172. #define BrownTok       403
  173. #define CyanTok        404
  174. #define GoldTok        405
  175. #define GrayTok        406
  176. #define GreenTok       407
  177. #define GreenblueTok   408
  178. #define GreenTintTok   409
  179. #define HotPinkTok     410
  180. #define MagentaTok     411
  181. #define OrangeTok      412
  182. #define PinkTok        413
  183. #define PinkTintTok    414
  184. #define PurpleTok      415
  185. #define RedTok         416
  186. #define RedorangeTok   417
  187. #define SeaTok         418
  188. #define SkyTok         419
  189. #define VioletTok      420
  190. #define WhiteTok       421
  191. #define YellowTok      422
  192. #define YellowTintTok  423
  193.  
  194. #define CPKTok         424
  195. #define ShapelyTok     425
  196. #define UserTok        426
  197. #define GroupTok       427
  198. #define ChainTok       428
  199. #define TypeTok        429
  200. #define PotentialTok   430
  201. #define ChargeTok      431
  202.  
  203. /* Variable Tokens */
  204. #define AmbientTok     440
  205. #define AxesTok        441
  206. #define BackgroundTok  442
  207. #define BondModeTok    443
  208. #define BoundBoxTok    444
  209. #define FontSizeTok    445
  210. #define HourGlassTok   446
  211. #define MenusTok       447
  212. #define MouseTok       448
  213. #define PickingTok     449
  214. #define ShadowTok      450
  215. #define SlabModeTok    451
  216. #define SpecularTok    452
  217. #define SpecPowerTok   453
  218. #define StrandsTok     454
  219. #define UnitCellTok    455
  220.  
  221. /* SlabMode Tokens */
  222. #define RejectTok      460
  223. #define HalfTok        461
  224. #define HollowTok      462
  225. #define SolidTok       463
  226. #define SectionTok     464
  227.  
  228. /* MouseMode Tokens */
  229. #define RasMolTok      465
  230. #define InsightTok     466
  231. #define QuantaTok      467
  232.  
  233. /* Information Tokens */
  234. #define InfoTok        470
  235. #define SequenceTok    471
  236. #define VersionTok     472
  237.  
  238. /* Display Mode Tokens */
  239. #define NormalTok      475
  240. #define StereoTok      476
  241. #define MonoTok        477
  242.  
  243. /* Axis Tokens */
  244. #define XTok           480
  245. #define YTok           481
  246. #define ZTok           482
  247.  
  248. /* Picking Tokens */
  249. #define IdentifyTok    485
  250. #define DistanceTok    486
  251. #define AngleTok       487
  252. #define TorsionTok     488
  253.  
  254. /* Misc Tokens */
  255. #define InLineTok      490
  256.  
  257.  
  258. typedef struct {
  259.                 char *ident;
  260.                 int token;
  261.                } KeywordEntry;
  262.  
  263.  
  264. #define MAXKEYLEN 11
  265. static int KeyLen[MAXKEYLEN+1] = {
  266.         0, 3, 8, 28, 61, 97, 148, 181, 207, 223, 227, 233 };
  267.  
  268. static KeywordEntry Keyword[] = {
  269.             { "X",  XTok },
  270.             { "Y",  YTok },
  271.             { "Z",  ZTok },  /* 3 */
  272.  
  273.             { "AT", ATTok   },
  274.             { "CG", CGTok   },
  275.             { "ON", TrueTok },
  276.             { "OR", OrTok   },
  277.             { "PS", EPSFTok },  /* 8 */
  278.  
  279.             { "ALL", AllTok   },
  280.             { "AND", AndTok   },
  281.             { "BMP", BMPTok   },
  282.             { "CEX", CEXTok   },
  283.             { "CIF", CIFTok   },
  284.             { "CPK", CPKTok   },
  285.             { "DNA", DNATok   },
  286.             { "GIF", GIFTok   },
  287.             { "ION", IonTok   },
  288.             { "MDL", MDLTok   },
  289.             { "NOT", NotTok   },
  290.             { "OFF", FalseTok },
  291.             { "PDB", PDBTok   },
  292.             { "PPM", PPMTok   },
  293.             { "RED", RedTok   },
  294.             { "RNA", RNATok   },
  295.             { "SET", SetTok   },
  296.             { "SUN", SUNTok   },
  297.             { "XYZ", XYZTok   },
  298.             { "ZAP", ZapTok   }, /* 28 */
  299.  
  300.             { "ATOM", AtomTok },
  301.             { "AXES", AxesTok },
  302.             { "AXIS", AxesTok },
  303.             { "BLUE", BlueTok },
  304.             { "BOND", BondTok },
  305.             { "CYAN", CyanTok },
  306.             { "DASH", DashTok },
  307.             { "DOTS", DotsTok },
  308.             { "ECHO", EchoTok },
  309.             { "EPSF", EPSFTok },
  310.             { "EXIT", QuitTok },
  311.             { "FDAT", FDATTok },
  312.             { "HALF", HalfTok },
  313.             { "HELP", HelpTok },
  314.             { "INFO", InfoTok },
  315.             { "IONS", IonTok  },
  316.             { "IRIS", IRISTok },
  317.             { "LOAD", LoadTok },
  318.             { "MMDB", MMDBTok },
  319.             { "MOL2", Mol2Tok },
  320.             { "MONO", MonoTok },
  321.             { "NONE", NoneTok },
  322.             { "PICT", PICTTok },
  323.             { "QUIT", QuitTok },
  324.             { "SAVE", SaveTok },
  325.             { "SHOW", ShowTok },
  326.             { "SLAB", SlabTok },
  327.             { "TRUE", TrueTok },
  328.             { "TURN", TurnTok },
  329.             { "TYPE", TypeTok },
  330.             { "USER", UserTok },
  331.             { "WAIT", WaitTok },
  332.             { "ZOOM", ZoomTok }, /* 61 */
  333.  
  334.             { "ALPHA", AlphaTok    },
  335.             { "AMINO", AminoTok    },
  336.             { "ANGLE", AngleTok    },
  337.             { "ATOMS", AtomTok     },
  338.             { "BASIC", BasicTok    },
  339.             { "BLACK", BlackTok    },
  340.             { "BONDS", BondTok     },
  341.             { "CHAIN", ChainTok    },
  342.             { "COLOR", ColourTok   },
  343.             { "FALSE", FalseTok    },
  344.             { "GREEN", GreenTok    },
  345.             { "GROUP", GroupTok    },
  346.             { "HBOND", HBondTok    },
  347.             { "HELIX", HelixTok    },
  348.             { "IDENT", IdentifyTok },
  349.             { "LABEL", LabelTok    },
  350.             { "LARGE", LargeTok    },
  351.             { "MENUS", MenusTok    },
  352.             { "MODEL", ModelTok    },
  353.             { "MOPAC", MOPACTok    },
  354.             { "MOUSE", MouseTok    },
  355.             { "PAUSE", WaitTok     },
  356.             { "POLAR", PolarTok    },
  357.             { "PRINT", PrintTok    },
  358.             { "RENUM", RenumTok    },
  359.             { "RESET", ResetTok    },
  360.             { "RESNO", ResNoTok    },
  361.             { "SHEET", SheetTok    },
  362.             { "SHELX", SHELXTok    },
  363.             { "SMALL", SmallTok    },
  364.             { "SOLID", SolidTok    },
  365.             { "TRACE", TraceTok    },
  366.             { "TURNS", TurnTok     },
  367.             { "WATER", WaterTok    },
  368.             { "WHITE", WhiteTok    },
  369.             { "WRITE", WriteTok    },  /* 97 */
  370.  
  371.             { "ACIDIC", AcidicTok },
  372.             { "ANGLES", AngleTok  },
  373.             { "ATOMNO", AtomNoTok },
  374.             { "BIOSYM", BiosymTok },
  375.             { "BONDED", BondedTok },
  376.             { "BURIED", BuriedTok },
  377.             { "CENTER", CentreTok },
  378.             { "CENTRE", CentreTok },
  379.             { "CHARGE", ChargeTok },
  380.             { "CHARMM", CharmmTok },
  381.             { "COLORS", ColourTok },
  382.             { "COLOUR", ColourTok },
  383.             { "CYCLIC", CyclicTok },
  384.             { "DASHES", DashTok   },
  385.             { "DEFINE", DefineTok },
  386.             { "ELEMNO", ElemNoTok },
  387.             { "HBONDS", HBondTok  },
  388.             { "HETERO", HeteroTok },
  389.             { "HOLLOW", HollowTok },
  390.             { "INLINE", InLineTok },
  391.             { "LABELS", LabelTok  },
  392.             { "LIGAND", LigandTok },
  393.             { "MEDIUM", MediumTok },
  394.             { "MONOPS", MonoPSTok },
  395.             { "NMRPDB", NMRPDBTok },
  396.             { "NORMAL", NormalTok },
  397.             { "ORANGE", OrangeTok },
  398.             { "POVRAY", POVRayTok },
  399.             { "PURINE", PurineTok },
  400.             { "PURPLE", PurpleTok },
  401.             { "QUANTA", QuantaTok },
  402.             { "RADIUS", RadiusTok },
  403.             { "RASMOL", RasMolTok },
  404.             { "RASWIN", RasMolTok },
  405.             { "REJECT", RejectTok },
  406.             { "RESIZE", ResizeTok },
  407.             { "RIBBON", RibbonTok },
  408.             { "ROTATE", RotateTok },
  409.             { "SCRIPT", ScriptTok },
  410.             { "SELECT", SelectTok },
  411.             { "SHADOW", ShadowTok },
  412.             { "SHEETS", SheetTok  },
  413.             { "SOURCE", SourceTok },
  414.             { "SSBOND", SSBondTok },
  415.             { "STEREO", StereoTok },
  416.             { "SUNRLE", SUNRLETok },
  417.             { "VECTPS", VectPSTok },
  418.             { "VIOLET", VioletTok },
  419.             { "WATERS", WaterTok  },
  420.             { "WITHIN", WithinTok },
  421.             { "YELLOW", YellowTok },  /* 148 */
  422.  
  423.             { "ACYCLIC", AcyclicTok },
  424.             { "ALCHEMY", AlchemyTok },
  425.             { "AMBIENT", AmbientTok },
  426.             { "CARTOON", CartoonTok },
  427.             { "CHARGED", ChargedTok },
  428.             { "CHARGES", ChargeTok  },
  429.             { "COLOURS", ColourTok  },
  430.             { "CONNECT", ConnectTok },
  431.             { "CYSTINE", CystineTok },
  432.             { "DISPLAY", DisplayTok },
  433.             { "HELICES", HelixTok   },
  434.             { "INSIGHT", InsightTok },
  435.             { "LIGANDS", LigandTok  },
  436.             { "MAGENTA", MagentaTok },
  437.             { "MONITOR", MonitorTok },
  438.             { "NEUTRAL", NeutralTok },
  439.             { "NUCLEIC", NucleicTok },
  440.             { "PICKING", PickingTok },
  441.             { "PROTEIN", ProteinTok },
  442.             { "PURINES", PurineTok  },
  443.             { "REFRESH", RefreshTok },
  444.             { "RESIDUE", GroupTok   },
  445.             { "RIBBON1", Ribbon1Tok },
  446.             { "RIBBON2", Ribbon2Tok },
  447.             { "RIBBONS", RibbonTok  },
  448.             { "SECTION", SectionTok },
  449.             { "SHADOWS", ShadowTok  },
  450.             { "SHAPELY", ShapelyTok },
  451.             { "SOLVENT", SolventTok },
  452.             { "SSBONDS", SSBondTok  },
  453.             { "STRANDS", StrandsTok },
  454.             { "SURFACE", SurfaceTok },  
  455.             { "TORSION", TorsionTok }, /* 181 */
  456.  
  457.             { "AROMATIC", AromaticTok },
  458.             { "BACKBONE", BackboneTok },
  459.             { "BONDMODE", BondModeTok },
  460.             { "BOUNDBOX", BoundBoxTok },
  461.             { "CARTOONS", CartoonTok  },
  462.             { "DISTANCE", DistanceTok },
  463.             { "FONTSIZE", FontSizeTok },
  464.             { "GAUSSIAN", GaussianTok },
  465.             { "HYDROGEN", HydrogenTok },
  466.             { "IDENTIFY", IdentifyTok },
  467.             { "KINEMAGE", KinemageTok },
  468.             { "MONITORS", MonitorTok  },
  469.             { "NEGATIVE", AcidicTok   },
  470.             { "POSITIVE", BasicTok    },
  471.             { "RENUMBER", RenumTok    },
  472.             { "RESTRICT", RestrictTok },
  473.             { "RIBBONS1", Ribbon1Tok  },
  474.             { "RIBBONS2", Ribbon2Tok  },
  475.             { "SELECTED", SelectedTok },
  476.             { "SEQUENCE", SequenceTok },
  477.             { "SLABMODE", SlabModeTok },
  478.             { "SOLVENTS", SolventTok  },
  479.             { "SPECULAR", SpecularTok }, 
  480.             { "SYMMETRY", SymmetryTok },
  481.             { "TORSIONS", TorsionTok  },
  482.             { "UNITCELL", UnitCellTok },  /* 207 */
  483.  
  484.             { "ALIPHATIC", AliphaticTok },
  485.             { "CLIPBOARD", ClipboardTok },
  486.             { "DISTANCES", DistanceTok  },
  487.             { "GREENBLUE", GreenblueTok },
  488.             { "HOURGLASS", HourGlassTok },
  489.             { "MAINCHAIN", MainChainTok },
  490.             { "MOLSCRIPT", MolScriptTok },
  491.             { "MOUSEMODE", MouseTok     },
  492.             { "POTENTIAL", PotentialTok },
  493.             { "REDORANGE", RedorangeTok },
  494.             { "SIDECHAIN", SidechainTok },
  495.             { "SPACEFILL", SpacefillTok },
  496.             { "SPECPOWER", SpecPowerTok },
  497.             { "STRUCTURE", StructureTok },
  498.             { "TRANSLATE", TranslateTok },
  499.             { "WIREFRAME", WireframeTok },  /* 223 */
  500.  
  501.             { "BACKGROUND", BackgroundTok },
  502.             { "MACROMODEL", MacroModelTok },
  503.             { "MONOCHROME", MonoTok       },
  504.             { "PYRIMIDINE", PyrimidineTok },  /* 227 */
  505.  
  506.             { "BOUNDINGBOX", BoundBoxTok    },
  507.             { "HYDROPHOBIC", HydrophobicTok },
  508.             { "INFORMATION", InfoTok        },
  509.             { "PYRIMIDINES", PyrimidineTok, },
  510.             { "TEMPERATURE", TemperatureTok }  /* 233 */
  511.                 };
  512.  
  513.