Package com.jogamp.gluegen.jcpp
Class Preprocessor
java.lang.Object
com.jogamp.gluegen.jcpp.Preprocessor
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Constructor Summary
ConstructorsConstructorDescriptionPreprocessor(Source initial) Preprocessor(File file) Equivalent to 'new Preprocessor(newFileLexerSource(file))' -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a feature to the feature-set of this Preprocessor.voidaddFeatures(Feature... f) Adds features to the feature-set of this Preprocessor.voidAdds features to the feature-set of this Preprocessor.voidAdds input for the Preprocessor.voidAdds input for the Preprocessor.voidAdds a Macro to this Preprocessor.voidDefines the given name as a macro, with the value1.voidDefines the given name as a macro.voidAdds a warning to the warning-set of this Preprocessor.voidAdds warnings to the warning-set of this Preprocessor.voidclose()protected voidHandles an error.protected voidHandles an error.booleanReturns true if the given feature is in the feature-set of this Preprocessor.Returns the feature-set for this Preprocessor.Returns the VirtualFileSystem used by this Preprocessor.Returns the Objective-C frameworks path used by this Preprocessor.List<? extends VirtualFile>Returns the list ofVirtualFileswhich have been included by this Preprocessor.Returns the PreprocessorListener which handles events for this Preprocessor.Returns the named macro.Returns the Map of Macros parsed during the run of this Preprocessor.getMacros(boolean expand) Returns a list ofMacros.Returns the user include-path of this Preprocessor.Returns the top Source on the input stack.Returns the system include-path of this Preprocessor.booleanReturns true if the given warning is in the warning-set of this Preprocessor.Returns the warning-set for this Preprocessor.protected booleaninclude(VirtualFile file) Attempts to include the given file.protected booleanIncludes a file from an include path, by name.protected voidprotected Tokenpop_source(boolean linemarker) Pops a Source from the input stack.protected voidprotected voidpragma_once(Token name) protected voidpush_source(Source source, boolean autopop) Pushes a Source onto the input stack.voidsetFileSystem(VirtualFileSystem filesystem) Sets the VirtualFileSystem used by this Preprocessor.voidsetFrameworksPath(List<String> path) Sets the Objective-C frameworks path used by this Preprocessor.voidsetListener(PreprocessorListener listener) Sets the PreprocessorListener which handles events for this Preprocessor.voidsetQuoteIncludePath(List<String> path) Sets the user include path used by this Preprocessor.voidsetSystemIncludePath(List<String> path) Sets the system include path used by this Preprocessor.token()Returns the next preprocessor token.toString()protected voidHandles a warning.protected voidHandles a warning.
-
Constructor Details
-
Preprocessor
public Preprocessor() -
Preprocessor
-
Preprocessor
Equivalent to 'new Preprocessor(newFileLexerSource(file))'- Throws:
IOException
-
-
Method Details
-
setFileSystem
Sets the VirtualFileSystem used by this Preprocessor. -
getFileSystem
Returns the VirtualFileSystem used by this Preprocessor. -
setListener
Sets the PreprocessorListener which handles events for this Preprocessor. The listener is notified of warnings, errors and source changes, amongst other things. -
getListener
Returns the PreprocessorListener which handles events for this Preprocessor. -
getFeatures
Returns the feature-set for this Preprocessor. This set may be freely modified by user code. -
addFeature
Adds a feature to the feature-set of this Preprocessor. -
addFeatures
Adds features to the feature-set of this Preprocessor. -
addFeatures
Adds features to the feature-set of this Preprocessor. -
getFeature
Returns true if the given feature is in the feature-set of this Preprocessor. -
getWarnings
Returns the warning-set for this Preprocessor. This set may be freely modified by user code. -
addWarning
Adds a warning to the warning-set of this Preprocessor. -
addWarnings
Adds warnings to the warning-set of this Preprocessor. -
getWarning
Returns true if the given warning is in the warning-set of this Preprocessor. -
addInput
Adds input for the Preprocessor. Inputs are processed in the order in which they are added. -
addInput
Adds input for the Preprocessor.- Throws:
IOException- See Also:
-
error
Handles an error. If a PreprocessorListener is installed, it receives the error. Otherwise, an exception is thrown.- Throws:
LexerException
-
error
Handles an error. If a PreprocessorListener is installed, it receives the error. Otherwise, an exception is thrown.- Throws:
LexerException- See Also:
-
warning
Handles a warning. If a PreprocessorListener is installed, it receives the warning. Otherwise, an exception is thrown.- Throws:
LexerException
-
warning
Handles a warning. If a PreprocessorListener is installed, it receives the warning. Otherwise, an exception is thrown.- Throws:
LexerException- See Also:
-
addMacro
Adds a Macro to this Preprocessor. The givenMacroobject encapsulates both the name and the expansion.- Throws:
IOExceptionLexerException
-
addMacro
Defines the given name as a macro. The String value is lexed into a token stream, which is used as the macro expansion.- Throws:
LexerException
-
addMacro
Defines the given name as a macro, with the value1. This is a convnience method, and is equivalent toaddMacro(name, "1").- Throws:
LexerException
-
setQuoteIncludePath
Sets the user include path used by this Preprocessor. -
getQuoteIncludePath
Returns the user include-path of this Preprocessor. This list may be freely modified by user code. -
setSystemIncludePath
Sets the system include path used by this Preprocessor. -
getSystemIncludePath
Returns the system include-path of this Preprocessor. This list may be freely modified by user code. -
setFrameworksPath
Sets the Objective-C frameworks path used by this Preprocessor. -
getFrameworksPath
Returns the Objective-C frameworks path used by this Preprocessor. This list may be freely modified by user code. -
getMacros
Returns the Map of Macros parsed during the run of this Preprocessor. -
getMacros
- Parameters:
expand- iftrueand if macro is notfunction-like, i.e. a constant, the returned macro will be expanded.- Throws:
IOExceptionLexerException
-
getMacro
Returns the named macro. While you can modify the returned object, unexpected things might happen if you do. -
getIncludes
Returns the list ofVirtualFileswhich have been included by this Preprocessor. This does not include anySourceprovided to the constructor oraddInput(java.io.File)oraddInput(Source). -
getSource
Returns the top Source on the input stack.- See Also:
-
push_source
Pushes a Source onto the input stack.- See Also:
-
pop_source
Pops a Source from the input stack.- Throws:
IOException- See Also:
-
pop_source
- Throws:
IOException
-
include
Attempts to include the given file. User code may override this method to implement a virtual file system.- Throws:
IOExceptionLexerException
-
include
Includes a file from an include path, by name.- Throws:
IOExceptionLexerException
-
pragma_once
- Throws:
IOExceptionLexerException
-
pragma
- Throws:
IOExceptionLexerException
-
token
Returns the next preprocessor token.- Throws:
LexerException- if a preprocessing error occurs.InternalException- if an unexpected error condition arises.IOException- See Also:
-
toString
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-