1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>ohcount: /Users/andy/dev/ohcount/src/parser_macros.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.9 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>/Users/andy/dev/ohcount/src/parser_macros.h File Reference</h1><code>#include <stdio.h></code><br>
<code>#include <stdlib.h></code><br>
<code>#include "<a class="el" href="languages_8h_source.html">languages.h</a>"</code><br>
<p>
<a href="parser__macros_8h_source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Data Structures</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structCallbackItem.html">CallbackItem</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Holds a series of callbacks for in a queue (linked list). <a href="structCallbackItem.html#_details">More...</a><br></td></tr>
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#6da05469a748b57f676bbf67a842b25e">dequeue</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#a4df6978a0e35c95ca051f1da0dd7e86">ls</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#814f6dab3b0678113d97a3684282934a">code</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#43be22b7a1b528eaf759e034ec581543">comment</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#e9fb722b81bbd8bb0e1de37941fab172">saw</a>(lang)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#b08c3ed468f4ad3e1a9d391c1a4337d0">std_internal_newline</a>(lang)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#2822d59197758531b6f4a0cc13d0257b">emb_internal_newline</a>(lang)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#aaf8abebfd56b683567c15bfa3f063f1">std_newline</a>(lang)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#b5304b201ce6824e3c021e245d6a5e94">emb_newline</a>(lang)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#1adf47f60e418da0f0c3caa471728021">process_last_line</a>(lang)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#dcdd4261cb35490ebe8f88afd0b4787c">check_blank_entry</a>(lang)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#806511f4930171733227c99101dc0606">NEWLINE</a> -1</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#7e82c89c9a3dc533077791088d1ee77b">INTERNAL_NL</a> -2</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#a48fd5c8dbc18cdf9daaa5810227f829">CHECK_BLANK_ENTRY</a> -3</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#cc0eb0fbef1d4e1ccb5cf27961af93ad">cint</a>(c) ((int) (c - <a class="el" href="parser__macros_8h.html#f127db1c17ed58547ff5125a912d02b9">buffer_start</a>))</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#c1af3f499e72dfc161f2fce616dfd8e7">init</a></td></tr>
<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef struct <a class="el" href="structCallbackItem.html">CallbackItem</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#c27bb77f57039cab3883b9e21e6c48f4">Callback</a></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#cef933f90a0bd6318613e93f39067ac8">enqueue</a> (const char *lang, const char *<a class="el" href="parser__macros_8h.html#d4e4601988acb4a95ecd1ec380359ae5">entity</a>, int s, int e, void *udata)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#666ec961128241e997f03af3ae16a2ea">free_queue</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#33c0ec8adc93c385bb9560eb42cb52e2">is_blank_entry</a> (char **<a class="el" href="parser__macros_8h.html#aa1ebe818ec1c763a776cc580551f3e6">p</a>)</td></tr>
<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structCallbackItem.html">Callback</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#55de8ae2eeb299ec915f3f3dc354476e">callback_list_head</a> = NULL</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structCallbackItem.html">Callback</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#72a0d9ad9216bded86e30678b4972814">callback_list_tail</a> = NULL</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#d35c7ed2784f4fb57849237ce534f17e">cs</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#534c5331d9ff060f0e653d61e72f489f">act</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#aa1ebe818ec1c763a776cc580551f3e6">p</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#46103ad966e7f0e086263030e54a2615">pe</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#0f4922f5f610d7bd7db8c21a597b3641">eof</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#366fc4d3a72013313c8b00233a5a7690">ts</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#49aa6b4212d238e0be3312cf89738b98">te</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#1998d6eddc359fdb029fe1dc0b9a50b3">stack</a> [5]</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#f93f4f37fc2ad9c37af4a715423b110c">top</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#f127db1c17ed58547ff5125a912d02b9">buffer_start</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#6610fa10e2ad8df10bb6e04babf0bbd8">whole_line_comment</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#6c107b5ead58c230e358212891737cc3">line_contains_code</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#6f5b3cc3254a82d5d28a418a40f59272">line_start</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#d4e4601988acb4a95ecd1ec380359ae5">entity</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#289e4572ae2214b56c963362620009ce">seen</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#a38b98ec2e96f92062cc7d5fa8ece8a4">inqueue</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">char * </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#207101bbc948307c92f53d6521e3e85c">last_line_start</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#c85645edbf093d7ab236c9861ddcdc05">last_line_contains_code</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="parser__macros_8h.html#00405ce6c748a07e6ed3e3f91fe1d25e">last_whole_line_comment</a></td></tr>
</table>
<hr><h2>Define Documentation</h2>
<a class="anchor" name="a48fd5c8dbc18cdf9daaa5810227f829"></a><!-- doxytag: member="parser_macros.h::CHECK_BLANK_ENTRY" ref="a48fd5c8dbc18cdf9daaa5810227f829" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CHECK_BLANK_ENTRY -3 </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Check blank entry entity. Used for embedded language transitions. If a newline follows immediately after such a transition, the line should be counted as parent code, not child code. <dl class="note" compact><dt><b>Note:</b></dt><dd>This is only used for line counting parsers. </dd></dl>
</div>
</div><p>
<a class="anchor" name="dcdd4261cb35490ebe8f88afd0b4787c"></a><!-- doxytag: member="parser_macros.h::check_blank_entry" ref="dcdd4261cb35490ebe8f88afd0b4787c" args="(lang)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define check_blank_entry </td>
<td>(</td>
<td class="paramtype">lang </td>
<td class="paramname"> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
<span class="keywordflow">if</span> (<a class="code" href="parser__macros_8h.html#33c0ec8adc93c385bb9560eb42cb52e2">is_blank_entry</a>(&<a class="code" href="parser__macros_8h.html#aa1ebe818ec1c763a776cc580551f3e6">p</a>)) { \
<a class="code" href="parser__macros_8h.html#49aa6b4212d238e0be3312cf89738b98">te</a> = <a class="code" href="parser__macros_8h.html#aa1ebe818ec1c763a776cc580551f3e6">p</a> + 1; \
<a class="code" href="parser__macros_8h.html#aaf8abebfd56b683567c15bfa3f063f1">std_newline</a>(lang) \
} \
}
</pre></div>If there is a transition into an embedded language and there is only parent language code on the line (the rest of the line is blank with no child code), count the line as a line of parent code. Moves p and te to the end of the newline and calls the std_newline macro. (p is inclusive, te is not.) This is typically used in the main action for the CHECK_BLANK_ENTRY entity. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>lang</em> </td><td>The language name string. </td></tr>
</table>
</dl>
<dl class="note" compact><dt><b>Note:</b></dt><dd>Applies only to line counting parsers. </dd></dl>
</div>
</div><p>
<a class="anchor" name="cc0eb0fbef1d4e1ccb5cf27961af93ad"></a><!-- doxytag: member="parser_macros.h::cint" ref="cc0eb0fbef1d4e1ccb5cf27961af93ad" args="(c)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define cint </td>
<td>(</td>
<td class="paramtype">c </td>
<td class="paramname"> </td>
<td> ) </td>
<td> ((int) (c - <a class="el" href="parser__macros_8h.html#f127db1c17ed58547ff5125a912d02b9">buffer_start</a>))</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Returns the absolute location in memory for a position relative to the start of the buffer being parsed. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>c</em> </td><td>Position relative to the start of the buffer. </td></tr>
</table>
</dl>
<dl class="note" compact><dt><b>Note:</b></dt><dd>This is only used for line counting parsers. </dd></dl>
</div>
</div><p>
<a class="anchor" name="814f6dab3b0678113d97a3684282934a"></a><!-- doxytag: member="parser_macros.h::code" ref="814f6dab3b0678113d97a3684282934a" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define code </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
<span class="keywordflow">if</span> (<a class="code" href="parser__macros_8h.html#a38b98ec2e96f92062cc7d5fa8ece8a4">inqueue</a>) { <a class="code" href="parser__macros_8h.html#6da05469a748b57f676bbf67a842b25e">dequeue</a>; } \
<span class="keywordflow">if</span> (!<a class="code" href="parser__macros_8h.html#6c107b5ead58c230e358212891737cc3">line_contains_code</a> && !<a class="code" href="parser__macros_8h.html#6f5b3cc3254a82d5d28a418a40f59272">line_start</a>) <a class="code" href="parser__macros_8h.html#6f5b3cc3254a82d5d28a418a40f59272">line_start</a> = <a class="code" href="parser__macros_8h.html#366fc4d3a72013313c8b00233a5a7690">ts</a>; \
<a class="code" href="parser__macros_8h.html#6c107b5ead58c230e358212891737cc3">line_contains_code</a> = 1; \
}
</pre></div>The C equivalent of the Ragel 'code' action. This is tyically used in the main action for entities where Ragel actions cannot, for one reason or another, be used. <dl class="note" compact><dt><b>Note:</b></dt><dd>Applies only to line counting parsers. </dd></dl>
</div>
</div><p>
<a class="anchor" name="43be22b7a1b528eaf759e034ec581543"></a><!-- doxytag: member="parser_macros.h::comment" ref="43be22b7a1b528eaf759e034ec581543" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define comment </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
<span class="keywordflow">if</span> (<a class="code" href="parser__macros_8h.html#a38b98ec2e96f92062cc7d5fa8ece8a4">inqueue</a>) { <a class="code" href="parser__macros_8h.html#6da05469a748b57f676bbf67a842b25e">dequeue</a>; } \
<span class="keywordflow">if</span> (!<a class="code" href="parser__macros_8h.html#6c107b5ead58c230e358212891737cc3">line_contains_code</a>) { \
<a class="code" href="parser__macros_8h.html#6610fa10e2ad8df10bb6e04babf0bbd8">whole_line_comment</a> = 1; \
<span class="keywordflow">if</span> (!<a class="code" href="parser__macros_8h.html#6f5b3cc3254a82d5d28a418a40f59272">line_start</a>) <a class="code" href="parser__macros_8h.html#6f5b3cc3254a82d5d28a418a40f59272">line_start</a> = <a class="code" href="parser__macros_8h.html#366fc4d3a72013313c8b00233a5a7690">ts</a>; \
} \
}
</pre></div>The C equivalent of the Ragel 'comment' action. This is typically unused, but here for consistency. <dl class="note" compact><dt><b>Note:</b></dt><dd>Applies only to line counting parsers. </dd></dl>
</div>
</div><p>
<a class="anchor" name="6da05469a748b57f676bbf67a842b25e"></a><!-- doxytag: member="parser_macros.h::dequeue" ref="6da05469a748b57f676bbf67a842b25e" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define dequeue </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
<a class="code" href="parser__macros_8h.html#a38b98ec2e96f92062cc7d5fa8ece8a4">inqueue</a> = 0; \
<a class="code" href="parser__macros_8h.html#6f5b3cc3254a82d5d28a418a40f59272">line_start</a> = <a class="code" href="parser__macros_8h.html#207101bbc948307c92f53d6521e3e85c">last_line_start</a>; \
<a class="code" href="parser__macros_8h.html#6c107b5ead58c230e358212891737cc3">line_contains_code</a> = <a class="code" href="parser__macros_8h.html#c85645edbf093d7ab236c9861ddcdc05">last_line_contains_code</a>; \
<a class="code" href="parser__macros_8h.html#6610fa10e2ad8df10bb6e04babf0bbd8">whole_line_comment</a> = <a class="code" href="parser__macros_8h.html#00405ce6c748a07e6ed3e3f91fe1d25e">last_whole_line_comment</a>; \
}
</pre></div>Restores settings for a failed enqueued entity. This is typically used in the ls, code, and comment macros. <dl class="note" compact><dt><b>Note:</b></dt><dd>Applies only to line counting parsers. </dd></dl>
</div>
</div><p>
<a class="anchor" name="2822d59197758531b6f4a0cc13d0257b"></a><!-- doxytag: member="parser_macros.h::emb_internal_newline" ref="2822d59197758531b6f4a0cc13d0257b" args="(lang)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define emb_internal_newline </td>
<td>(</td>
<td class="paramtype">lang </td>
<td class="paramname"> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
<span class="keywordflow">if</span> (<a class="code" href="parser__macros_8h.html#289e4572ae2214b56c963362620009ce">seen</a> && <a class="code" href="parser__macros_8h.html#289e4572ae2214b56c963362620009ce">seen</a> != lang) \
<a class="code" href="parser__macros_8h.html#b08c3ed468f4ad3e1a9d391c1a4337d0">std_internal_newline</a>(<a class="code" href="parser__macros_8h.html#289e4572ae2214b56c963362620009ce">seen</a>) \
<span class="keywordflow">else</span> \
<a class="code" href="parser__macros_8h.html#b08c3ed468f4ad3e1a9d391c1a4337d0">std_internal_newline</a>(lang) \
<a class="code" href="parser__macros_8h.html#289e4572ae2214b56c963362620009ce">seen</a> = 0; \
}
</pre></div>Executes emebedded language line counting actions for INTERNAL_NL entities based on whether or not the embedded language's code has been seen in a parent line. This is typically used in the main action for the INTERNAL_NL entity. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>lang</em> </td><td>The language name string. </td></tr>
</table>
</dl>
<dl class="note" compact><dt><b>Note:</b></dt><dd>Applies only to line counting parsers. </dd></dl>
</div>
</div><p>
<a class="anchor" name="b5304b201ce6824e3c021e245d6a5e94"></a><!-- doxytag: member="parser_macros.h::emb_newline" ref="b5304b201ce6824e3c021e245d6a5e94" args="(lang)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define emb_newline </td>
<td>(</td>
<td class="paramtype">lang </td>
<td class="paramname"> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
<span class="keywordflow">if</span> (<a class="code" href="parser__macros_8h.html#289e4572ae2214b56c963362620009ce">seen</a> && <a class="code" href="parser__macros_8h.html#289e4572ae2214b56c963362620009ce">seen</a> != lang) \
<a class="code" href="parser__macros_8h.html#aaf8abebfd56b683567c15bfa3f063f1">std_newline</a>(<a class="code" href="parser__macros_8h.html#289e4572ae2214b56c963362620009ce">seen</a>) \
<span class="keywordflow">else</span> \
<a class="code" href="parser__macros_8h.html#aaf8abebfd56b683567c15bfa3f063f1">std_newline</a>(lang) \
<a class="code" href="parser__macros_8h.html#289e4572ae2214b56c963362620009ce">seen</a> = 0; \
}
</pre></div>Executes embedded language line counting actions for NEWLINE entities based on whether or not the embedded language's code has been seen in a parent line. This is typically used in the main action for the NEWLINE entity. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>lang</em> </td><td>The language name string. </td></tr>
</table>
</dl>
<dl class="note" compact><dt><b>Note:</b></dt><dd>Applies only to line counting parsers. </dd></dl>
</div>
</div><p>
<a class="anchor" name="c1af3f499e72dfc161f2fce616dfd8e7"></a><!-- doxytag: member="parser_macros.h::init" ref="c1af3f499e72dfc161f2fce616dfd8e7" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define init </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
<a class="code" href="parser__macros_8h.html#aa1ebe818ec1c763a776cc580551f3e6">p</a> = buffer; \
<a class="code" href="parser__macros_8h.html#46103ad966e7f0e086263030e54a2615">pe</a> = buffer + length; \
<a class="code" href="parser__macros_8h.html#0f4922f5f610d7bd7db8c21a597b3641">eof</a> = <a class="code" href="parser__macros_8h.html#46103ad966e7f0e086263030e54a2615">pe</a>; \
\
<a class="code" href="parser__macros_8h.html#f127db1c17ed58547ff5125a912d02b9">buffer_start</a> = buffer; \
<a class="code" href="parser__macros_8h.html#6610fa10e2ad8df10bb6e04babf0bbd8">whole_line_comment</a> = 0; \
<a class="code" href="parser__macros_8h.html#6c107b5ead58c230e358212891737cc3">line_contains_code</a> = 0; \
<a class="code" href="parser__macros_8h.html#6f5b3cc3254a82d5d28a418a40f59272">line_start</a> = 0; \
<a class="code" href="parser__macros_8h.html#d4e4601988acb4a95ecd1ec380359ae5">entity</a> = 0; \
<a class="code" href="parser__macros_8h.html#289e4572ae2214b56c963362620009ce">seen</a> = 0; \
<a class="code" href="parser__macros_8h.html#a38b98ec2e96f92062cc7d5fa8ece8a4">inqueue</a> = 0; \
}
</pre></div>Initializes variables for parsing a buffer. Required at the beginning of every parser function.
</div>
</div><p>
<a class="anchor" name="7e82c89c9a3dc533077791088d1ee77b"></a><!-- doxytag: member="parser_macros.h::INTERNAL_NL" ref="7e82c89c9a3dc533077791088d1ee77b" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define INTERNAL_NL -2 </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Internal newline entity. Used for newlines inside patterns like strings and comments that can have newlines in them. <dl class="note" compact><dt><b>Note:</b></dt><dd>This is only used for line counting parsers. </dd></dl>
</div>
</div><p>
<a class="anchor" name="a4df6978a0e35c95ca051f1da0dd7e86"></a><!-- doxytag: member="parser_macros.h::ls" ref="a4df6978a0e35c95ca051f1da0dd7e86" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ls </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
<span class="keywordflow">if</span> (<a class="code" href="parser__macros_8h.html#a38b98ec2e96f92062cc7d5fa8ece8a4">inqueue</a>) { <a class="code" href="parser__macros_8h.html#6da05469a748b57f676bbf67a842b25e">dequeue</a>; } \
<span class="keywordflow">if</span> (!<a class="code" href="parser__macros_8h.html#6f5b3cc3254a82d5d28a418a40f59272">line_start</a>) <a class="code" href="parser__macros_8h.html#6f5b3cc3254a82d5d28a418a40f59272">line_start</a> = <a class="code" href="parser__macros_8h.html#366fc4d3a72013313c8b00233a5a7690">ts</a>; \
}
</pre></div>Sets the line_start variable to ts. This is typically used for the SPACE entity in the main action. <dl class="note" compact><dt><b>Note:</b></dt><dd>Applies only to line counting parsers. </dd></dl>
</div>
</div><p>
<a class="anchor" name="806511f4930171733227c99101dc0606"></a><!-- doxytag: member="parser_macros.h::NEWLINE" ref="806511f4930171733227c99101dc0606" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define NEWLINE -1 </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Newline entity. <dl class="note" compact><dt><b>Note:</b></dt><dd>This is only used for line counting parsers. </dd></dl>
</div>
</div><p>
<a class="anchor" name="1adf47f60e418da0f0c3caa471728021"></a><!-- doxytag: member="parser_macros.h::process_last_line" ref="1adf47f60e418da0f0c3caa471728021" args="(lang)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define process_last_line </td>
<td>(</td>
<td class="paramtype">lang </td>
<td class="paramname"> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{\
<span class="keywordflow">if</span> ((<a class="code" href="parser__macros_8h.html#6610fa10e2ad8df10bb6e04babf0bbd8">whole_line_comment</a> || <a class="code" href="parser__macros_8h.html#6c107b5ead58c230e358212891737cc3">line_contains_code</a>) && callback) { \
<span class="keywordflow">if</span> (<a class="code" href="parser__macros_8h.html#6c107b5ead58c230e358212891737cc3">line_contains_code</a>) \
callback(lang, <span class="stringliteral">"lcode"</span>, <a class="code" href="parser__macros_8h.html#cc0eb0fbef1d4e1ccb5cf27961af93ad">cint</a>(<a class="code" href="parser__macros_8h.html#6f5b3cc3254a82d5d28a418a40f59272">line_start</a>), <a class="code" href="parser__macros_8h.html#cc0eb0fbef1d4e1ccb5cf27961af93ad">cint</a>(<a class="code" href="parser__macros_8h.html#46103ad966e7f0e086263030e54a2615">pe</a>), userdata); \
<span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="parser__macros_8h.html#6610fa10e2ad8df10bb6e04babf0bbd8">whole_line_comment</a>) \
callback(lang, <span class="stringliteral">"lcomment"</span>, <a class="code" href="parser__macros_8h.html#cc0eb0fbef1d4e1ccb5cf27961af93ad">cint</a>(<a class="code" href="parser__macros_8h.html#6f5b3cc3254a82d5d28a418a40f59272">line_start</a>), <a class="code" href="parser__macros_8h.html#cc0eb0fbef1d4e1ccb5cf27961af93ad">cint</a>(<a class="code" href="parser__macros_8h.html#46103ad966e7f0e086263030e54a2615">pe</a>), userdata); \
} \
}
</pre></div>Processes the last line for buffers that don't have a newline at EOF. This is typically used at the end of the parse_lang function after the Ragel parser has been executed. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>lang</em> </td><td>The language name string. </td></tr>
</table>
</dl>
<dl class="note" compact><dt><b>Note:</b></dt><dd>Applies only to line counting parsers. </dd></dl>
</div>
</div><p>
<a class="anchor" name="e9fb722b81bbd8bb0e1de37941fab172"></a><!-- doxytag: member="parser_macros.h::saw" ref="e9fb722b81bbd8bb0e1de37941fab172" args="(lang)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define saw </td>
<td>(</td>
<td class="paramtype">lang </td>
<td class="paramname"> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
<a class="code" href="parser__macros_8h.html#289e4572ae2214b56c963362620009ce">seen</a> = lang; \
<a class="code" href="parser__macros_8h.html#6610fa10e2ad8df10bb6e04babf0bbd8">whole_line_comment</a> = 0; \
<a class="code" href="parser__macros_8h.html#6c107b5ead58c230e358212891737cc3">line_contains_code</a> = 0; \
}
</pre></div>Sets up for having seen an embedded language. This is typically used when entering an embedded language which usually does not span multiple lines (e.g. php for <?php echo 'blah' ?> on single lines) so the line is counted as embedded code or comment, not parent code. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>lang</em> </td><td>The language name string. </td></tr>
</table>
</dl>
<dl class="note" compact><dt><b>Note:</b></dt><dd>Applies only to line counting parsers. </dd></dl>
</div>
</div><p>
<a class="anchor" name="b08c3ed468f4ad3e1a9d391c1a4337d0"></a><!-- doxytag: member="parser_macros.h::std_internal_newline" ref="b08c3ed468f4ad3e1a9d391c1a4337d0" args="(lang)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define std_internal_newline </td>
<td>(</td>
<td class="paramtype">lang </td>
<td class="paramname"> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{ \
<span class="keywordflow">if</span> (callback && <a class="code" href="parser__macros_8h.html#aa1ebe818ec1c763a776cc580551f3e6">p</a> > <a class="code" href="parser__macros_8h.html#6f5b3cc3254a82d5d28a418a40f59272">line_start</a>) { \
<span class="keywordflow">if</span> (<a class="code" href="parser__macros_8h.html#6c107b5ead58c230e358212891737cc3">line_contains_code</a>) { \
<span class="keywordflow">if</span> (<a class="code" href="parser__macros_8h.html#a38b98ec2e96f92062cc7d5fa8ece8a4">inqueue</a>) \
<a class="code" href="parser__macros_8h.html#cef933f90a0bd6318613e93f39067ac8">enqueue</a>(lang, <span class="stringliteral">"lcode"</span>, <a class="code" href="parser__macros_8h.html#cc0eb0fbef1d4e1ccb5cf27961af93ad">cint</a>(<a class="code" href="parser__macros_8h.html#6f5b3cc3254a82d5d28a418a40f59272">line_start</a>), <a class="code" href="parser__macros_8h.html#cc0eb0fbef1d4e1ccb5cf27961af93ad">cint</a>(<a class="code" href="parser__macros_8h.html#aa1ebe818ec1c763a776cc580551f3e6">p</a>), userdata); \
<span class="keywordflow">else</span> \
callback(lang, <span class="stringliteral">"lcode"</span>, <a class="code" href="parser__macros_8h.html#cc0eb0fbef1d4e1ccb5cf27961af93ad">cint</a>(<a class="code" href="parser__macros_8h.html#6f5b3cc3254a82d5d28a418a40f59272">line_start</a>), <a class="code" href="parser__macros_8h.html#cc0eb0fbef1d4e1ccb5cf27961af93ad">cint</a>(<a class="code" href="parser__macros_8h.html#aa1ebe818ec1c763a776cc580551f3e6">p</a>), userdata); \
} <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="parser__macros_8h.html#6610fa10e2ad8df10bb6e04babf0bbd8">whole_line_comment</a>) { \
<span class="keywordflow">if</span> (<a class="code" href="parser__macros_8h.html#a38b98ec2e96f92062cc7d5fa8ece8a4">inqueue</a>) \
<a class="code" href="parser__macros_8h.html#cef933f90a0bd6318613e93f39067ac8">enqueue</a>(lang, <span class="stringliteral">"lcomment"</span>, <a class="code" href="parser__macros_8h.html#cc0eb0fbef1d4e1ccb5cf27961af93ad">cint</a>(<a class="code" href="parser__macros_8h.html#6f5b3cc3254a82d5d28a418a40f59272">line_start</a>), <a class="code" href="parser__macros_8h.html#cc0eb0fbef1d4e1ccb5cf27961af93ad">cint</a>(<a class="code" href="parser__macros_8h.html#aa1ebe818ec1c763a776cc580551f3e6">p</a>), userdata); \
<span class="keywordflow">else</span> \
callback(lang, <span class="stringliteral">"lcomment"</span>, <a class="code" href="parser__macros_8h.html#cc0eb0fbef1d4e1ccb5cf27961af93ad">cint</a>(<a class="code" href="parser__macros_8h.html#6f5b3cc3254a82d5d28a418a40f59272">line_start</a>), <a class="code" href="parser__macros_8h.html#cc0eb0fbef1d4e1ccb5cf27961af93ad">cint</a>(<a class="code" href="parser__macros_8h.html#aa1ebe818ec1c763a776cc580551f3e6">p</a>), userdata); \
} <span class="keywordflow">else</span> { \
<span class="keywordflow">if</span> (<a class="code" href="parser__macros_8h.html#a38b98ec2e96f92062cc7d5fa8ece8a4">inqueue</a>) \
<a class="code" href="parser__macros_8h.html#cef933f90a0bd6318613e93f39067ac8">enqueue</a>(lang, <span class="stringliteral">"lblank"</span>, <a class="code" href="parser__macros_8h.html#cc0eb0fbef1d4e1ccb5cf27961af93ad">cint</a>(<a class="code" href="parser__macros_8h.html#6f5b3cc3254a82d5d28a418a40f59272">line_start</a>), <a class="code" href="parser__macros_8h.html#cc0eb0fbef1d4e1ccb5cf27961af93ad">cint</a>(<a class="code" href="parser__macros_8h.html#aa1ebe818ec1c763a776cc580551f3e6">p</a>), userdata); \
<span class="keywordflow">else</span> \
callback(lang, <span class="stringliteral">"lblank"</span>, <a class="code" href="parser__macros_8h.html#cc0eb0fbef1d4e1ccb5cf27961af93ad">cint</a>(<a class="code" href="parser__macros_8h.html#6f5b3cc3254a82d5d28a418a40f59272">line_start</a>), <a class="code" href="parser__macros_8h.html#cc0eb0fbef1d4e1ccb5cf27961af93ad">cint</a>(<a class="code" href="parser__macros_8h.html#aa1ebe818ec1c763a776cc580551f3e6">p</a>), userdata); \
} \
} \
<a class="code" href="parser__macros_8h.html#6610fa10e2ad8df10bb6e04babf0bbd8">whole_line_comment</a> = 0; \
<a class="code" href="parser__macros_8h.html#6c107b5ead58c230e358212891737cc3">line_contains_code</a> = 0; \
<a class="code" href="parser__macros_8h.html#6f5b3cc3254a82d5d28a418a40f59272">line_start</a> = <a class="code" href="parser__macros_8h.html#aa1ebe818ec1c763a776cc580551f3e6">p</a>; \
}
</pre></div>Executes standard line counting actions for INTERNAL_NL entities. This is typically used in the main action for the INTERNAL_NL entity. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>lang</em> </td><td>The language name string. </td></tr>
</table>
</dl>
<dl class="note" compact><dt><b>Note:</b></dt><dd>Applies only to line counting parsers. </dd></dl>
</div>
</div><p>
<a class="anchor" name="aaf8abebfd56b683567c15bfa3f063f1"></a><!-- doxytag: member="parser_macros.h::std_newline" ref="aaf8abebfd56b683567c15bfa3f063f1" args="(lang)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define std_newline </td>
<td>(</td>
<td class="paramtype">lang </td>
<td class="paramname"> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
<b>Value:</b><div class="fragment"><pre class="fragment">{\
<span class="keywordflow">if</span> (<a class="code" href="parser__macros_8h.html#a38b98ec2e96f92062cc7d5fa8ece8a4">inqueue</a>) { <a class="code" href="parser__macros_8h.html#6da05469a748b57f676bbf67a842b25e">dequeue</a>; } \
<span class="keywordflow">if</span> (callback && <a class="code" href="parser__macros_8h.html#49aa6b4212d238e0be3312cf89738b98">te</a> > <a class="code" href="parser__macros_8h.html#6f5b3cc3254a82d5d28a418a40f59272">line_start</a>) { \
<span class="keywordflow">if</span> (<a class="code" href="parser__macros_8h.html#6c107b5ead58c230e358212891737cc3">line_contains_code</a>) \
callback(lang, <span class="stringliteral">"lcode"</span>, <a class="code" href="parser__macros_8h.html#cc0eb0fbef1d4e1ccb5cf27961af93ad">cint</a>(<a class="code" href="parser__macros_8h.html#6f5b3cc3254a82d5d28a418a40f59272">line_start</a>), <a class="code" href="parser__macros_8h.html#cc0eb0fbef1d4e1ccb5cf27961af93ad">cint</a>(<a class="code" href="parser__macros_8h.html#49aa6b4212d238e0be3312cf89738b98">te</a>), userdata); \
<span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="parser__macros_8h.html#6610fa10e2ad8df10bb6e04babf0bbd8">whole_line_comment</a>) \
callback(lang, <span class="stringliteral">"lcomment"</span>, <a class="code" href="parser__macros_8h.html#cc0eb0fbef1d4e1ccb5cf27961af93ad">cint</a>(<a class="code" href="parser__macros_8h.html#6f5b3cc3254a82d5d28a418a40f59272">line_start</a>), <a class="code" href="parser__macros_8h.html#cc0eb0fbef1d4e1ccb5cf27961af93ad">cint</a>(<a class="code" href="parser__macros_8h.html#49aa6b4212d238e0be3312cf89738b98">te</a>), userdata); \
<span class="keywordflow">else</span> \
callback(lang, <span class="stringliteral">"lblank"</span>, <a class="code" href="parser__macros_8h.html#cc0eb0fbef1d4e1ccb5cf27961af93ad">cint</a>(<a class="code" href="parser__macros_8h.html#366fc4d3a72013313c8b00233a5a7690">ts</a>), <a class="code" href="parser__macros_8h.html#cc0eb0fbef1d4e1ccb5cf27961af93ad">cint</a>(<a class="code" href="parser__macros_8h.html#49aa6b4212d238e0be3312cf89738b98">te</a>), userdata); \
} \
<a class="code" href="parser__macros_8h.html#6610fa10e2ad8df10bb6e04babf0bbd8">whole_line_comment</a> = 0; \
<a class="code" href="parser__macros_8h.html#6c107b5ead58c230e358212891737cc3">line_contains_code</a> = 0; \
<a class="code" href="parser__macros_8h.html#6f5b3cc3254a82d5d28a418a40f59272">line_start</a> = 0; \
}
</pre></div>Executes standard line counting actions for NEWLINE entities. This is typically used in the main action for the NEWLINE entity. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>lang</em> </td><td>The language name string. </td></tr>
</table>
</dl>
<dl class="note" compact><dt><b>Note:</b></dt><dd>Applies only to line counting parsers. </dd></dl>
</div>
</div><p>
<hr><h2>Typedef Documentation</h2>
<a class="anchor" name="c27bb77f57039cab3883b9e21e6c48f4"></a><!-- doxytag: member="parser_macros.h::Callback" ref="c27bb77f57039cab3883b9e21e6c48f4" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef struct <a class="el" href="structCallbackItem.html">CallbackItem</a> <a class="el" href="structCallbackItem.html">Callback</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
</div>
</div><p>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="cef933f90a0bd6318613e93f39067ac8"></a><!-- doxytag: member="parser_macros.h::enqueue" ref="cef933f90a0bd6318613e93f39067ac8" args="(const char *lang, const char *entity, int s, int e, void *udata)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void enqueue </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>lang</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"> <em>entity</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>s</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"> <em>e</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"> <em>udata</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Enqueues a callback for calling upon commit. This is only necessary for line counting machines. Ragel will execute actions in real-time rather than after a complete match. This is a problem for entities that contain internal newlines, since there is a callback for each internal newline whether or not the end of the entity matches. This means that if, for example, the beginning of a string entity is matched, the text following is treated as code until the ending delimiter. If there is no ending delimiter (it was not actually a string entity), Ragel will jump back to the beginning of the string and reparse the text again. This means all the callbacks called were probably not accurate. To remedy this, any entity which needs an ending delimiter that may not appear will have its callbacks enqueued and then committed when the ending delimitter is reached. If that delimitter is not reached, the callbacks are never called. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>lang</em> </td><td>The language name. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>entity</em> </td><td>The entity (lcode, lcomment, lblank). </td></tr>
<tr><td valign="top"></td><td valign="top"><em>s</em> </td><td>The start position of the entity in the buffer. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>e</em> </td><td>The end position of the entity in the buffer. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>udata</em> </td><td>Userdata. </td></tr>
</table>
</dl>
</div>
</div><p>
<a class="anchor" name="666ec961128241e997f03af3ae16a2ea"></a><!-- doxytag: member="parser_macros.h::free_queue" ref="666ec961128241e997f03af3ae16a2ea" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void free_queue </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Frees the memory used by a queue.
</div>
</div><p>
<a class="anchor" name="33c0ec8adc93c385bb9560eb42cb52e2"></a><!-- doxytag: member="parser_macros.h::is_blank_entry" ref="33c0ec8adc93c385bb9560eb42cb52e2" args="(char **p)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int is_blank_entry </td>
<td>(</td>
<td class="paramtype">char ** </td>
<td class="paramname"> <em>p</em> </td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Determines whether or not the rest of the line is blank. This is typically used when entering an embedded language. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>p</em> </td><td>The position of entry into the emebedded language. </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if the rest of the line is not blank, the position at the end of the newline otherwise (inclusive). </dd></dl>
<dl class="note" compact><dt><b>Note:</b></dt><dd>Applies only to line counting parsers. </dd></dl>
</div>
</div><p>
<hr><h2>Variable Documentation</h2>
<a class="anchor" name="534c5331d9ff060f0e653d61e72f489f"></a><!-- doxytag: member="parser_macros.h::act" ref="534c5331d9ff060f0e653d61e72f489f" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="parser__macros_8h.html#534c5331d9ff060f0e653d61e72f489f">act</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Required by Ragel.
</div>
</div><p>
<a class="anchor" name="f127db1c17ed58547ff5125a912d02b9"></a><!-- doxytag: member="parser_macros.h::buffer_start" ref="f127db1c17ed58547ff5125a912d02b9" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char* <a class="el" href="parser__macros_8h.html#f127db1c17ed58547ff5125a912d02b9">buffer_start</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
The buffer currently being parsed.
</div>
</div><p>
<a class="anchor" name="55de8ae2eeb299ec915f3f3dc354476e"></a><!-- doxytag: member="parser_macros.h::callback_list_head" ref="55de8ae2eeb299ec915f3f3dc354476e" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structCallbackItem.html">Callback</a>* <a class="el" href="parser__macros_8h.html#55de8ae2eeb299ec915f3f3dc354476e">callback_list_head</a> = NULL </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
The head of the Callback queue.
</div>
</div><p>
<a class="anchor" name="72a0d9ad9216bded86e30678b4972814"></a><!-- doxytag: member="parser_macros.h::callback_list_tail" ref="72a0d9ad9216bded86e30678b4972814" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structCallbackItem.html">Callback</a>* <a class="el" href="parser__macros_8h.html#72a0d9ad9216bded86e30678b4972814">callback_list_tail</a> = NULL </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
The tail of the Callback queue.
</div>
</div><p>
<a class="anchor" name="d35c7ed2784f4fb57849237ce534f17e"></a><!-- doxytag: member="parser_macros.h::cs" ref="d35c7ed2784f4fb57849237ce534f17e" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="parser__macros_8h.html#d35c7ed2784f4fb57849237ce534f17e">cs</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Required by Ragel.
</div>
</div><p>
<a class="anchor" name="d4e4601988acb4a95ecd1ec380359ae5"></a><!-- doxytag: member="parser_macros.h::entity" ref="d4e4601988acb4a95ecd1ec380359ae5" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="parser__macros_8h.html#d4e4601988acb4a95ecd1ec380359ae5">entity</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
State variable for the current entity being matched.
</div>
</div><p>
<a class="anchor" name="0f4922f5f610d7bd7db8c21a597b3641"></a><!-- doxytag: member="parser_macros.h::eof" ref="0f4922f5f610d7bd7db8c21a597b3641" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char* <a class="el" href="parser__macros_8h.html#0f4922f5f610d7bd7db8c21a597b3641">eof</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Required by Ragel.
</div>
</div><p>
<a class="anchor" name="a38b98ec2e96f92062cc7d5fa8ece8a4"></a><!-- doxytag: member="parser_macros.h::inqueue" ref="a38b98ec2e96f92062cc7d5fa8ece8a4" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="parser__macros_8h.html#a38b98ec2e96f92062cc7d5fa8ece8a4">inqueue</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Flag indicating whether or not to enqueue callbacks instead of calling them in real time. <dl class="note" compact><dt><b>Note:</b></dt><dd>This is only used for line counting parsers. </dd></dl>
</div>
</div><p>
<a class="anchor" name="c85645edbf093d7ab236c9861ddcdc05"></a><!-- doxytag: member="parser_macros.h::last_line_contains_code" ref="c85645edbf093d7ab236c9861ddcdc05" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="parser__macros_8h.html#c85645edbf093d7ab236c9861ddcdc05">last_line_contains_code</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Backup variable for 'inqueue'ing. <dl class="note" compact><dt><b>Note:</b></dt><dd>This is only used for line counting parsers. </dd></dl>
</div>
</div><p>
<a class="anchor" name="207101bbc948307c92f53d6521e3e85c"></a><!-- doxytag: member="parser_macros.h::last_line_start" ref="207101bbc948307c92f53d6521e3e85c" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char* <a class="el" href="parser__macros_8h.html#207101bbc948307c92f53d6521e3e85c">last_line_start</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Backup variable for 'inqueue'ing. <dl class="note" compact><dt><b>Note:</b></dt><dd>This is only used for line counting parsers. </dd></dl>
</div>
</div><p>
<a class="anchor" name="00405ce6c748a07e6ed3e3f91fe1d25e"></a><!-- doxytag: member="parser_macros.h::last_whole_line_comment" ref="00405ce6c748a07e6ed3e3f91fe1d25e" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="parser__macros_8h.html#00405ce6c748a07e6ed3e3f91fe1d25e">last_whole_line_comment</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Backup variable for 'inqueue'ing. <dl class="note" compact><dt><b>Note:</b></dt><dd>This is only used for line counting parsers. </dd></dl>
</div>
</div><p>
<a class="anchor" name="6c107b5ead58c230e358212891737cc3"></a><!-- doxytag: member="parser_macros.h::line_contains_code" ref="6c107b5ead58c230e358212891737cc3" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="parser__macros_8h.html#6c107b5ead58c230e358212891737cc3">line_contains_code</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Flag indicating whether or not the current line contains any code. <dl class="note" compact><dt><b>Note:</b></dt><dd>This is only used for line counting parsers. </dd></dl>
</div>
</div><p>
<a class="anchor" name="6f5b3cc3254a82d5d28a418a40f59272"></a><!-- doxytag: member="parser_macros.h::line_start" ref="6f5b3cc3254a82d5d28a418a40f59272" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char* <a class="el" href="parser__macros_8h.html#6f5b3cc3254a82d5d28a418a40f59272">line_start</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
The beginning of the current line in the buffer being parsed. <dl class="note" compact><dt><b>Note:</b></dt><dd>This is only used for line counting parsers. </dd></dl>
</div>
</div><p>
<a class="anchor" name="aa1ebe818ec1c763a776cc580551f3e6"></a><!-- doxytag: member="parser_macros.h::p" ref="aa1ebe818ec1c763a776cc580551f3e6" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char* <a class="el" href="parser__macros_8h.html#aa1ebe818ec1c763a776cc580551f3e6">p</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Required by Ragel.
</div>
</div><p>
<a class="anchor" name="46103ad966e7f0e086263030e54a2615"></a><!-- doxytag: member="parser_macros.h::pe" ref="46103ad966e7f0e086263030e54a2615" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char* <a class="el" href="parser__macros_8h.html#46103ad966e7f0e086263030e54a2615">pe</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Required by Ragel.
</div>
</div><p>
<a class="anchor" name="289e4572ae2214b56c963362620009ce"></a><!-- doxytag: member="parser_macros.h::seen" ref="289e4572ae2214b56c963362620009ce" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const char* <a class="el" href="parser__macros_8h.html#289e4572ae2214b56c963362620009ce">seen</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Keeps track of an embedded language. <dl class="note" compact><dt><b>Note:</b></dt><dd>This is only used for line counting parsers. </dd></dl>
</div>
</div><p>
<a class="anchor" name="1998d6eddc359fdb029fe1dc0b9a50b3"></a><!-- doxytag: member="parser_macros.h::stack" ref="1998d6eddc359fdb029fe1dc0b9a50b3" args="[5]" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="parser__macros_8h.html#1998d6eddc359fdb029fe1dc0b9a50b3">stack</a>[5] </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Required by Ragel.
</div>
</div><p>
<a class="anchor" name="49aa6b4212d238e0be3312cf89738b98"></a><!-- doxytag: member="parser_macros.h::te" ref="49aa6b4212d238e0be3312cf89738b98" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char* <a class="el" href="parser__macros_8h.html#49aa6b4212d238e0be3312cf89738b98">te</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Required by Ragel.
</div>
</div><p>
<a class="anchor" name="f93f4f37fc2ad9c37af4a715423b110c"></a><!-- doxytag: member="parser_macros.h::top" ref="f93f4f37fc2ad9c37af4a715423b110c" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="parser__macros_8h.html#f93f4f37fc2ad9c37af4a715423b110c">top</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Required by Ragel.
</div>
</div><p>
<a class="anchor" name="366fc4d3a72013313c8b00233a5a7690"></a><!-- doxytag: member="parser_macros.h::ts" ref="366fc4d3a72013313c8b00233a5a7690" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">char* <a class="el" href="parser__macros_8h.html#366fc4d3a72013313c8b00233a5a7690">ts</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Required by Ragel.
</div>
</div><p>
<a class="anchor" name="6610fa10e2ad8df10bb6e04babf0bbd8"></a><!-- doxytag: member="parser_macros.h::whole_line_comment" ref="6610fa10e2ad8df10bb6e04babf0bbd8" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int <a class="el" href="parser__macros_8h.html#6610fa10e2ad8df10bb6e04babf0bbd8">whole_line_comment</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Flag indicating whether or not the current line contains only a comment. <dl class="note" compact><dt><b>Note:</b></dt><dd>This is only used for line counting parsers. </dd></dl>
</div>
</div><p>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Aug 28 15:20:08 2009 for ohcount by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
</body>
</html>
|