scan.l 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858
  1. %{
  2. {
  3. $Id: scan.l,v 1.7 2004/09/08 22:21:41 carl Exp $
  4. Copyright (c) 1998-2000 by Florian Klaempfl
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************}
  17. unit scan;
  18. interface
  19. uses
  20. strings,
  21. lexlib,yacclib;
  22. const
  23. version = '1.0.0';
  24. type
  25. Char=system.char;
  26. ttyp = (
  27. t_id,
  28. { p contains the string }
  29. t_arraydef,
  30. { }
  31. t_pointerdef,
  32. { p1 contains the definition
  33. if in type overrider
  34. or nothing for args
  35. }
  36. t_addrdef,
  37. t_void,
  38. { no field }
  39. t_dec,
  40. { }
  41. t_declist,
  42. { p1 is t_dec
  43. next if exists }
  44. t_memberdec,
  45. { p1 is type specifier
  46. p2 is declarator_list }
  47. t_structdef,
  48. { }
  49. t_memberdeclist,
  50. { p1 is memberdec
  51. next is next if it exist }
  52. t_procdef,
  53. { }
  54. t_uniondef,
  55. { }
  56. t_enumdef,
  57. { }
  58. t_enumlist,
  59. { }
  60. t_preop,
  61. { p contains the operator string
  62. p1 contains the right expr }
  63. t_bop,
  64. { p contains the operator string
  65. p1 contains the left expr
  66. p2 contains the right expr }
  67. t_arrayop,
  68. {
  69. p1 contains the array expr
  70. p2 contains the index expressions }
  71. t_callop,
  72. {
  73. p1 contains the proc expr
  74. p2 contains the index expressions }
  75. t_arg,
  76. {
  77. p1 contain the typedef
  78. p2 the declarator (t_dec)
  79. }
  80. t_arglist,
  81. { }
  82. t_funexprlist,
  83. { }
  84. t_exprlist,
  85. { p1 contains the expr
  86. next contains the next if it exists }
  87. t_ifexpr,
  88. { p1 contains the condition expr
  89. p2 contains the if branch
  90. p3 contains the else branch }
  91. t_funcname,
  92. { p1 contains the function dname
  93. p2 contains the funexprlist
  94. p3 possibly contains the return type }
  95. t_typespec,
  96. { p1 is the type itself
  97. p2 the typecast expr }
  98. t_size_specifier,
  99. { p1 expr for size }
  100. t_default_value,
  101. { p1 expr for value }
  102. t_statement_list,
  103. { p1 is the statement
  104. next is next if it exist }
  105. t_whilenode,
  106. t_fornode,
  107. t_dowhilenode,
  108. t_switchnode,
  109. t_gotonode,
  110. t_continuenode,
  111. t_breaknode
  112. );
  113. const
  114. ttypstr: array[ttyp] of string =
  115. (
  116. 't_id',
  117. 't_arraydef',
  118. 't_pointerdef',
  119. 't_addrdef',
  120. 't_void',
  121. 't_dec',
  122. 't_declist',
  123. 't_memberdec',
  124. 't_structdef',
  125. 't_memberdeclist',
  126. 't_procdef',
  127. 't_uniondef',
  128. 't_enumdef',
  129. 't_enumlist',
  130. 't_preop',
  131. 't_bop',
  132. 't_arrayop',
  133. 't_callop',
  134. 't_arg',
  135. 't_arglist',
  136. 't_funexprlist',
  137. 't_exprlist',
  138. 't_ifexpr',
  139. 't_funcname',
  140. 't_typespec',
  141. 't_size_specifier',
  142. 't_default_value',
  143. 't_statement_list',
  144. 't_whilenode',
  145. 't_fornode',
  146. 't_dowhilenode',
  147. 't_switchnode',
  148. 't_gotonode',
  149. 't_continuenode',
  150. 't_breaknode'
  151. );
  152. type
  153. presobject = ^tresobject;
  154. tresobject = object
  155. typ : ttyp;
  156. p : pchar;
  157. next : presobject;
  158. p1,p2,p3 : presobject;
  159. { name of int/real, then no T prefix is required }
  160. intname : boolean;
  161. constructor init_no(t : ttyp);
  162. constructor init_one(t : ttyp;_p1 : presobject);
  163. constructor init_two(t : ttyp;_p1,_p2 : presobject);
  164. constructor init_three(t : ttyp;_p1,_p2,_p3 : presobject);
  165. constructor init_id(const s : string);
  166. constructor init_intid(const s : string);
  167. constructor init_bop(const s : string;_p1,_p2 : presobject);
  168. constructor init_preop(const s : string;_p1 : presobject);
  169. procedure setstr(const s:string);
  170. function str : string;
  171. function strlength : byte;
  172. function get_copy : presobject;
  173. { can this ve considered as a constant ? }
  174. function is_const : boolean;
  175. destructor done;
  176. end;
  177. tblocktype = (bt_type,bt_const,bt_var,bt_func,bt_no);
  178. var
  179. infile : string;
  180. outfile : text;
  181. c : char;
  182. aktspace : string;
  183. block_type : tblocktype;
  184. commentstr: string;
  185. const
  186. in_define : boolean = false;
  187. { True if define spans to the next line }
  188. cont_line : boolean = false;
  189. { 1 after define; 2 after the ID to print the first separating space }
  190. in_space_define : byte = 0;
  191. arglevel : longint = 0;
  192. function yylex : integer;
  193. function act_token : string;
  194. procedure internalerror(i : integer);
  195. function strpnew(const s : string) : pchar;
  196. procedure writetree(p: presobject);
  197. implementation
  198. uses
  199. options,converu;
  200. const
  201. newline = #10;
  202. procedure writeentry(p: presobject; var currentlevel: integer);
  203. begin
  204. if assigned(p^.p1) then
  205. begin
  206. WriteLn(' Entry p1[',ttypstr[p^.p1^.typ],']',p^.p1^.str);
  207. end;
  208. if assigned(p^.p2) then
  209. begin
  210. WriteLn(' Entry p2[',ttypstr[p^.p2^.typ],']',p^.p2^.str);
  211. end;
  212. if assigned(p^.p3) then
  213. begin
  214. WriteLn(' Entry p3[',ttypstr[p^.p3^.typ],']',p^.p3^.str);
  215. end;
  216. end;
  217. procedure writetree(p: presobject);
  218. var
  219. i : integer;
  220. localp: presobject;
  221. localp1: presobject;
  222. currentlevel : integer;
  223. begin
  224. localp:=p;
  225. currentlevel:=0;
  226. while assigned(localp) do
  227. begin
  228. WriteLn('Entry[',ttypstr[localp^.typ],']',localp^.str);
  229. case localp^.typ of
  230. { Some arguments sharing the same type }
  231. t_arglist:
  232. begin
  233. localp1:=localp;
  234. while assigned(localp1) do
  235. begin
  236. writeentry(localp1,currentlevel);
  237. localp1:=localp1^.p1;
  238. end;
  239. end;
  240. end;
  241. localp:=localp^.next;
  242. end;
  243. end;
  244. procedure internalerror(i : integer);
  245. begin
  246. writeln('Internal error ',i,' in line ',yylineno);
  247. halt(1);
  248. end;
  249. procedure commenteof;
  250. begin
  251. writeln('unexpected EOF inside comment at line ',yylineno);
  252. end;
  253. procedure copy_until_eol;
  254. begin
  255. c:=get_char;
  256. while c<>newline do
  257. begin
  258. write(outfile,c);
  259. c:=get_char;
  260. end;
  261. end;
  262. procedure skip_until_eol;
  263. begin
  264. c:=get_char;
  265. while c<>newline do
  266. c:=get_char;
  267. end;
  268. function strpnew(const s : string) : pchar;
  269. var
  270. p : pchar;
  271. begin
  272. getmem(p,length(s)+1);
  273. strpcopy(p,s);
  274. strpnew:=p;
  275. end;
  276. constructor tresobject.init_preop(const s : string;_p1 : presobject);
  277. begin
  278. typ:=t_preop;
  279. p:=strpnew(s);
  280. p1:=_p1;
  281. p2:=nil;
  282. p3:=nil;
  283. next:=nil;
  284. intname:=false;
  285. end;
  286. constructor tresobject.init_bop(const s : string;_p1,_p2 : presobject);
  287. begin
  288. typ:=t_bop;
  289. p:=strpnew(s);
  290. p1:=_p1;
  291. p2:=_p2;
  292. p3:=nil;
  293. next:=nil;
  294. intname:=false;
  295. end;
  296. constructor tresobject.init_id(const s : string);
  297. begin
  298. typ:=t_id;
  299. p:=strpnew(s);
  300. p1:=nil;
  301. p2:=nil;
  302. p3:=nil;
  303. next:=nil;
  304. intname:=false;
  305. end;
  306. constructor tresobject.init_intid(const s : string);
  307. begin
  308. typ:=t_id;
  309. p:=strpnew(s);
  310. p1:=nil;
  311. p2:=nil;
  312. p3:=nil;
  313. next:=nil;
  314. intname:=true;
  315. end;
  316. constructor tresobject.init_two(t : ttyp;_p1,_p2 : presobject);
  317. begin
  318. typ:=t;
  319. p1:=_p1;
  320. p2:=_p2;
  321. p3:=nil;
  322. p:=nil;
  323. next:=nil;
  324. intname:=false;
  325. end;
  326. constructor tresobject.init_three(t : ttyp;_p1,_p2,_p3 : presobject);
  327. begin
  328. typ:=t;
  329. p1:=_p1;
  330. p2:=_p2;
  331. p3:=_p3;
  332. p:=nil;
  333. next:=nil;
  334. intname:=false;
  335. end;
  336. constructor tresobject.init_one(t : ttyp;_p1 : presobject);
  337. begin
  338. typ:=t;
  339. p1:=_p1;
  340. p2:=nil;
  341. p3:=nil;
  342. next:=nil;
  343. p:=nil;
  344. intname:=false;
  345. end;
  346. constructor tresobject.init_no(t : ttyp);
  347. begin
  348. typ:=t;
  349. p:=nil;
  350. p1:=nil;
  351. p2:=nil;
  352. p3:=nil;
  353. next:=nil;
  354. intname:=false;
  355. end;
  356. procedure tresobject.setstr(const s : string);
  357. begin
  358. if assigned(p) then
  359. strdispose(p);
  360. p:=strpnew(s);
  361. end;
  362. function tresobject.str : string;
  363. begin
  364. str:=strpas(p);
  365. end;
  366. function tresobject.strlength : byte;
  367. begin
  368. if assigned(p) then
  369. strlength:=strlen(p)
  370. else
  371. strlength:=0;
  372. end;
  373. { can this ve considered as a constant ? }
  374. function tresobject.is_const : boolean;
  375. begin
  376. case typ of
  377. t_id,t_void :
  378. is_const:=true;
  379. t_preop :
  380. is_const:= ((str='-') or (str=' not ')) and p1^.is_const;
  381. t_bop :
  382. is_const:= p2^.is_const and p1^.is_const;
  383. else
  384. is_const:=false;
  385. end;
  386. end;
  387. function tresobject.get_copy : presobject;
  388. var
  389. newres : presobject;
  390. begin
  391. newres:=new(presobject,init_no(typ));
  392. newres^.intname:=intname;
  393. if assigned(p) then
  394. newres^.p:=strnew(p);
  395. if assigned(p1) then
  396. newres^.p1:=p1^.get_copy;
  397. if assigned(p2) then
  398. newres^.p2:=p2^.get_copy;
  399. if assigned(p3) then
  400. newres^.p3:=p3^.get_copy;
  401. if assigned(next) then
  402. newres^.next:=next^.get_copy;
  403. get_copy:=newres;
  404. end;
  405. destructor tresobject.done;
  406. begin
  407. (* writeln('disposing ',byte(typ)); *)
  408. if assigned(p)then strdispose(p);
  409. if assigned(p1) then
  410. dispose(p1,done);
  411. if assigned(p2) then
  412. dispose(p2,done);
  413. if assigned(p3) then
  414. dispose(p3,done);
  415. if assigned(next) then
  416. dispose(next,done);
  417. end;
  418. %}
  419. D [0-9]
  420. %%
  421. "/*" begin
  422. if not stripcomment then
  423. write(outfile,aktspace,'{');
  424. repeat
  425. c:=get_char;
  426. case c of
  427. '*' :
  428. begin
  429. c:=get_char;
  430. if c='/' then
  431. begin
  432. if not stripcomment then
  433. write(outfile,' }');
  434. c:=get_char;
  435. if (c=newline) then
  436. begin
  437. writeln(outfile);
  438. unget_char(c);
  439. end;
  440. flush(outfile);
  441. exit;
  442. end
  443. else
  444. begin
  445. if not stripcomment then
  446. write(outfile,'*');
  447. unget_char(c)
  448. end;
  449. end;
  450. newline :
  451. begin
  452. if not stripcomment then
  453. begin
  454. writeln(outfile);
  455. write(outfile,aktspace);
  456. end;
  457. end;
  458. { Don't write this thing out, to
  459. avoid nested comments.
  460. }
  461. '{','}' :
  462. begin
  463. end;
  464. #0 :
  465. commenteof;
  466. else
  467. if not stripcomment then
  468. write(outfile,c);
  469. end;
  470. until false;
  471. flush(outfile);
  472. end;
  473. "//" begin
  474. commentstr:='';
  475. if (in_define) and not (stripcomment) then
  476. begin
  477. commentstr:='{';
  478. end
  479. else
  480. If not stripcomment then
  481. write(outfile,aktspace,'{');
  482. repeat
  483. c:=get_char;
  484. case c of
  485. newline :
  486. begin
  487. unget_char(c);
  488. if not stripcomment then
  489. begin
  490. if in_define then
  491. begin
  492. commentstr:=commentstr+' }';
  493. end
  494. else
  495. begin
  496. write(outfile,' }');
  497. writeln(outfile);
  498. end;
  499. end;
  500. flush(outfile);
  501. exit;
  502. end;
  503. { Don't write this comment out,
  504. to avoid nested comment problems
  505. }
  506. '{','}' :
  507. begin
  508. end;
  509. #0 :
  510. commenteof;
  511. else
  512. if not stripcomment then
  513. begin
  514. if in_define then
  515. begin
  516. commentstr:=commentstr+c;
  517. end
  518. else
  519. write(outfile,c);
  520. end;
  521. end;
  522. until false;
  523. flush(outfile);
  524. end;
  525. \"[^\"]*\" return(CSTRING);
  526. \'[^\']*\' return(CSTRING);
  527. "L"\"[^\"]*\" if win32headers then
  528. return(CSTRING)
  529. else
  530. return(256);
  531. "L"\'[^\']*\' if win32headers then
  532. return(CSTRING)
  533. else
  534. return(256);
  535. {D}+[Uu]?[Ll]? begin
  536. while yytext[length(yytext)] in ['L','U','l','u'] do
  537. Delete(yytext,length(yytext),1);
  538. return(NUMBER);
  539. end;
  540. "0x"[0-9A-Fa-f]*[Uu]?[Ll]?
  541. begin
  542. (* handle pre- and postfixes *)
  543. if copy(yytext,1,2)='0x' then
  544. begin
  545. delete(yytext,1,2);
  546. yytext:='$'+yytext;
  547. end;
  548. while yytext[length(yytext)] in ['L','U','l','u'] do
  549. Delete(yytext,length(yytext),1);
  550. return(NUMBER);
  551. end;
  552. {D}+(\.{D}+)?([Ee][+-]?{D}+)?
  553. begin
  554. return(NUMBER);
  555. end;
  556. "->" if in_define then
  557. return(DEREF)
  558. else
  559. return(256);
  560. "-" return(MINUS);
  561. "==" return(EQUAL);
  562. "!=" return(UNEQUAL);
  563. ">=" return(GTE);
  564. "<=" return(LTE);
  565. ">>" return(_SHR);
  566. "##" return(STICK);
  567. "<<" return(_SHL);
  568. ">" return(GT);
  569. "<" return(LT);
  570. "|" return(_OR);
  571. "&" return(_AND);
  572. "~" return(_NOT); (* inverse, but handled as not operation *)
  573. "!" return(_NOT);
  574. "/" return(_SLASH);
  575. "+" return(_PLUS);
  576. "?" return(QUESTIONMARK);
  577. ":" return(COLON);
  578. "," return(COMMA);
  579. "[" return(LECKKLAMMER);
  580. "]" return(RECKKLAMMER);
  581. "(" begin
  582. inc(arglevel);
  583. return(LKLAMMER);
  584. end;
  585. ")" begin
  586. dec(arglevel);
  587. return(RKLAMMER);
  588. end;
  589. "*" return(STAR);
  590. "..." return(ELLIPSIS);
  591. "." if in_define then
  592. return(POINT)
  593. else
  594. return(256);
  595. "=" return(_ASSIGN);
  596. "extern" return(EXTERN);
  597. "STDCALL" if Win32headers then
  598. return(STDCALL)
  599. else
  600. return(ID);
  601. "CDECL" if not Win32headers then
  602. return(ID)
  603. else
  604. return(CDECL);
  605. "PASCAL" if not Win32headers then
  606. return(ID)
  607. else
  608. return(PASCAL);
  609. "PACKED" if not Win32headers then
  610. return(ID)
  611. else
  612. return(_PACKED);
  613. "WINAPI" if not Win32headers then
  614. return(ID)
  615. else
  616. return(WINAPI);
  617. "SYS_TRAP" if not palmpilot then
  618. return(ID)
  619. else
  620. return(SYS_TRAP);
  621. "WINGDIAPI" if not Win32headers then
  622. return(ID)
  623. else
  624. return(WINGDIAPI);
  625. "CALLBACK" if not Win32headers then
  626. return(ID)
  627. else
  628. return(CALLBACK);
  629. "EXPENTRY" if not Win32headers then
  630. return(ID)
  631. else
  632. return(CALLBACK);
  633. "void" return(VOID);
  634. "VOID" return(VOID);
  635. "#ifdef __cplusplus"[ \t]*\n"extern \"C\" {"\n"#endif"
  636. begin
  637. if not stripinfo then
  638. writeln(outfile,'{ C++ extern C conditionnal removed }');
  639. end;
  640. "#ifdef __cplusplus"[ \t]*\n"}"\n"#endif"
  641. begin
  642. if not stripinfo then
  643. writeln(outfile,'{ C++ end of extern C conditionnal removed }');
  644. end;
  645. "#"[ \t]*"else" begin
  646. writeln(outfile,'{$else}');
  647. block_type:=bt_no;
  648. flush(outfile);
  649. end;
  650. "#"[ \t]*"endif" begin
  651. writeln(outfile,'{$endif}');
  652. block_type:=bt_no;
  653. flush(outfile);
  654. end;
  655. "#"[ \t]*"elif" begin
  656. if not stripinfo then
  657. write(outfile,'(*** was #elif ****)');
  658. write(outfile,'{$else');
  659. copy_until_eol;
  660. writeln(outfile,'}');
  661. block_type:=bt_no;
  662. flush(outfile);
  663. end;
  664. "#"[ \t]*"undef" begin
  665. write(outfile,'{$undef');
  666. copy_until_eol;
  667. writeln(outfile,'}');
  668. flush(outfile);
  669. end;
  670. "#"[ \t]*"error" begin
  671. write(outfile,'{$error');
  672. copy_until_eol;
  673. writeln(outfile,'}');
  674. flush(outfile);
  675. end;
  676. "#"[ \t]*"include" begin
  677. write(outfile,'{$include');
  678. copy_until_eol;
  679. writeln(outfile,'}');
  680. flush(outfile);
  681. block_type:=bt_no;
  682. end;
  683. "#"[ \t]*"if" begin
  684. write(outfile,'{$if');
  685. copy_until_eol;
  686. writeln(outfile,'}');
  687. flush(outfile);
  688. block_type:=bt_no;
  689. end;
  690. "# "[0-9]+" " begin
  691. (* preprocessor line info *)
  692. repeat
  693. c:=get_char;
  694. case c of
  695. newline :
  696. begin
  697. unget_char(c);
  698. exit;
  699. end;
  700. #0 :
  701. commenteof;
  702. end;
  703. until false;
  704. end;
  705. "#"[ \t]*"pragma" begin
  706. if not stripinfo then
  707. begin
  708. write(outfile,'(** unsupported pragma');
  709. write(outfile,'#pragma');
  710. copy_until_eol;
  711. writeln(outfile,'*)');
  712. flush(outfile);
  713. end
  714. else
  715. skip_until_eol;
  716. block_type:=bt_no;
  717. end;
  718. "#"[ \t]*"define" begin
  719. commentstr:='';
  720. in_define:=true;
  721. in_space_define:=1;
  722. return(DEFINE);
  723. end;
  724. "char" return(_CHAR);
  725. "union" return(UNION);
  726. "enum" return(ENUM);
  727. "struct" return(STRUCT);
  728. "{" return(LGKLAMMER);
  729. "}" return(RGKLAMMER);
  730. "typedef" return(TYPEDEF);
  731. "int" return(INT);
  732. "short" return(SHORT);
  733. "long" return(LONG);
  734. "signed" return(SIGNED);
  735. "unsigned" return(UNSIGNED);
  736. "float" return(REAL);
  737. "const" return(_CONST);
  738. "CONST" return(_CONST);
  739. "FAR" return(_FAR);
  740. "far" return(_FAR);
  741. "NEAR" return(_NEAR);
  742. "near" return(_NEAR);
  743. "HUGE" return(_HUGE);
  744. "huge" return(_HUGE);
  745. "while" return(_WHILE);
  746. [A-Za-z_][A-Za-z0-9_]* begin
  747. if in_space_define=1 then
  748. in_space_define:=2;
  749. return(ID);
  750. end;
  751. ";" return(SEMICOLON);
  752. [ \f\t] begin
  753. if (arglevel=0) and (in_space_define=2) then
  754. begin
  755. in_space_define:=0;
  756. return(SPACE_DEFINE);
  757. end;
  758. end;
  759. \n begin
  760. if in_define then
  761. begin
  762. in_space_define:=0;
  763. if cont_line then
  764. begin
  765. cont_line:=false;
  766. end
  767. else
  768. begin
  769. in_define:=false;
  770. return(NEW_LINE);
  771. end;
  772. end;
  773. end;
  774. \\$ begin
  775. if in_define then
  776. begin
  777. cont_line:=true;
  778. end
  779. else
  780. begin
  781. writeln('Unexpected wrap of line ',yylineno);
  782. writeln('"',yyline,'"');
  783. return(256);
  784. end;
  785. end;
  786. . begin
  787. writeln('Illegal character in line ',yylineno);
  788. writeln('"',yyline,'"');
  789. return(256);
  790. end;
  791. %%
  792. function act_token : string;
  793. begin
  794. act_token:=yytext;
  795. end;
  796. end.