parameters: (var_dict, path, dest_dir, desired_targets=None)
docstring: Parse a gypd file.
  
    Open a file that consists of python dictionaries representing build targets.
    Parse those dictionaries using parse_dictionary. Recursively parses
    referenced files.
  
    Args:
      var_dict: VarsDict object for storing the result of the parse.
      path: Path to gypd file.
      dest_dir: Destination for the eventual Android.mk that will be created from
        this parse, relative to Skia trunk. Used to determine path for source
        files and include directories.
      desired_targets: List of targets to be parsed from this file. If empty,
        parse all targets.
docstring_summary: Parse a gypd file.
docstring_tokens: Parse a gypd file .
function: def parse_gypd(var_dict, path, dest_dir, desired_targets=None):
    """Parse a gypd file.
  
    Open a file that consists of python dictionaries representing build targets.
    Parse those dictionaries using parse_dictionary. Recursively parses
    referenced files.
  
    Args:
      var_dict: VarsDict object for storing the result of the parse.
      path: Path to gypd file.
      dest_dir: Destination for the eventual Android.mk that will be created from
        this parse, relative to Skia trunk. Used to determine path for source
        files and include directories.
      desired_targets: List of targets to be parsed from this file. If empty,
        parse all targets.
    """
    d = {}
    with open(path, 'r') as f:
      # Read the entire file as a dictionary
      d = eval(f.read())
  
    # The gypd file is structured such that the top level dictionary has an entry
    # named 'targets'
    for target in d['targets']:
      target_name = target['target_name']
      if target_name in var_dict.KNOWN_TARGETS:
        # Avoid circular dependencies
        continue
      if desired_targets and target_name not in desired_targets:
        # Our caller does not depend on this one
        continue
      # Add it to our known targets so we don't parse it again
      var_dict.KNOWN_TARGETS.add(target_name)
  
      parse_dictionary(var_dict, target, target_name, dest_dir)
function_tokens: def parse_gypd ( var_dict , path , dest_dir , desired_targets = None ) : d = { } with open ( path , 'r' ) as f : # Read the entire file as a dictionary d = eval ( f . read ( ) ) # The gypd file is structured such that the top level dictionary has an entry # named 'targets' for target in d [ 'targets' ] : target_name = target [ 'target_name' ] if target_name in var_dict . KNOWN_TARGETS : # Avoid circular dependencies continue if desired_targets and target_name not in desired_targets : # Our caller does not depend on this one continue # Add it to our known targets so we don't parse it again var_dict . KNOWN_TARGETS . add ( target_name ) parse_dictionary ( var_dict , target , target_name , dest_dir )