######################################################################## # # # This software is part of the ast package # # Copyright (c) 1985-2011 AT&T Intellectual Property # # and is licensed under the # # Eclipse Public License, Version 1.0 # # by AT&T Intellectual Property # # # # A copy of the License is available at # # http://www.eclipse.org/org/documents/epl-v10.html # # (with md5 checksum b35adb5213ca9657e911e9befb180842) # # # # Information and Software Systems Research # # AT&T Research # # Florham Park NJ # # # # Glenn Fowler # # David Korn # # Phong Vo # # # ######################################################################## : generate " + + " include sequence matchstr $Argc { 0 { } * { eval $1 shift } } for i in ["#include " "#include #ifndef S_IFDIR #include #endif" "#include #ifndef S_IFDIR #include #include #endif" "#ifndef S_IFDIR #include #include #endif]" { echo "$i struct stat V_stat_V; F_stat_F() { V_stat_V.st_mode = 0; }" > $tmp.c if $cc -c $tmp.c >/dev/null { echo $i break } } (CommandList children: [ (C {(Lit_Other ":")} {(generate)} {(DQ (" + + "))} {(include)} {(sequence)} ) (Case to_match: {($ VSub_Pound "$#")} arms: [ (case_arm pat_list:[{(0)}] spids:[818284-1]) (case_arm pat_list: [{(Lit_Other "*")}] action: [(C {(eval)} {($ VSub_Number "$1")}) (C {(shift)})] spids: [86 87 97 -1] ) ] spids: [75 79 99] ) (ForEach iter_name: i iter_words: [ {(DQ ("#include "))} { (DQ ("#include \n") ("#ifndef S_IFDIR\n") ("#include \n") ("#endif")) } { (DQ ("#include \n") ("#ifndef S_IFDIR\n") ("#include \n") ("#include \n") ("#endif") ) } { (DQ ("#ifndef S_IFDIR\n") ("#include \n") ("#include \n") ("#endif")) } ] do_arg_iter: False body: (DoGroup children: [ (SimpleCommand words: [ {(echo)} { (DQ ($ VSub_Name "$i") ("\n") ("struct stat V_stat_V;\n") ("F_stat_F() { V_stat_V.st_mode = 0; }") ) } ] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {($ VSub_Name "$tmp") (.c)} spids: [144] ) ] ) (If arms: [ (if_arm cond: [ (SimpleCommand words: [{($ VSub_Name "$cc")} {(-c)} {($ VSub_Name "$tmp") (.c)}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[159])] ) ] action: [ (C {(echo)} {(DQ ($ VSub_Name "$i"))}) (ControlFlow token:) ] spids: [-1 163] ) ] spids: [-1 175] ) ] spids: [133 177] ) spids: [106 -1] ) ] )