home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 5 / FreshFish_July-August1994.bin / bbs / gfx / magiccamera-1.0.lha / MagicCamera-1.0 / Docs / Scan.l < prev    next >
Text File  |  1994-06-11  |  6KB  |  268 lines

  1. /**********************************************************************
  2. *
  3. *    This file Copyright © 1993-1994 Dan Wesnor.  Distribution
  4. *    rights limited.  See included "Distribution" file for
  5. *    details.
  6. *
  7. *    No part of this file be compiled or otherwise used in any product 
  8. *    (commercial or not) wihout the expressed written consent of the
  9. *    copyright holder.
  10. *
  11. *    The inclusion of this file in the distributed archive is intended
  12. *    solely to aid authorized users in understanding the operation of
  13. *    Magic Camera rendering system.
  14. *
  15. *    For best reading set tab stops every 4 spaces.
  16. *
  17. **********************************************************************/
  18.  
  19.  
  20. integer        ([0-9]+)
  21. dreal        ([0-9]*"."[0-9]+)
  22. ereal        ([0-9]*"."[0-9]+[eE][+-]?[0-9]+)
  23. real        ({dreal}|{ereal})
  24. realint        ({real}|{integer})
  25. comment        ;.*
  26. ws            ([ \t])
  27. id            ([_]*[a-zA-Z]+[_.a-zA-Z0-9]*)
  28. filename    (\"[a-zA-Z0-9\/\'\._\\]+\")
  29. text        \"[^\"\n]*\"
  30.  
  31. %%
  32.  
  33. "/*"            /* open comment */
  34. "*/"            /* close comment */
  35.  
  36. {ws}            ;
  37.  
  38. {integer}        TYPE_INTEGER;
  39.  
  40. {real}            TYPE_REAL;
  41.  
  42. {comment}        ;
  43.  
  44. \<            OPEN_VEC;
  45. \>            CLOSE_VEC;
  46. \{            OPEN_BRACE;
  47. \}            CLOSE_BRACE;
  48. \(            OPEN_PAREN;
  49. \)            CLOSE_PAREN;
  50. \[            OPEN_BRACK;
  51. \]            CLOSE_BRACK;
  52. "="            P_EQSIGN;
  53. "+"            P_PLUS;
  54. "-"            P_MINUS;
  55. "*"            P_MULT;
  56. "/"            P_DIVIDE;
  57. ","            P_COMMA;
  58.  
  59. \n            
  60.  
  61. "include"    BEGIN(incl);
  62.  
  63. <incl>[ \t]*
  64. <incl>[^ \t\n]+    BEGIN(INITIAL);
  65.  
  66. <<EOF>>            if root file
  67.                     yyterminate();
  68.                 else
  69.                     return to previous file
  70.                     
  71.  
  72. acos                    P_ACOS;
  73. and                        P_AND;
  74. andnot                    P_ANDNOT;
  75. amb(ient)?                P_AMBIENT;
  76. a(lpha)?refl            P_AREFL;
  77. array                    P_ARRAY;
  78. asin                    P_ASIN;
  79. aspect                    P_ASPECT;
  80. a(lpha)?trans            P_ATRANS;
  81. atan                    P_ATAN;
  82. atan2                    P_ATAN2;
  83. axis                    P_AXIS;
  84. back                    P_BACK;
  85. billboard                P_BILLBOARD;
  86. bitmap                    P_BITMAP;
  87. blotch                    P_BLOTCH;
  88. box                        P_BOX;
  89. brick                    P_BRICK;
  90. bumpcy(linder)?            P_BUMPCY;
  91. bumpfl(at)?                P_BUMPFL;
  92. bumpsp(here)?            P_BUMPSP;
  93. check                    P_CHECK;
  94. ceil                    P_CEIL;
  95. child                    P_CHILD;
  96. closed                    P_CLOSED;
  97. clouds                    P_CLOUDS;
  98. color                    P_COLOR;
  99. cos                        P_COS;
  100. cosh                    P_COSH;
  101. csg                        P_CSG;
  102. deg2rad                    P_DEG2RAD;
  103. diff(use)?                P_DIFFUSE;
  104. dir(ect)?                P_DIRECT;
  105. dist(ance)?                P_DIST;
  106. dodiff(use)?            P_DODIFF;
  107. dorefl(ect)?            P_DOREFL;
  108. dotrans(mit)?            P_DOTRANS;
  109. end                        P_END;
  110. endobj(ect)?            P_ENDOBJECT;
  111. endscope                P_ENDSCOPE;
  112. exp                        P_EXP;
  113. extrude                    P_EXTRUDE;
  114. fastmemonly                P_FASTMEMONLY;
  115. file                    P_FILE;
  116. fill                    P_FILL;
  117. (fill)?first            P_FILLFIRST;
  118. (fill)?last                P_FILLLAST;
  119. filt(er)?                P_FILTER;
  120. floor                    P_FLOOR;
  121. flushverts                P_FLUSHVERTS;
  122. fog                        P_FOG;
  123. front                    P_FRONT;
  124. grain                    P_GRAIN;
  125. height                    P_HEIGHT;
  126. h(eight)?field            P_HFIELD;
  127. hfov                    P_HFOV;
  128. horizon                    P_HORIZON;
  129. hole                    P_HOLE;
  130. hseg(ment)?s            P_HSEGS;
  131. iff                        P_IFF;
  132. illum(inate)?            P_ILLUMINATE;
  133. in                        P_IN;
  134. index                    P_INDEX;
  135. instance                P_INSTANCE;
  136. int(eger)?                P_VINT;
  137. killobj(ect)?            P_KILLOBJECT;
  138. lamp                    P_LAMP;
  139. length                    P_LENGTH;
  140. loc(ation)?                P_LOC;
  141. lockobj(ect)?            P_LOCK;
  142. log                        P_LOG;
  143. log10                    P_LOG10;
  144. marble                    P_MARBLE;
  145. maxaadepth                P_MAXAADEPTH;
  146. maxaadiff                P_MAXAADIFF;
  147. maxobcube                P_MAXOBCUBE;
  148. maxoctdepth                P_MAXOCTDEPTH;
  149. mortar                    P_MORTAR;
  150. m(ortar)?size            P_MSIZE;
  151. name                    P_NAME;
  152. n(um)?centers            P_NCENTERS;
  153. norefl(ect)?            P_NOREFL;
  154. note                    P_NOTE;
  155. noshad(ows)?            P_NOSHAD;
  156. notrans(mit)?            P_NOTRANS;
  157. n(um)?rays                P_NRAYS;
  158. newscope                P_NEWSCOPE;
  159. numstars                P_NUMSTARS;
  160. object                    P_OBJECT;
  161. camera                    P_OBSERVER;
  162. octbuff                    P_OCTBUFF;
  163. offtree                    P_OFFTREE;
  164. origin                    P_ORIGIN;
  165. out                        P_OUT;
  166. p1                        P_P1;
  167. p2                        P_P2;
  168. p3                        P_P3;
  169. path                    P_PATH;
  170. patt(ern)?                P_PATTERN;
  171. patt(ern)?1                P_PATTERN1;
  172. patt(ern)?2                P_PATTERN2;
  173. s(pec)?(ular)?coef        P_PCOEF;
  174. s(pec)?(ular)?refl        P_PREFL;
  175. (per)?turb                P_PERTURB;
  176. phase                    P_PHASE;
  177. plane                    P_PLANE;
  178. point                    P_POINT;
  179. pointat                    P_POINTAT;
  180. pow(er)?                P_POWER;
  181. psphere                    P_PSPHERE;
  182. para(llelo)?gram        P_QUAD;
  183. radius                    P_RADIUS;
  184. rad2deg                    P_RAD2DEG;
  185. raw24                    P_RAW24LPO;
  186. real                    P_VREAL;
  187. refl(ect)?                P_REFLECT;
  188. reset                    P_RESET;
  189. res(olution)?            P_RES;
  190. ring                    P_RING;
  191. rise                    P_RISE;
  192. scale                    P_SCALE;
  193. seg(ment)?s                P_SEGMENTS;
  194. size                    P_SIZE;
  195. sin                        P_SIN;
  196. sinh                    P_SINH;
  197. skin                    P_SKIN;
  198. sky                        P_SKY;
  199. slice                    P_SLICE;
  200. smooth                    P_SMOOTH;
  201. smoothoff                P_SMOOTHOFF;
  202. smoothon                P_SMOOTHON;
  203. sphere                    P_SPHERE;
  204. spin                    P_SPIN;
  205. spread                    P_SPREAD;
  206. sqrt                    P_SQRT;
  207. starcolor                P_STARCOLOR;
  208. start                    P_START;
  209. sub                        P_SUB;
  210. subpatt(ern)?            P_SUBSURF;
  211. subtext(ure)?            P_SUBTEXT;
  212. tan                        P_TAN;
  213. tanh                    P_TANH;
  214. target                    P_TARGET;
  215. text(ure)?                P_TEXTURE;
  216. thin(ness)?                P_THIN;
  217. trans(mit)?                P_TRANSMIT;
  218. translate                P_TRANSLATE;
  219. tri(angle)                P_TRIANGLE;
  220. tube                    P_TUBE;
  221. undef(ine)?patt(ern)?    P_UNSURF;
  222. usepatt(ern)?            P_USESURF;
  223. up                        P_UP;
  224. v1                        P_V1;
  225. v2                        P_V2;
  226. v3                        P_V3;
  227. var(iable)?                P_VARIABLE;
  228. vector                    P_VECTOR;
  229. vertex                    P_VERTEX;
  230. vfov                    P_VFOV;
  231. vseg(ment)?s            P_VSEGS;
  232. waves                    P_WAVES;
  233. wood                    P_WOOD;
  234. wrapcy(linder)?            P_WRAPCY;
  235. wrapsp(here)?            P_WRAPSP;
  236. wrapfl(at)?                P_WRAPFL;
  237. xaxis                    P_XAXIS;
  238. xlen(gth)?                P_XLEN;
  239. xphase                    P_XPHASE;
  240. xrep(eat)?                P_XREP;
  241. rep(eat)?x                P_REPEATX;
  242. rep(eat)?y                P_REPEATY;
  243. xrot(ate)?                P_XROTATE;
  244. xsize                    P_XSIZE;
  245. yaxis                    P_YAXIS;
  246. ylen(gth)?                P_YLEN;
  247. yoffset                    P_YOFFSET;
  248. yphase                    P_YPHASE;
  249. yrep(eat)?                P_YREP;
  250. yrot(ate)?                P_YROTATE;
  251. ysize                    P_YSIZE;
  252. zenith                    P_ZENITH;
  253. zoffset                    P_ZOFFSET;
  254. zphase                    P_ZPHASE;
  255. zrot(ate)?                P_ZROTATE;
  256. zsize                    P_ZSIZE;
  257.  
  258. {id}            TYPE_IDENT;
  259.  
  260. {filename}        TYPE_FILENAME;
  261.  
  262. {text}            TYPE_TEXT;
  263.  
  264. .            yyerror(MsgBuff, "Unrecognized lexical token %s on line %d");
  265.  
  266. %%
  267.  
  268.