!+ ! Tools Group ! Space Telescope Science Institute ! 3700 San Martin Drive ! Baltimore, MD 21218 ! ! NAME ! STRIP_MACRO_COMMENTS ! ! DESCRIPTION ! This module scans a VAX MACRO line and strips out any comments ! from the line. A VAX macro comment starts with a ';'. This routine ! is needed to build up VAX MACRO statements over many lines to ! simplify macro recognition. ! ! RETURN VALUE ! ! HISTORY ! 11/88 Bauer First cut. !- MODULE STRIP_MACRO_COMMENTS; ! ! --- Set definitions --- ! SET blank ( ' ' ); SET horizontal_tab ( s'ht' ); SET form_feed ( s'ff' ); SET end_of_line ( s'eol' ); SET end_of_stream ( s'eos' ); SET open_paren ( '(' ); SET close_paren ( ')' ); SET open_bracket ( '[' ); SET close_bracket ( ']' ); SET ampersand ( '&' ); SET asterisk ( '*' ); SET colon ( ':' ); SET semi_colon ( ';' ); SET equal ( '=' ); SET comma ( ',' ); SET period ( '.' ); SET single_quote ( '''' ); SET double_quote ( '"' ); SET underscore ( '_' ); SET hyphen ( '-' ); SET dollar_sign ( '$' ); SET numeric_char ( '0'..'9' ); SET lower_alpha_char ( 'a'..'z' ); SET upper_alpha_char ( 'A'..'Z' ); SET alpha_char ( '_' OR lower_alpha_char OR upper_alpha_char ); SET alpha_num ( alpha_char OR numeric_char ); SET white_space ( blank OR horizontal_tab OR form_feed ); SET non_white_space ( NOT ( blank OR horizontal_tab OR form_feed OR end_of_line OR end_of_stream ) ); SET any ( NOT ( end_of_line or end_of_stream ) ); ! ! --- Token definitions --- ! TOKEN ignore_spaces IGNORE { { white_space }... }; TOKEN comment_T ALIAS ';' { ';' }; TOKEN eol_T { end_of_line }; ! ! --- MACRO definitions --- ! MACRO comment_M TRIGGER { ';' FIND(s'eol') eol_T }; ANSWER ''; END MACRO; ! ! --- PROCEDURE definitions --- ! PROCEDURE strip_macro_comments (from_string : STRING); DECLARE temp : STRING; START SCAN INPUT STRING from_string OUTPUT STRING temp; from_string = temp; END PROCEDURE; END MODULE;