yebblies/magicport2
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
master
Could not load branches
Nothing to show
Could not load tags
Nothing to show
{{ refName }}
default
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
-
Clone
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more.
- Open with GitHub Desktop
- Download ZIP
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
====== Magicport Manual ======
Magicport is a terrible hack.
Source:
magicport.d
- Contains entry point.
- First loads the json settings file
- prefixes all the imports with 'ddmd.'
- Translates the list of modules into a D format
- Loads tables of basic types, structs,
'root' classes (base classes),
functions that need 'override',
functions that don't need 'final'
- For each source file
- Loads and lexes the file
- Scans for class and struct names
- Parses and runs 'scanner' on each file
- Collapses the AST (combining member functions declarations with definitions, etc)
- Builds a map of all symbols using a mangling scheme
- Walks the AST to write the output files
tokens.d
- Lexes C++ source files
parser.d
- Parses C++ source files
ast.d
- Containts C++ AST definitions
dprinter.d
- Contains D output AST walker
namer.d
- Contains symbol mangler
printerast.d
- Debug ast printer
printercpp.d
- Debug C++ ast printer, not maintained and probably doesn't work
scanner.d
- Contains an AST visitor that builds lists of structs, classes, etc
- Used for locating declarations to merge with definitions
- A collection of functions to:
- Merge member function prototypes and definitions
- Transfer default arguments from function prototypes to definitions
- Transfer static member initializers to the declarations
- Drop duplicate typedefs (aliases conflict in D)
- Drop FILE_H include guards
- Build a new constructor for Scope (special case)
- Delete dead code
- unused prototypes
- #undef
- #define LOG
- Default ctors
- extern(C) function prototypes
- backend typedefs
- assert macro definition
typenames.d
- Lists of names of types, mostly moved into magicport.json
visitor.d
- Visitor implementation
Config:
"src"
List of C++ source files (.c and .h)
"mapping"
List of modules containing
- "module" - module name
- "package" - package name
- "imports" - list of imports
- "extra" - list of special stuff to copy-paste into the generated file
- "members" - list of mangled names of symbols to include
"basicTypes"
list of 'basic' types, pretty much anything that isn't a struct/class/enum
"structTypes"
List of struct/enum types that the scanner doesn't pick up - mostly ones defined
in weird places
"classTypes"
ditto
"rootclasses"
Base classes
"overriddenfuncs"
List of classname, functionname pairs of functions that can't be final
"nonfinalclasses"
List of classes that can't be final.
Usage:
- Build magicport (all .d source files together)
- Update magicport.json
- Run magicport
- takes two arguments (sourcedir, destdir)
- I usually just run it in the source directory and generate the D source there
- i.e. path/to/magicport . .
- It will look for magicport.json in the current directory
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
