1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00
cdt/core
Max Leuthäuser 61c3568839
Made PreprocessorMacro and TokenList public (#676)
### Changes

With this PR, `PreprocessorMacro` and its subclasses are no longer package-private but public instead. Same goes for `TokenList`.

### Reasons for the changes

When parsing C/C++ code with CDT as a standalone library I want to track certain macro expansions using the [MacroExpander](https://github.com/eclipse-cdt/cdt/blob/main/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/MacroExpander.java).

It is not actually part of the public API but declared as `public`. It takes an argument `macroDictionary` of type `CharArrayMap<PreprocessorMacro>` in its constructor. Currently, `PreprocessorMacro` is package-privat and thus, not available without shadowing (i.e., implementing my custom macro tracker in the package `org.eclipse.cdt.internal.core.parser.scanner`).

It questionable whether it is a good design decision to have public and private API mixed together here (rendering the usage of the constructor of `MacroExpander` impossible).

Also, another problem occurs once you take the route of shadowing to have access to `PreprocessorMacro`: the CDT jars are all signed during release (makes sense) but, sadly speaking, that will result in a `SecurityException` when trying to call their API from your own (unsigned) code which lives in the shadowed package (in my case in `org.eclipse.cdt.internal.core.parser.scanner`).

### Problem solved

MacroExpander can now be used from the outside because `PreprocessorMacro` and `TokenList` are no longer package-private. Shadowing is no longer needed. Signed jars are no longer a problem.
2024-01-18 18:22:40 -05:00
..
org.eclipse.cdt.core Made PreprocessorMacro and TokenList public (#676) 2024-01-18 18:22:40 -05:00
org.eclipse.cdt.core.linux Clean up Maven build (#662) 2023-12-28 14:35:58 -05:00
org.eclipse.cdt.core.linux.aarch64 Clean up Maven build (#662) 2023-12-28 14:35:58 -05:00
org.eclipse.cdt.core.linux.ppc64le Clean up Maven build (#662) 2023-12-28 14:35:58 -05:00
org.eclipse.cdt.core.linux.x86_64 Clean up Maven build (#662) 2023-12-28 14:35:58 -05:00
org.eclipse.cdt.core.macosx Clean up Maven build (#662) 2023-12-28 14:35:58 -05:00
org.eclipse.cdt.core.native Clean up Maven build (#662) 2023-12-28 14:35:58 -05:00
org.eclipse.cdt.core.tests [#457] Fix partial specialisation matching for deduced primitive types (#458) 2023-12-28 18:07:49 -05:00
org.eclipse.cdt.core.win32 Clean up Maven build (#662) 2023-12-28 14:35:58 -05:00
org.eclipse.cdt.core.win32.x86_64 Clean up Maven build (#662) 2023-12-28 14:35:58 -05:00
org.eclipse.cdt.ui Amend list-initialization handling of class or aggregate 2023-12-28 17:40:41 -05:00
org.eclipse.cdt.ui.tests Clean up Maven build (#662) 2023-12-28 14:35:58 -05:00
pom.xml Prepare repo for 11.5.0 (#633) 2023-12-06 18:48:15 -05:00