gluegen: avoid a suppressed warning annotation by using the ArrayList copy constructor

clone() can't be used without warnigns and is no more efficient that the copy constructor,
replace the call and kill the suppressed warning annotation.  While here, mark the
modifier list as private final.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
gluegen: remove an unreferenced writer variable

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
gluegen: update antlr grammer to produce annotated enum and functionName sets

The annotations are all commented out, uncomment them and reduce the type warnings
during the build.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
gluegen: move all antlr grammars to a top-level directory

/src/main/antlr/..

This gets the .g files unmixed from the non-generated java files for the cgram/jgram packages.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
gluegen: pair the grammer input folder with an out.dir value

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
gluegen: update the target names for generating java code

Also move the antlr-wrapping targets to be near the one place they are used.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
gluegen: remove some unused imports

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
gluegen: update HeaderParser grammar to annotation EnumType map and functions list

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Fix glibc-compat-symbols.h: Distinguish clang and gcc (Aligned w/ openal-soft commit adc3413dda197bbd6b879ff98e897b8fbc66cc39)
OSX Build: Default gcc.compat.compiler=xcode.clang ; Remove explicit xcode.clang property files
JavaEmitter.typeToJavaType: Simplify if-else block ; JavaType.getDumpString(): Add more info ..
Minor edits: space, final qualifier; setenv-build-*: Add generic JDK location
ReflectionUtil.getConstructor: Add 'initializeClazz' argument, allowing to defer static class initialization
GlueGen: Add support for 'compound call-by-value', i.e. passing and returning struct instance

'compound call-by-value' is not efficient.

However, to allow mapping APIs utilizing passing small structs
as arguments and return values - this feature has been added.

+++

To return the struct value, native code needs to
allocate a NIO ByteBuffer and copy the data.
The stack return value can be dismissed afterwards and the
NIO buffer is returned.

We include this functionality for all generated [impl] classes,
native method:
  'static jobject JVMUtil_NewDirectByteBufferCopy(JNIEnv *env, void * source_address, jlong capacity)'

  (See: 'JavaEmitter.initClassAccessCode')

Since this code requires knowledge of java classes and methods,
for which a reference needs to be acquired, a static initialization method
has been introduced for all generated [impl] classes:
  'private static native boolean initializeImpl();'

Per default the this method will be called in the new
static initializer block of the class,
which can be supressed via the configuration element:
   'ManualStaticInit <class-name>'

'ManualStaticInit' can be used to issue the 'initializeImpl()'
call in a custom static initializer written by the user.

However, at the time 'initializeImpl()' gets called
the JNI native library must have been loaded, of course!

+++

- See tag: // FIXME: Compound call-by-value
  for code changes and validation of completeness

Trigger for compond call-by-value in CMethodBindingEmitter is:
   !cArgType.isPointer() && javaArgType.isCompoundTypeWrapper()

Trigger for compond call-by-value in JavaEmitter is:
  t.isCompound()

+++

Further more we do tolerate 'javaType.isCPrimitivePointerType()',
i.e. adding comments for offset/size and field entries,
which are all NOP.

This allows to utilize the remaining fields of the native structure.

+++

Tests: Added call-by-value to test1.[ch] binding test!
Merge remote-tracking branch 'hharrison/antlr-move'
gluegen: move all antlr grammars to a top-level directory (refine commit e8bc9edd3c39170af038ab23b8cdca9ffd6f2d56): src/antlr (IMHO no need for 'main')

/src/main/antlr/ -> /src/antlr/
complete commit 33eb9484c4675423431521f2271e3e9d8d38f3b2
TestVersionSemantics: No more expecting BACKWARD_COMPATIBLE* (Due to bumping to 2.2.0)
GlueGen: Add support for 'compound array call-by-value'

Completing commit c3054a01990e55ab35756ea23ab7d7c05f24dd37
by allowing passing compound arrays via 'call-by-value.

 - Creating linear temp heap, copying NIO values into it
   and passing to C function.
   Copy-back if not 'const', see below.

 - Respect 'const' qualifier to skip write-back of
   temp heap passed to C function

 - See tag: // FIXME: Compound and Compound-Arrays
   for code changes and validation of completeness

 - triggers for compound arrays are:
     - javaType.isArrayOfCompoundTypeWrappers()
     - type.isArray()

 - simplified const query by c-type: FunctionEmitter.isBaseTypeConst(ctype)

+++

Tests: Added call-by-value to test1.[ch] binding test!
Fix commit f4e753ff1f39be381307ffdb0fb6bb7a2d323eff: 'compound array call-by-value' JavaMethodBindingEmitter, array may still require NIO handling, also consider NIO array length.