https://github.com/travorlzh/jpp
Modular Macro Processor from Scratch
https://github.com/travorlzh/jpp
macro-processor macros
Last synced: 6 months ago
JSON representation
Modular Macro Processor from Scratch
- Host: GitHub
- URL: https://github.com/travorlzh/jpp
- Owner: TravorLZH
- License: gpl-3.0
- Created: 2018-06-22T13:37:39.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-11T05:11:51.000Z (almost 8 years ago)
- Last Synced: 2025-01-17T08:13:17.251Z (over 1 year ago)
- Topics: macro-processor, macros
- Language: C
- Homepage:
- Size: 67.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
JMacro - Re-implementation of macro processor
=============================================
This project is originally created for preprocessing Java code, but I
recently realized that you are allowed to run `cpp` on Java code
Feel free to do this in C. Nothing's implemented yet but work plan
## Design
Unlike those monolithic GNU softwares, my project aims to be modular. Builtin modules are listed below:
* Define: Deals with `#define` directive
* include: Deals with `#include` directive
* Comment: Strips comments out
### Preprocessing Progress
1. Parsing command line arguments
2. Calling modules to expand macros
3. Check if all macros are expanded
* If not, jump to step 2
## Current Plan
- [ ] Define macro using `#define`
- [ ] Include other files using `#include`
- [ ] Undefine macro using `#undef`
- [ ] Strip out comments
## Further Goals
* Condition macro like `#if`
* Optimization for Java
* Builtin macros for conveniencing x86 Assembly Language.
* Macros look like functions