GlueGen v2.6.0-rc-20250712
GlueGen, Native Binding Generator for Java™ (public API).
GlueGen.java
Go to the documentation of this file.
1/*
2 * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
3 * Copyright (c) 2010 JogAmp Community. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met:
8 *
9 * - Redistribution of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * - Redistribution in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * Neither the name of Sun Microsystems, Inc. or the names of
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * This software is provided "AS IS," without a warranty of any kind. ALL
21 * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
22 * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
23 * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
24 * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
25 * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
26 * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
27 * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
28 * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
29 * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
30 * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
31 * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
32 *
33 * You acknowledge that this software is not designed or intended for use
34 * in the design, construction, operation or maintenance of any nuclear
35 * facility.
36 *
37 * Sun gratefully acknowledges that this software was originally authored
38 * and developed by Kenneth Bradley Russell and Christopher John Kline.
39 */
40package com.jogamp.gluegen;
41
42import com.jogamp.common.GlueGenVersion;
43
44import java.io.*;
45import java.util.*;
46import java.util.logging.Level;
47
48import antlr.*;
49
50import com.jogamp.gluegen.cgram.*;
51import com.jogamp.gluegen.cgram.types.*;
52import com.jogamp.gluegen.jcpp.JCPP;
53
54import static java.lang.System.*;
55
56/**
57 * Glue code generator for C functions and data structures.<br>
58 */
59public class GlueGen implements GlueEmitterControls {
60
61 static{
62 Logging.init();
63 }
64
65 private final List<String> forcedStructNames = new ArrayList<String>();
66 private GenericCPP preprocessor;
67
68 // State for SymbolFilters
69 private List<ConstantDefinition> allConstants;
70 private List<FunctionSymbol> allFunctions;
71
72 private static boolean debug = false;
73
74 private static Level logLevel = null;
75
76 public static void setDebug(final boolean v) { debug=v; }
77 public static void setLogLevel(final Level l) { logLevel=l; }
78 public static boolean debug() { return debug; }
79
80 @Override
81 public void forceStructEmission(final String typedefName) {
82 forcedStructNames.add(typedefName);
83 }
84
85 @Override
86 public String findHeaderFile(final String headerFileName) {
87 return preprocessor.findFile(headerFileName);
88 }
89
90 @Override
91 public void runSymbolFilter(final SymbolFilter filter) {
92 filter.filterSymbols(allConstants, allFunctions);
93 final List<ConstantDefinition> newConstants = filter.getConstants();
94 final List<FunctionSymbol> newFunctions = filter.getFunctions();
95 if (newConstants != null) {
96 allConstants = newConstants;
97 }
98 if (newFunctions != null) {
99 allFunctions = newFunctions;
100 }
101 }
102
103 /** GlueGen's build in macro name {@value}, when compiling w/ GlueGen. */
104 public static final String __GLUEGEN__ = "__GLUEGEN__";
105
106 @SuppressWarnings("unchecked")
107 public void run(final Reader reader, final String filename, final Class<?> emitterClass, final List<String> includePaths, final List<String> cfgFiles, final String outputRootDir,
108 final boolean copyCPPOutput2Stderr, final boolean enablePragmaOnce, final boolean preserveGeneratedCPP)
109 {
110 try {
111 if(debug) {
112 Logging.getLogger().setLevel(Level.ALL);
113 System.err.println("GlueGen.run: filename: "+filename+", emitter: "+emitterClass.getName()+", outputRootDir "+outputRootDir+
114 ", copyCPPOutput2Stderr "+copyCPPOutput2Stderr+", enablePragmaOnce "+enablePragmaOnce+", preserveGeneratedCPP "+preserveGeneratedCPP);
115 System.err.println("GlueGen.run: includePaths "+includePaths);
116 System.err.println("GlueGen.run: cfgFiles "+cfgFiles);
117 } else if( null != logLevel ) {
118 Logging.getLogger().setLevel(logLevel);
119 }
120 final GlueEmitter emit;
121 if (emitterClass == null) {
122 emit = new JavaEmitter();
123 } else {
124 try {
125 emit = (GlueEmitter) emitterClass.newInstance();
126 } catch (final Exception e) {
127 throw new RuntimeException("Exception occurred while instantiating emitter class.", e);
128 }
129 }
130
131 for (final String config : cfgFiles) {
132 emit.readConfigurationFile(config);
133 }
134 final JavaConfiguration cfg = emit.getConfig();
135
136 final File out = File.createTempFile("CPPTemp", ".cpp");
137 final FileOutputStream outStream = new FileOutputStream(out);
138
139 // preprocessor = new PCPP(includePaths, debug, copyCPPOutput2Stderr, enablePragmaOnce);
140 preprocessor = new JCPP(includePaths, debug, copyCPPOutput2Stderr, enablePragmaOnce);
141 final String cppName = preprocessor.getClass().getSimpleName();
142 if(debug || preserveGeneratedCPP) {
143 System.err.println("CPP <"+cppName+"> output at (persistent): " + out.getAbsolutePath());
144 } else {
145 out.deleteOnExit();
146 }
147
148 preprocessor.addDefine(__GLUEGEN__, "2");
149 preprocessor.setOut(outStream);
150
151 preprocessor.run(reader, filename);
152 outStream.flush();
153 outStream.close();
154 if(debug) {
155 System.err.println("CPP <"+cppName+"> done");
156 }
157
158 final FileInputStream inStream = new FileInputStream(out);
159 final DataInputStream dis = new DataInputStream(inStream);
160
161 final GnuCLexer lexer = new GnuCLexer(dis);
162 lexer.setTokenObjectClass(CToken.class.getName());
163 lexer.initialize();
164 // Parse the input expression.
165 final GnuCParser parser = new GnuCParser(lexer);
166
167 // set AST node type to TNode or get nasty cast class errors
168 parser.setASTNodeClass(TNode.class.getName());
169 TNode.setTokenVocabulary(GNUCTokenTypes.class.getName());
170
171 // invoke parser
172 try {
173 parser.translationUnit();
174 } catch (final RecognitionException e) {
175 throw new RuntimeException(String.format(
176 "Fatal error during translation (Localisation : %s:%s:%s)",
177 e.getFilename(), e.getLine(), e.getColumn()
178 ), e);
179 } catch (final TokenStreamRecognitionException e) {
180 throw new RuntimeException(String.format(
181 "Fatal error during translation (Localisation : %s:%s:%s)",
182 e.recog.getFilename(), e.recog.getLine(), e.recog.getColumn()
183 ), e);
184 } catch (final TokenStreamException e) {
185 throw new RuntimeException("Fatal IO error", e);
186 }
187
188 final HeaderParser headerParser = new HeaderParser();
189 headerParser.setDebug(debug);
190 headerParser.setJavaConfiguration(cfg);
191 final TypeDictionary td = new TypeDictionary();
192 headerParser.setTypedefDictionary(td);
193 final TypeDictionary sd = new TypeDictionary();
194 headerParser.setStructDictionary(sd);
195 // set AST node type to TNode or get nasty cast class errors
196 headerParser.setASTNodeClass(TNode.class.getName());
197 // walk that tree
198 headerParser.translationUnit(parser.getAST());
199 dis.close();
200 inStream.close();
201
202 /**
203 // For debugging: Dump type dictionary and struct dictionary to System.err
204 if(debug) {
205 td.dumpDictionary(err, "All Types");
206 sd.dumpDictionary(err, "All Structs");
207 } */
208
209 // At this point we have all of the pieces we need in order to
210 // generate glue code: the #defines to constants, the set of
211 // typedefs, and the set of functions.
212
213 if (null != outputRootDir && outputRootDir.trim().length() > 0) {
214 if (emit instanceof JavaEmitter) {
215 // FIXME: hack to interfere with the *Configuration setting via commandlines
216 final JavaEmitter jemit = (JavaEmitter) emit;
217 if (null != jemit.getConfig()) {
218 jemit.getConfig().setOutputRootDir(outputRootDir);
219 }
220 }
221 }
222
223 // Repackage the enum and #define statements from the parser into a common format
224 // so that SymbolFilters can operate upon both identically
225 allConstants = new ArrayList<ConstantDefinition>();
226 for (final EnumType enumeration : headerParser.getEnums()) {
227 String enumName = enumeration.getName();
228 if (enumName.equals("<anonymous>")) {
229 enumName = null;
230 }
231 // iterate over all values in the enumeration
232 for (int i = 0; i < enumeration.getNumEnumerates(); ++i) {
233 final EnumType.Enumerator enumerate = enumeration.getEnum(i);
234 final ConstantDefinition def =
235 new ConstantDefinition(enumerate.getName(), enumerate.getExpr(),
236 enumerate.getNumber(),
237 enumName, enumeration.getASTLocusTag());
238 allConstants.add(def);
239 }
240 }
241 for (final Object elem : lexer.getDefines()) {
242 final Define def = (Define) elem;
243 allConstants.add(new ConstantDefinition(def.getName(), def.getValue(), null, def.getASTLocusTag()));
244 }
245 allConstants.addAll(preprocessor.getConstantDefinitions());
246
247 allFunctions = headerParser.getParsedFunctions();
248
249 // begin emission of glue code,
250 // incl. firing up 'runSymbolFilter(SymbolFilter)' calls, which:
251 // - filters all ConstantDefinition
252 // - filters all FunctionSymbol
253 emit.beginEmission(this);
254
255 if( debug() ) {
256 int i=0;
257 System.err.println("Filtered Constants: "+allConstants.size());
258 for (final ConstantDefinition def : allConstants) {
259 if( debug() ) {
260 System.err.println("Filtered ["+i+"]: "+def.getAliasedString());
261 i++;
262 }
263 }
264 i=0;
265 System.err.println("Filtered Functions: "+allFunctions.size());
266 for (final FunctionSymbol cFunc : allFunctions) {
267 System.err.println("Filtered ["+i+"]: "+cFunc.getAliasedString());
268 i++;
269 }
270 }
271
272 if ( !cfg.structsOnly() ) {
273 emit.beginDefines();
274 final Set<String> emittedDefines = new HashSet<String>(100);
275 // emit java equivalent of enum { ... } statements
276 final StringBuilder comment = new StringBuilder();
277 for (final ConstantDefinition def : allConstants) {
278 if (!emittedDefines.contains(def.getName())) {
279 emittedDefines.add(def.getName());
280 final Set<String> aliases = cfg.getAliasedDocNames(def);
281 if (aliases != null && aliases.size() > 0 ) {
282 int i=0;
283 comment.append("Alias for: <code>");
284 for (final String alias : aliases) {
285 if(0 < i) {
286 comment.append("</code>, <code>");
287 }
288 comment.append(alias);
289 i++;
290 }
291 comment.append("</code>");
292 }
293 if (comment.length() > 0) {
294 comment.append("<br>\n");
295 }
296 if (def.getEnumName() != null) {
297 comment.append("Defined as part of enum type \"");
298 comment.append(def.getEnumName());
299 comment.append("\"");
300 } else {
301 comment.append("Define \"");
302 comment.append(def.getName());
303 comment.append("\"");
304 }
305 comment.append(" with expression '<code>"+def.getNativeExpr()+"</code>'");
306 if (comment.length() > 0) {
307 emit.emitDefine(def, comment.toString());
308 comment.setLength(0);
309 }
310 else {
311 emit.emitDefine(def, null);
312 }
313 }
314 }
315 emit.endDefines();
316 }
317
318 // Iterate through the functions finding structs that are referenced in
319 // the function signatures; these will be remembered for later emission
320 final ReferencedStructs referencedStructs = new ReferencedStructs();
321 for (final FunctionSymbol sym : allFunctions) {
322 // FIXME: this doesn't take into account the possibility that some of
323 // the functions we send to emitMethodBindings() might not actually be
324 // emitted (e.g., if an Ignore directive in the JavaEmitter causes it to be skipped).
325 sym.getType().visit(referencedStructs);
326 }
327
328 // Normally only referenced types will be emitted. The user can force a
329 // type to be emitted via a .cfg file directive. Those directives are
330 // processed here.
331 for (final String name : forcedStructNames) {
332 final Type type = td.get(name);
333 if (type == null) {
334 err.println("WARNING: during forced struct emission: struct \"" + name + "\" not found");
335 } else if (!type.isCompound()) {
336 err.println("WARNING: during forced struct emission: type \"" + name + "\" was not a struct");
337 } else {
338 type.visit(referencedStructs);
339 }
340 }
341
342 // Lay out structs
343 emit.beginStructLayout();
344 for (final Iterator<CompoundType> iter = referencedStructs.layouts(); iter.hasNext();) {
345 final CompoundType c = iter.next();
346 if( !c.isLayouted() ) {
347 emit.layoutStruct(c);
348 }
349 }
350 emit.endStructLayout();
351
352 // Emit structs
353 emit.beginStructs(td, sd, headerParser.getCanonMap());
354 for (final Iterator<Type> iter = referencedStructs.results(); iter.hasNext();) {
355 final Type t = iter.next();
356 if (t.isCompound()) {
357 assert t.isTypedef() && t.getName() == null : "ReferencedStructs incorrectly recorded compound type " + t;
358 emit.emitStruct(t.asCompound(), null);
359 } else if (t.isPointer()) {
360 final PointerType p = t.asPointer();
361 final CompoundType c = p.getTargetType().asCompound();
362 assert p.isTypedef() && c.getName() == null : "ReferencedStructs incorrectly recorded pointer type " + p;
363 emit.emitStruct(c, p);
364 }
365 }
366 emit.endStructs();
367
368 if ( !cfg.structsOnly() ) {
369 // emit java and C code to interface with the native functions
370 emit.beginFunctions(td, sd, headerParser.getCanonMap(), allFunctions);
371 emit.emitFunctions(allFunctions);
372 emit.endFunctions();
373 }
374
375 // end emission of glue code
376 emit.endEmission();
377
378 } catch (final Exception e) {
379 throw new RuntimeException("Exception occurred while generating glue code.", e);
380 }
381 }
382
383 public static void main(final String... args) {
384
385 if (args.length == 0) {
386 System.err.println(GlueGenVersion.getInstance());
387 usage();
388 }
389
390 Reader reader = null;
391 String filename = null;
392 String emitterFQN = null;
393 String outputRootDir = null;
394 final List<String> cfgFiles = new ArrayList<String>();
395 boolean copyCPPOutput2Stderr = false;
396 boolean enablePragmaOnce = true;
397 boolean preserveGeneratedCPP = false;
398
399 final List<String> includePaths = new ArrayList<String>();
400 for (int i = 0; i < args.length; i++) {
401 if (i < args.length - 1) {
402 final String arg = args[i];
403 if (arg.startsWith("-I")) {
404 final String[] paths = arg.substring(2).split(getProperty("path.separator"));
405 includePaths.addAll(Arrays.asList(paths));
406 } else if (arg.startsWith("-O")) {
407 outputRootDir = arg.substring(2);
408 } else if (arg.startsWith("-E")) {
409 emitterFQN = arg.substring(2);
410 } else if (arg.startsWith("-C")) {
411 cfgFiles.add(arg.substring(2));
412 } else if (arg.equals("--logLevel")) {
413 i++;
414 logLevel = Level.parse(args[i]);
415 } else if (arg.equals("--debug")) {
416 debug=true;
417 } else if (arg.equals("--dumpCPP")) {
418 copyCPPOutput2Stderr=true;
419 } else if (arg.equals("--disablePragmaOnce")) {
420 enablePragmaOnce=false;
421 } else if (arg.equals("--preserveGeneratedCPP")) {
422 preserveGeneratedCPP=true;
423 } else {
424 usage();
425 }
426 } else {
427 final String arg = args[i];
428 if (arg.equals("-")) {
429 reader = new InputStreamReader(in);
430 filename = "standard input";
431 } else {
432 if (arg.startsWith("-")) {
433 usage();
434 }
435 filename = arg;
436 try {
437 reader = new BufferedReader(new FileReader(filename));
438 } catch (final FileNotFoundException ex) {
439 throw new RuntimeException("input file not found", ex);
440 }
441 }
442 }
443 }
444
445 try {
446 final Class<?> emitterClass = emitterFQN == null ? null : Class.forName(emitterFQN);
447 new GlueGen().run(reader, filename, emitterClass, includePaths, cfgFiles, outputRootDir, copyCPPOutput2Stderr, enablePragmaOnce, preserveGeneratedCPP);
448 } catch (final ClassNotFoundException ex) {
449 throw new RuntimeException("specified emitter class was not in the classpath", ex);
450 }
451
452 }
453
454 //----------------------------------------------------------------------
455 // Internals only below this point
456 //
457 private static void usage() {
458 out.println("Usage: java GlueGen [-I...] [-Eemitter_class_name] [-Ccfg_file_name...] <filename | ->");
459 out.println();
460 out.println("Runs C header parser on input file or standard input, first");
461 out.println("passing input through minimal pseudo-C-preprocessor. Use -I");
462 out.println("command-line arguments to specify the search path for #includes.");
463 out.println("Emitter class name can be specified with -E option: i.e.,");
464 out.println("-Ecom.jogamp.gluegen.JavaEmitter (the default). Use");
465 out.println("-Ecom.jogamp.gluegen.DebugEmitter to print recognized entities");
466 out.println("(#define directives to constant numbers, typedefs, and function");
467 out.println("declarations) to standard output. Emitter-specific configuration");
468 out.println("file or files can be specified with -C option; e.g,");
469 out.println("-Cjava-emitter.cfg.");
470 out.println(" --debug enables debug mode");
471 out.println(" --dumpCPP directs CPP to dump all output to stderr as well");
472 out.println(" --disablePragmaOnce disable handling of #pragma once directive during parsing (enabled by default)");
473 out.println(" --preserveGeneratedCPP preserve generated CPP file during generation (File it's already preserved by debug mode)");
474 exit(1);
475 }
476}
static GlueGenVersion getInstance()
Represents a [native] constant expression, comprises the [native] expression, see getNativeExpr() and...
Glue code generator for C functions and data structures.
Definition: GlueGen.java:59
static void main(final String... args)
Definition: GlueGen.java:383
String findHeaderFile(final String headerFileName)
Finds the full path name of the specified header file based on the include directories specified on t...
Definition: GlueGen.java:86
static void setDebug(final boolean v)
Definition: GlueGen.java:76
void run(final Reader reader, final String filename, final Class<?> emitterClass, final List< String > includePaths, final List< String > cfgFiles, final String outputRootDir, final boolean copyCPPOutput2Stderr, final boolean enablePragmaOnce, final boolean preserveGeneratedCPP)
Definition: GlueGen.java:107
static boolean debug()
Definition: GlueGen.java:78
void runSymbolFilter(final SymbolFilter filter)
Runs the given filter on the #defines, enum definitions and function symbols that this controller has...
Definition: GlueGen.java:91
static final String __GLUEGEN__
GlueGen's build in macro name {@value}, when compiling w/ GlueGen.
Definition: GlueGen.java:104
static void setLogLevel(final Level l)
Definition: GlueGen.java:77
void forceStructEmission(final String typedefName)
Requests emission of an accessor for a struct that will not be referenced by any functions or other s...
Definition: GlueGen.java:81
Parses and provides access to the contents of .cfg files for the JavaEmitter.
Set< String > getAliasedDocNames(final AliasedSymbol symbol)
Return a set of aliased-name for comment in docs.
JavaConfiguration getConfig()
static LoggerIf getLogger()
Returns the root package logger.
Definition: Logging.java:355
Iterator< CompoundType > layouts()
Represents a #define of a literal to a value (a number represented in string form....
Definition: Define.java:48
ASTLocusTag getASTLocusTag()
Returns this instance's ASTLocusTag, if available, otherwise returns null.
Definition: Define.java:69
List getDefines()
Returns a list of Define objects corresponding to the preprocessor definitions seen during parsing.
Definition: GnuCLexer.java:116
void setStructDictionary(TypeDictionary dict)
Set the dictionary mapping struct names (i.e., the "foo" in "struct foo { ... };") to types for this ...
void setJavaConfiguration(JavaConfiguration cfg)
Set the configuration for this HeaderParser.
List< FunctionSymbol > getParsedFunctions()
Returns the list of FunctionSymbols this HeaderParser has parsed.
void setTypedefDictionary(TypeDictionary dict)
Set the dictionary mapping typedef names to types for this HeaderParser.
List< EnumType > getEnums()
Returns the EnumTypes this HeaderParser processed.
Map getCanonMap()
Get the canonicalization map, which is a regular HashMap mapping Type to Type and which is used for l...
Class TNode is an implementation of the AST interface and adds many useful features:
Definition: TNode.java:38
static void setTokenVocabulary(final String s)
Set the token vocabulary to a tokentypes class generated by antlr.
Definition: TNode.java:70
Models all compound types, i.e., those containing fields: structs and unions.
Describes enumerated types.
Definition: EnumType.java:54
Describes a function symbol, which includes the name and type.
final Type getTargetType()
Helper method to returns the target type of this type, in case another type is being referenced,...
Utility class for recording names of typedefs and structs.
Type get(final String name)
Get the type corresponding to the given name.
PointerType asPointer()
Casts this to a PointerType or returns null if not a PointerType.
Definition: Type.java:386
final String getName()
Returns the name of this type.
Definition: Type.java:142
void visit(final TypeVisitor visitor)
Traverse this Type and all of its component types; for example, the return type and argument types of...
Definition: Type.java:544
final boolean isPointer()
Indicates whether this is a PointerType.
Definition: Type.java:407
CompoundType asCompound()
Casts this to a CompoundType or returns null if not a CompoundType.
Definition: Type.java:390
final boolean isTypedef()
Indicates whether this type is a typedef type, i.e.
Definition: Type.java:352
final boolean isCompound()
Indicates whether this is a CompoundType.
Definition: Type.java:411
Generic C preprocessor interface for GlueGen.
Definition: GenericCPP.java:39
String findFile(String filename)
List< ConstantDefinition > getConstantDefinitions()
Returns a list of ConstantDefinition, i.e.
void setOut(OutputStream out)
void addDefine(String name, String value)
void run(Reader reader, String filename)
Specifies the interface by which a GlueEmitter can request additional information from the glue gener...
Specifies the interface by which GlueGen requests glue code to be generated.
void endEmission()
Finish the emission of glue code.
void beginStructs(TypeDictionary typedefDictionary, TypeDictionary structDictionary, Map< Type, Type > canonMap)
void beginStructLayout()
Begins the process of computing field offsets and type sizes for the structs to be emitted.
void endStructLayout()
Finishes the struct layout process.
JavaConfiguration getConfig()
void emitDefine(ConstantDefinition def, String optionalComment)
void beginFunctions(TypeDictionary typedefDictionary, TypeDictionary structDictionary, Map< Type, Type > canonMap, List< FunctionSymbol > cFunctions)
void readConfigurationFile(String filename)
void layoutStruct(CompoundType t)
Lays out one struct which will be emitted later.
void emitStruct(CompoundType t, Type typedefType)
Emit glue code for the given CompoundType.
Iterator< FunctionSymbol > emitFunctions(List< FunctionSymbol > cFunctions)
Emit glue code for the list of FunctionSymbols.
void beginEmission(GlueEmitterControls controls)
Begin the emission of glue code.
void setLevel(final Level newLevel)
See Logger#setLevel(Level).
Provides a mechanism by which the GlueEmitter can look at all of the #defines, enum values and functi...
List< ConstantDefinition > getConstants()
Returns the filtered list of constants.
void filterSymbols(List< ConstantDefinition > constants, List< FunctionSymbol > functions)
Filters the given constant and function symbols.
List< FunctionSymbol > getFunctions()
Returns the filtered list of function symbols.
String getName()
Return the current-name, which is the last renamed-name if issued, or the original-name.