parameters: (file_contents)
return_statement: return clean_file_contents
docstring: Removes strings, C style and C++ comments style comments and macros from file_contents
docstring_summary: Removes strings, C style and C++ comments style comments and macros from file_contents
docstring_tokens: Removes strings C style and C ++ comments style comments and macros from file_contents
function: def get_clean_file_contents(file_contents):
      """
      Removes strings, C style and C++ comments style comments and macros from file_contents
      """
  
      clean_file_contents = file_contents
  
      # remove all strings
      # a string is something that starts with a (") and ends with a ("), can have any character inside it except a (")
      # that is not preceded by a slash (\) that is not preceded by another slash
      # this means a string can contains a \\ escape sequence
      # a string can contain a \" escape sequence
      # a string can end with  \\", but it does not end with \"
      string_re = re.compile(r'"((?!((?<!((?<!\\)\\))")).)*"', re.DOTALL)
  
      # 'x' is passed as a marker, to mark the beginning and of strings
      # to preserve spacing around string beginning and end
      clean_file_contents = clean_string_from_regex(clean_file_contents, string_re, 'x')
  
      # remove character literals
      # a character literal is defined like a string (replacing single quotes with double quotes)
      # this is a big relaxation of the problem for C/C++
      char_re = re.compile(r'\'((?!((?<!((?<!\\)\\))\')).)*\'')
  
      clean_file_contents = clean_string_from_regex(clean_file_contents, char_re, 'x')
  
      # remove multi-line comments
      ml_comment_re = re.compile(r'(\s*)/\*((?!\*/).)*\*/', re.DOTALL)
      clean_file_contents = clean_string_from_regex(clean_file_contents, ml_comment_re, '')
  
      # remove single line comments
      sl_comment_re = re.compile(r'[ \t\r\f]*//.*$', re.MULTILINE)
      clean_file_contents = re.sub(sl_comment_re, '', clean_file_contents)
  
      # remove single-line and multi-line macros
      # a macro is #define statement followed by a few statements that have a slash in the line before it
      macro_re = re.compile(r'#define(\s+)(((?!\\).)+)((\\\n(((?!\\).)+))*)')
      clean_file_contents = clean_string_from_regex(clean_file_contents, macro_re, '')
  
      return clean_file_contents
function_tokens: def get_clean_file_contents ( file_contents ) : clean_file_contents = file_contents # remove all strings # a string is something that starts with a (") and ends with a ("), can have any character inside it except a (") # that is not preceded by a slash (\) that is not preceded by another slash # this means a string can contains a \\ escape sequence # a string can contain a \" escape sequence # a string can end with  \\", but it does not end with \" string_re = re . compile ( r'"((?!((?<!((?<!\\)\\))")).)*"' , re . DOTALL ) # 'x' is passed as a marker, to mark the beginning and of strings # to preserve spacing around string beginning and end clean_file_contents = clean_string_from_regex ( clean_file_contents , string_re , 'x' ) # remove character literals # a character literal is defined like a string (replacing single quotes with double quotes) # this is a big relaxation of the problem for C/C++ char_re = re . compile ( r'\'((?!((?<!((?<!\\)\\))\')).)*\'' ) clean_file_contents = clean_string_from_regex ( clean_file_contents , char_re , 'x' ) # remove multi-line comments ml_comment_re = re . compile ( r'(\s*)/\*((?!\*/).)*\*/' , re . DOTALL ) clean_file_contents = clean_string_from_regex ( clean_file_contents , ml_comment_re , '' ) # remove single line comments sl_comment_re = re . compile ( r'[ \t\r\f]*//.*$' , re . MULTILINE ) clean_file_contents = re . sub ( sl_comment_re , '' , clean_file_contents ) # remove single-line and multi-line macros # a macro is #define statement followed by a few statements that have a slash in the line before it macro_re = re . compile ( r'#define(\s+)(((?!\\).)+)((\\\n(((?!\\).)+))*)' ) clean_file_contents = clean_string_from_regex ( clean_file_contents , macro_re , '' ) return clean_file_contents