<s> __all__ = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> __version__ = '<STR_LIT>' <EOL> from subprocess import Popen , PIPE <EOL> from . c_parser import CParser <EOL> def preprocess_file ( filename , cpp_path = '<STR_LIT>' , cpp_args = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> path_list = [ cpp_path ] <EOL> if isinstance ( cpp_args , list ) : <EOL> path_list += cpp_args <EOL> elif cpp_args != '<STR_LIT>' : <EOL> path_list += [ cpp_args ] <EOL> path_list += [ filename ] <EOL> try : <EOL> pipe = Popen ( path_list , <EOL> stdout = PIPE , <EOL> universal_newlines = True ) <EOL> text = pipe . communicate ( ) [ <NUM_LIT:0> ] <EOL> except OSError as e : <EOL> raise RuntimeError ( "<STR_LIT>" + <EOL> '<STR_LIT>' + <EOL> ( '<STR_LIT>' % e ) ) <EOL> return text <EOL> def parse_file ( filename , use_cpp = False , cpp_path = '<STR_LIT>' , cpp_args = '<STR_LIT>' , <EOL> parser = None ) : <EOL> """<STR_LIT>""" <EOL> if use_cpp : <EOL> text = preprocess_file ( filename , cpp_path , cpp_args ) <EOL> else : <EOL> with open ( filename , '<STR_LIT>' ) as f : <EOL> text = f . read ( ) <EOL> if parser is None : <EOL> parser = CParser ( ) <EOL> return parser . parse ( text , filename ) </s>
