initial attempt at a plugin API
introduce gcc-common.h
add gcc-gimple.{c|h} and gcc-rtl.{c|h}
expose the cfg edge flags needed by the python plugin

With this commit, the python plugin's full test suite passes
implement GccCfgI_ForEachBlock; fix reference leak
introduce GccLocationI
introduce GccFunctionI
eliminate camel case, using underscores

Here's the script I used to do this (changing the glob as appropriate):

import glob
import re

def split_by_case(s):
    result = []
    nextword = ''
    for ch in s:
        if ch.isupper():
            if nextword:
                result.append(nextword)
            nextword = ch.lower()
        else:
            nextword += ch
    if nextword:
        result.append(nextword)
    # Drop trailing "I":
    if result[-1] == 'i':
        result = result[0:-1]
    return result

for f in glob.glob('generate-*.py'):
    result = []
    for line in open(f):
        m = re.match('.*(Gcc[A-Z][a-z][A-Za-z]+)_([A-Z][a-z][A-Za-z]+)', line)
        if m:
            print repr(line)
            print m.groups()
            print m.group(0)
            old = m.group(1) + '_' + m.group(2)
            if old != 'GccWrapper_New':
                new = '_'.join(split_by_case(m.group(1)) + split_by_case(m.group(2)))
                line = line.replace(old, new)
        m = re.match('.*(Gcc[A-Z][A-Za-z]+I)', line)
        if m:
            print m.groups()
            new = '_'.join(split_by_case(m.group(1)))
            line = line.replace(m.group(1), new)
        result += line

    print ''.join(result)
    with open(f, 'w') as out:
        out.write(''.join(result))
fixup design.rst
Merge pull request #3 from kevin-dot-pyle/master

Minor build system improvements
rename test cases to fix issues with checkouts on OS X case-insensitive filesystems

tests/cpychecker/Py_BuildValue/code_d -> tests/cpychecker/Py_BuildValue/code_lower_d
tests/cpychecker/Py_BuildValue/code_D  -> tests/cpychecker/Py_BuildValue/code_upper_D
generate the API headers from an XML description

Within the proposed-plugin-api directory, introduce an XML format for
describing APIs (itself described via the RelaxNG schema api.rng), and
add new XML files describing the proposed API:

  cfg.xml
  constant.xml
  declaration.xml
  function.xml
  gimple.xml
  location.xml
  rtl.xml
  tree.xml
  type.xml

Add a new Python module:
  xmltypes.py
for working with these API files.

Add a script xml-to-h.py which uses the above to generate the header files:
  gcc-cfg.h
  gcc-constant.h
  gcc-declaration.h
  gcc-function.h
  gcc-gimple.h
  gcc-location.h
  gcc-rtl.h
  gcc-tree.h
  gcc-type.h

along with:
  gcc-public-types.h
  gcc-semiprivate-types.h

The file gcc-common.h is *not* autogenerated, and remains under SCM control
(all the other headers are added to .gitignore).  The C files are also not
autogenerated.

This isolates some of the implementation details of how we wrap the API from
the decisions about what to wrap, and should (I hope) make it easier to deal
with the complex class hierarchies (e.g. tree)
api.rng: factor out a common definition of <attribute>
api.rng: fix indentation
add callgraph.xml/gcc-callgraph.c and port the python plugin to use it
add variable.xml/gcc-variable.c and port the python plugin to use it
remove generated API headers on a "make clean"
change PyGccTree to wrap a gcc_tree rather than a tree

Initial stage of encapsulating GCC tree internals from PyGccTree.

In this commit we merely change PyGccTree to wrap a gcc_tree (rather than a
tree), adding the hooks everywhere to bypass encapusalation (using
gcc_private_make_tree and .inner).
add IMPLEMENT_DOWNCAST
add gcc_decl_get_location