aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/gluegen/GlueGen.java
Commit message (Collapse)AuthorAgeFilesLines
* GlueGen: 'from expression' -> 'with expression'Sven Gothel2023-08-101-1/+1
|
* Bug 1450: Be more verbose w/ JavaEmitter comment lines for enums and ↵Sven Gothel2023-08-101-3/+8
| | | | defines, include native expression
* feat(callbackGenerator): Prevent generation of CallBack interface if setter ↵Mathieu Féry2023-08-041-1/+1
| | | | related isn't present
* GlueGen: Rename GlueEmitter.getConfig{uration->}() and drop ↵Sven Gothel2023-06-251-1/+1
| | | | JavaEmitter.getConfig(), cleaning up API usage
* CPP Enable Pragma Once: Remove cli '--enablePragmaOnce' option as it is ↵Sven Gothel2023-06-181-4/+1
| | | | enabled by default
* Merge remote-tracking branch ↵Sven Gothel2023-06-181-4/+8
|\ | | | | | | 'Mathieu_Fery/feature/add_preserveGeneratedCPP_option'
| * feat(cli): Add --preserveGeneratedCPP option inside GlueGenMathieu Féry2023-06-161-3/+7
| |
* | Merge remote-tracking branch ↵Sven Gothel2023-06-181-1/+9
|\ \ | | | | | | | | | 'Mathieu_Fery/feature/improve_logs_inside_translation_unit'
| * | feat(translationUnit): Improve logs in case of failure inside translationUnitMathieu Féry2023-06-161-1/+9
| |/
* | fix(cli): Fix disablePragmaOnce optionFéry Mathieu (Mathius)2023-06-181-1/+1
| | | | | | | | Option set enablePragmaOnce to true instead false
* | CPP Enable Pragma Once: Default is 'true', since usually all compiler and ↵Sven Gothel2023-06-181-2/+5
| | | | | | | | APIs do support this feature
* | CPP Enable Pragma Once: Add GlueGen.run(..) debug output w/ all paramterSven Gothel2023-06-181-2/+7
| |
* | feat(feature): Enable pragma once managementMathieu Féry2023-06-161-4/+8
|/
* Bug 1153 - GlueGen: Support [const] [native] expressions and conversion to ↵Sven Gothel2015-04-011-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | java space, incl. [native] numbers Rewrite ConstantDefinition: Add sub-class CNumber: - containing integer/float values and their original qualifiers [long, double, unsigned] - conversion to java number ConstantDefinition: - holds native expression - optionally holds CNumber representing native expression, if [only] a number - can compute equivalent java expression with result type (JavaExpr) Add static native number reg-expression for number detection and parsing. Add static native number to CNumber conversion methods. +++ Retrieve full LISP tree and convert to serialized expression to be utilized for expressions used in enumerates. Parse enumerates, allowing const native expressions: - Utilize ConstantDefinition either for definite CNumber or expression - Simply add "+1" for new default values, if previous is an expression
* Bug 1149 - Replacing PCPP w/ JCPP: Name used CPP impl.Sven Gothel2015-03-241-7/+9
|
* Bug 1149 - Replacing PCPP w/ JCPP, allowing complete macro handling (Part-2: ↵Sven Gothel2015-03-241-2/+3
| | | | JCPP submodule, build, test and doc)
* Bug 1149 - Replacing PCPP w/ JCPP, allowing complete macro handling (Part-1: ↵Sven Gothel2015-03-231-38/+44
| | | | Cleanup / Preparation)
* Bug 1134 - Add ASTLocusTagProvider for Define and fix newline in c-parser ↵Sven Gothel2015-03-091-2/+1
| | | | (Expose source location for log/error messages)
* Bug 1134 - Fix aliased typedef struct emissionSven Gothel2015-03-091-9/+4
| | | | | | | | | | | | | | | | | | | | | | - Code regarding 'aliased typedef struct' is tagged in JavaEmitter and HeaderParser: 'NOTE: Struct Name Resolution (JavaEmitter, HeaderParser)' Prefers containing cstruct typedef pointer if available _and_ if cstruct is _not_ a typedef! - Removed: 'HeaderParser.resolveAnonCompound(..)' no more required, since CompoundType always sets its name! Commit cf9f28cf249393f42d7d2835775521dfadee6b92 - JavaEmitter.emitStruct: - Regard above 'aliased typedef struct' NOTE - JavaEmitter.typeToJavaType: - Regard above 'aliased typedef struct' NOTE - ReferencedStructs - Drop duplicate CompoundType instances of same name. This can happen due to const/volatile and ASTLocusTag variants.
* Bug 1134 - Pass ASTLocationTag to all types, used for GlueGenExceptionSven Gothel2015-03-071-2/+4
| | | | | Enhances semantic exception in code generation by adding the AST location of the type or function declaration.
* Bug 1134 - Refine Logging using 'LoggerIf' - Replace System.err w/ Logging ↵Sven Gothel2015-03-061-0/+7
| | | | where appropriate
* Bug 1134 - Add ASTLocationTag, locating source of [semantic] errors while ↵Sven Gothel2015-03-061-2/+4
| | | | | | | parsing / analyzing New GlueGenException supports ASTLocationTag, which will be throws in case of semantic and/or parsing errors.
* Bug 1134 - Enhance GlueGen Compiler: Minimal GL Header Changes _and_ TypesafetySven Gothel2015-03-051-34/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - We shall be able to import 'most' vanilla GL header, i.e. only change the typedef part using our GlueGen types - Type Safety: - GlueGen now detects '#define' and 'enum' redefines and throw an exception in this case. This helps detecting wrongly renamed GL extensions into core! - GlueGen now detects function redefines (overloading) and throw an exception in this case. Hence the semantics of duplicate functions has to be equal! This helps detecting wrongly renamed GL extensions into core! - Semantic equality for all types is provided via interface TypeComparator.SemanticEqualityOp, i.e. 'boolean equalSemantics(..)' implemented by com.jogamp.gluegen.cgram.types.Type. Semantic equality can be relaxed via config "RelaxedEqualSemanticsTest true", i.e. ignoring integer size, and const / volatile qualifiers. - All equality/hash methods of 'com.jogamp.gluegen.cgram.types.*' are restructured. - Track and simplify renamed 'symbol', i.e. use a common sub-interface for all renamed symbols (ConstantDefinition, FunctionSymbol, ..) - This is provided in a unified manner via interface com.jogamp.gluegen.cgram.types.AliasedSymbol and its common implementation AliasedSymbolImpl - All JavaConfiguration.shouldIgnore* methods operate w/ 'AliasedSymbol' trying to match all aliases. - Support 'struct NAME [ { ... } ]' w/o typedef's - New GL / CL headers do not use typedef's for anonymous opaque types - Opaque Type handling - JavaConfiguration.typeInfo(..), identifying opaque types, no more back references from target-type -> typedef. Hence the following is possible now: typedef void * Opaque01; // Opaque typedef void * APointerBuffer; // A Buffer - All Logger instances are no more static and derive their warning level from the package's root Logger via Logging.getLogger(..).
* Code Clean-Up based on our Recommended Settings (jogamp-scripting ↵Sven Gothel2014-07-031-53/+53
| | | | | | | | | | | | | | | c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) - Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines
* gluegen: update HeaderParser grammar to annotation EnumType map and ↵Harvey Harrison2014-05-311-2/+1
| | | | | | functions list Signed-off-by: Harvey Harrison <[email protected]>
* gluegen: avoid appending Strings in a loop, pull out a Stringbuilder we can ↵Harvey Harrison2014-05-171-11/+17
| | | | | | | | reuse Reuse a single stringbuilder to build all the comment strings and emit them if required. Signed-off-by: Harvey Harrison <[email protected]>
* gluegen: add all missing @Override annotationsHarvey Harrison2013-10-171-0/+3
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* gluegen: remove trailing whitespaceHarvey Harrison2013-10-171-12/+12
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* GlueGen: Expose public static debug()Sven Gothel2011-12-181-7/+6
|
* Reversed Type relocation ; Minor fixSven Gothel2011-07-211-4/+0
| | | | | | | Reversed Type relocation (commit 92d6c9dc5fa72b01703456452c60822f36c14fff) from com.jogamp.gluegen.runtime.types back to com.jogamp.gluegen.cgram.types Enabled MemoryLayoutType.setLayouted(), avoiding double layout
* GlueGen proper size / alignment of primitive and compound types usage [2/2] ↵Sven Gothel2011-07-211-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | - Fin MachineDesction == MD MD.StaticConfig: - enum for all supported static configs (ID -> MD) - verified at runtime: test runtime queried-MD versus static-MD, hard fail if not compatible (size/alignment) SizeThunk primitive sizes: - Add notion of fixed native size (eg. int64_t) and otherwise (eg. long) java struct 'wrappers' code generation: - single class using size/offset arrays of all MachineDescription configurations - at runtime the array idx is queried in static block - type aligment for not fixed-native-size types (SizeThunk, undef long/int) via StructAccessor junit test: - add float test - fix native code - add java (create, write) -> native (verify) test works (tested) on: linux 32/64 and windows 32/64
* Cleanup: Platform CPU enum, MachineDescription,Sven Gothel2011-07-201-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Platform: - enum CPUFamily is part of CPUType - DALVIK -> ANDROID - ARM: ARM + ARMv[567] MachineDescription - self contained - static size/alignment Config (enum) for unix32, unix64, win32, win64 and armeabi - add 'long double' - Removed MachineDescription32Bit, MachineDescription64Bit - createStatic(..) uses OS/CPU to fetch best match if not at runtime FIXES: JavaEmitter's struct-emit: Proper 32/64 struct sizes TODO: StructAccessor's mapping to <Type>Buffer w/ index os sizeof(<Type>) doesn't work, since offset may not be multiple of sizeof(<Type>)! i.e. typedef struct { int8_t bits1; // +1 - 0 // +3 (p32) int32_t id; // +4 - 4 int8_t bits2; // +1 - 8 // +3 (p32) - int64_t long0; // +8 - 12 so "longBuffer.get(<type-sized index>)" is invalid, but "byteBuffer.getLong(<byte index>)" must be done. The actual impl. doesn't matter, hence dropping the other nio type mappings is good.
* - Moved most types and StructLayout to runtime package:Sven Gothel2011-07-181-0/+4
| | | | | | | | | | | | | | | | | | | | | com.jogamp.gluegen.cgram.types -> com.jogamp.gluegen.runtime.types This is required for desired runtime memory layout. - Split CompoundType to StructType + UnionType - StructLayout: - Utilizing SizeThunk alignment - Alignment 1) Natural type alignment 2) Add Size 3) Trailing padding w/ largest element alignment - Only perform memory layout once for type. Status: - Unit test passes w/ static MachineDescriptor64Bit - FIXME static 32bit is faulty, uses 64bit size/alignment - TODO runtime struct layout to please all platforms w/o worrying
* GlueGen proper size / alignment of primitive and compound types usage [1/2] ↵Sven Gothel2011-07-171-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Preparation. Currently GlueGen fails for type long (size) and some alignments (see package.html). - The size and alignment values shall be queried at runtime. - Compound alignment needs to follow the described natural alignment (also @runtime). - - Build - add Linux Arm7 (EABI) - junit test - added compound/struct tests, pointing out the shortcomings of current impl. - package.html - Added alignment documentation - remove intptr.cfg - add GluGen types int8_t, int16_t, uint8_t, uint16_t - move MachineDescription* into runtime - Platform - has runtime MachineDescription - moved size, .. to MachineDescription - use enums for OSType, CPUArch and CPUType defined by os.name/os.arch, triggering exception if os/arch is not supported. This avoids Java String comparison and conscious os/arch detection. - MachineDescription: - compile time instances MachineDescription32Bits, MachineDescription64Bits - runtime queried instance MachineDescriptionRuntime - correct size, alignment, page size, ..
* GlueGen: Close in/out streams to allow deleteOnExit() to succeed on WindowsSven Gothel2010-11-251-0/+3
|
* JogampVersion: StringBuffer getInfo(StringBuffer) -> StringBuffer ↵Sven Gothel2010-11-141-1/+1
| | | | toStringBuffer(StringBuffer) ; Add String toString() { ..}
* com.jogamp.common.util.GlueGenVersion -> com.jogamp.common.GlueGenVersionSven Gothel2010-11-121-1/+1
|
* New: JogampVersion, providing generic information for Jogamp JAR archives; ↵Sven Gothel2010-11-121-0/+2
| | | | | | | | | VersionInfo -> GlueGenVersion JogampVersion, providing generic information for Jogamp JAR archives Accessor to the Jogamp specific manifest additions, ie branch and commit. Also provides convenient attribute access and version dump methods.
* Enhance API doc .. package description etcSven Gothel2010-11-091-50/+0
|
* Gluegen: Types (stddef/stdint), Header and Predefined Macro ChangeSven Gothel2010-11-091-11/+48
| | | | | | | | | | | | | Read API doc ad GlueGen.java New predefined types: wchar_t, intptr_t, uintptr_t New reusable headers for gluegen usage: make/stub_includes/gluegen for native usage: make/stub_includes/platform New predefined macro #define __GLUEGEN__ 2
* Fix PCPP 'define' case; Keep PCPP output file if 'debug' ; GlueGen uses PCPP ↵Sven Gothel2010-11-071-13/+14
| | | | | | | | | | | | | | | | | | | | | | | | in same thread via File. Fix PCPP 'define' case ------------------------ A recursive define like: #define LALA ((int)1) #define LILI LALA was streamed out of PCPP, even though such 'macro defines' like #define LILI ((int)1) are disabled due to the parsers inability to digg those. Added test on macro definition for replaced values. GlueGen uses PCPP in same thread via File ------------------------------------------ To ease debugging we call PCPP from the same thread and use normal temp files as i/o. Keep PCPP output file if 'debug' --------------------------------- Keep temp outfile if debug is enabled
* Gluegen/PCPP: Refined PCPP if-elif-else-endif ; Add 'dumpCPP' option to ↵Sven Gothel2010-11-071-3/+7
| | | | direct PCPP to dump the output to stderr as well
* Renamed com.sun.gluegen -> com.jogamp.gluegenSven Gothel2010-11-061-0/+397