Changes in uspace/app/sbi/src/parse.c [23de644:1ebc1a62] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/sbi/src/parse.c
r23de644 r1ebc1a62 79 79 static stree_except_t *parse_except(parse_t *parse); 80 80 81 /** Initialize parser object.82 *83 * Set up parser @a parse to use lexer @a lex for input and to store84 * output (i.e. new declarations) to program @a prog. @a prog is not85 * necessarily empty, the declarations being parsed are simply added86 * to it.87 *88 * @param parse Parser object.89 * @param prog Destination program stree.90 * @param lex Input lexer.91 */92 81 void parse_init(parse_t *parse, stree_program_t *prog, struct lex *lex) 93 82 { … … 102 91 } 103 92 104 /** Parse module. 105 * 106 * Parse a program module. 107 * 108 * The input is read using the lexer associated with @a parse. The resulting 109 * declarations are added to existing declarations in the program associated 110 * with @a parse. 111 * 112 * If any parse error occurs, parse->error will @c b_true when this function 113 * returns. parse->error_bailout will be @c b_true if the error has not 114 * been recovered yet. Similar holds for other parsing functions in this 115 * module. 116 * 117 * @param parse Parser object. 118 */ 93 /** Parse module. */ 119 94 void parse_module(parse_t *parse) 120 95 { … … 142 117 } 143 118 144 /** Parse class, struct or interface declaration. 145 * 146 * @param parse Parser object. 147 * @param dclass What to parse: @c lc_class, @c lc_struct or @c lc_csi. 148 * @param outer_csi CSI containing this declaration or @c NULL if global. 149 * @return New syntax tree node. 150 */ 119 /** Parse class, struct or interface declaration. */ 151 120 static stree_csi_t *parse_csi(parse_t *parse, lclass_t dclass, 152 121 stree_csi_t *outer_csi) … … 200 169 } 201 170 202 /** Parse class, struct or interface member. 203 * 204 * @param parse Parser object. 205 * @param outer_csi CSI containing this declaration or @c NULL if global. 206 * @return New syntax tree node. 207 */ 171 /** Parse class, struct or interface member. */ 208 172 static stree_csimbr_t *parse_csimbr(parse_t *parse, stree_csi_t *outer_csi) 209 173 { … … 247 211 248 212 249 /** Parse member function. 250 * 251 * @param parse Parser object. 252 * @param outer_csi CSI containing this declaration or @c NULL if global. 253 * @return New syntax tree node. 254 */ 213 /** Parse member function. */ 255 214 static stree_fun_t *parse_fun(parse_t *parse, stree_csi_t *outer_csi) 256 215 { … … 338 297 } 339 298 340 /** Parse member variable. 341 * 342 * @param parse Parser object. 343 * @param outer_csi CSI containing this declaration or @c NULL if global. 344 * @return New syntax tree node. 345 */ 299 /** Parse member variable. */ 346 300 static stree_var_t *parse_var(parse_t *parse, stree_csi_t *outer_csi) 347 301 { … … 364 318 } 365 319 366 /** Parse member property. 367 * 368 * @param parse Parser object. 369 * @param outer_csi CSI containing this declaration or @c NULL if global. 370 * @return New syntax tree node. 371 */ 320 /** Parse member property. */ 372 321 static stree_prop_t *parse_prop(parse_t *parse, stree_csi_t *outer_csi) 373 322 { … … 475 424 } 476 425 477 /** Parse symbol attribute. 478 * 479 * @param parse Parser object. 480 * @param outer_csi CSI containing this declaration or @c NULL if global. 481 * @return New syntax tree node. 482 */ 426 /** Parse symbol attribute. */ 483 427 static stree_symbol_attr_t *parse_symbol_attr(parse_t *parse) 484 428 { … … 498 442 } 499 443 500 /** Parse formal function argument. 501 * 502 * @param parse Parser object. 503 * @return New syntax tree node. 504 */ 444 /** Parse formal function argument. */ 505 445 static stree_proc_arg_t *parse_proc_arg(parse_t *parse) 506 446 { … … 528 468 } 529 469 530 /** Parse argument attribute. 531 * 532 * @param parse Parser object. 533 * @return New syntax tree node. 534 */ 470 /** Parse argument attribute. */ 535 471 static stree_arg_attr_t *parse_arg_attr(parse_t *parse) 536 472 { … … 550 486 } 551 487 552 /** Parse statement block. 553 * 554 * @param parse Parser object. 555 * @return New syntax tree node. 556 */ 488 /** Parse statement block. */ 557 489 static stree_block_t *parse_block(parse_t *parse) 558 490 { … … 577 509 } 578 510 579 /** Parse statement. 580 * 581 * @param parse Parser object. 582 * @return New syntax tree node. 583 */ 511 /** Parse statement. */ 584 512 stree_stat_t *parse_stat(parse_t *parse) 585 513 { … … 648 576 } 649 577 650 /** Parse variable declaration statement. 651 * 652 * @param parse Parser object. 653 * @return New syntax tree node. 654 */ 578 /** Parse variable declaration statement. */ 655 579 static stree_vdecl_t *parse_vdecl(parse_t *parse) 656 580 { … … 679 603 } 680 604 681 /** Parse @c if statement. 682 * 683 * @param parse Parser object. 684 * @return New syntax tree node. 685 */ 605 /** Parse @c if statement, */ 686 606 static stree_if_t *parse_if(parse_t *parse) 687 607 { … … 709 629 } 710 630 711 /** Parse @c while statement. 712 * 713 * @param parse Parser object. 714 */ 631 /** Parse @c while statement. */ 715 632 static stree_while_t *parse_while(parse_t *parse) 716 633 { … … 731 648 } 732 649 733 /** Parse @c for statement. 734 * 735 * @param parse Parser object. 736 * @return New syntax tree node. 737 */ 650 /** Parse @c for statement. */ 738 651 static stree_for_t *parse_for(parse_t *parse) 739 652 { … … 758 671 } 759 672 760 /** Parse @c raise statement. 761 * 762 * @param parse Parser object. 763 */ 673 /** Parse @c raise statement. */ 764 674 static stree_raise_t *parse_raise(parse_t *parse) 765 675 { … … 777 687 } 778 688 779 /** Parse @c return statement. 780 * 781 * @param parse Parser object. 782 * @return New syntax tree node. 783 */ 689 /** Parse @c return statement. */ 784 690 static stree_return_t *parse_return(parse_t *parse) 785 691 { … … 798 704 } 799 705 800 /* Parse @c with-except-finally statement. 801 * 802 * @param parse Parser object. 803 * @return New syntax tree node. 804 */ 706 /* Parse @c with-except-finally statement. */ 805 707 static stree_wef_t *parse_wef(parse_t *parse) 806 708 { … … 844 746 } 845 747 846 /* Parse expression statement. 847 * 848 * @param parse Parser object. 849 * @return New syntax tree node. 850 */ 748 /* Parse expression statement. */ 851 749 static stree_exps_t *parse_exps(parse_t *parse) 852 750 { … … 866 764 } 867 765 868 /* Parse @c except clause. 869 * 870 * @param parse Parser object. 871 * @return New syntax tree node. 872 */ 766 /* Parse @c except clause. */ 873 767 static stree_except_t *parse_except(parse_t *parse) 874 768 { … … 891 785 } 892 786 893 /** Parse identifier. 894 * 895 * @param parse Parser object. 896 * @return New syntax tree node. 897 */ 787 /** Parse identifier. */ 898 788 stree_ident_t *parse_ident(parse_t *parse) 899 789 { … … 911 801 } 912 802 913 /** Signal a parse error, start bailing out from parser. 914 * 915 * @param parse Parser object. 916 */ 803 /** Signal a parse error, start bailing out from parser. */ 917 804 void parse_raise_error(parse_t *parse) 918 805 { … … 921 808 } 922 809 923 /** Note a parse error that has been immediately recovered. 924 * 925 * @param parse Parser object. 926 */ 810 /** Note a parse error that has been immediately recovered. */ 927 811 void parse_note_error(parse_t *parse) 928 812 { … … 930 814 } 931 815 932 /** Check if we are currently bailing out of parser due to a parse error. 933 * 934 * @param parse Parser object. 935 */ 816 /** Check if we are currently bailing out of parser due to a parse error. */ 936 817 bool_t parse_is_error(parse_t *parse) 937 818 { … … 942 823 * 943 824 * Still remember that there was an error, but stop bailing out. 944 *945 * @param parse Parser object.946 825 */ 947 826 void parse_recover_error(parse_t *parse) … … 953 832 } 954 833 955 /** Return current lem. 956 * 957 * @param parse Parser object. 958 * @return Pointer to current lem. Only valid until the lexing 959 * position is advanced. 960 */ 834 /** Return current lem. */ 961 835 lem_t *lcur(parse_t *parse) 962 836 { … … 967 841 } 968 842 969 /** Return current lem lclass. 970 * 971 * @param parse Parser object. 972 * @return Lclass of the current lem. 973 */ 843 /** Retturn current lem lclass. */ 974 844 lclass_t lcur_lc(parse_t *parse) 975 845 { … … 991 861 } 992 862 993 /** Skip to next lem. 994 * 995 * @param parse Parser object. 996 */ 863 /** Skip to next lem. */ 997 864 void lskip(parse_t *parse) 998 865 { … … 1003 870 } 1004 871 1005 /** Verify that lclass of current lem is @a lc. 1006 * 1007 * If a lem of different lclass is found, a parse error is raised and 1008 * a message is printed. 1009 * 1010 * @param parse Parser object. 1011 * @param lc Expected lclass. 1012 */ 872 /** Verify that lclass of current lem is @a lc. */ 1013 873 void lcheck(parse_t *parse, lclass_t lc) 1014 874 { … … 1027 887 } 1028 888 1029 /** Verify that lclass of current lem is @a lc and go to next lem. 1030 * 1031 * If a lem of different lclass is found, a parse error is raised and 1032 * a message is printed. 1033 * 1034 * @param parse Parser object. 1035 * @param lc Expected lclass. 1036 */ 889 /** Verify that lclass of current lem is @a lc and go to next lem. */ 1037 890 void lmatch(parse_t *parse, lclass_t lc) 1038 891 { … … 1057 910 } 1058 911 1059 /** Raise and display generic parsing error. 1060 * 1061 * @param parse Parser object. 1062 */ 912 /** Display generic parsing error. */ 1063 913 void lunexpected_error(parse_t *parse) 1064 914 { … … 1070 920 } 1071 921 1072 /** Determine whether @a lclass is in follow(block). 1073 * 1074 * Tests whether @a lclass belongs to the follow(block) set, i.e. if it is 1075 * lclass of a lem that can follow a block in the program. 1076 * 1077 * @param lclass Lclass. 1078 */ 922 /** Basically tells us whether @a lclass is in next(block). */ 1079 923 bool_t terminates_block(lclass_t lclass) 1080 924 {
Note:
See TracChangeset
for help on using the changeset viewer.