Skip to content

Commit 5424807

Browse files
committed
Added readme (WIP)
1 parent 2c2af61 commit 5424807

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

README.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Arduino sketch (.ino) preprocessor
2+
3+
This repository contains the source code of the Arduino sketch preoprocessor.
4+
The main purpose of this tool is to parse an Arduino sketch (usually made with the [Arduino IDE](https://github.com/arduino/Arduino)) and convert it into a valid C++ source code.
5+
6+
This tool is based on the Clang/LLVM C/C++ parser and, among the sketch conversion process, provide some useful features used in the Arduino IDE like:
7+
8+
* Diagnostics output in json format
9+
* Code autocomplete suggestions output in json format
10+
11+
## Usage
12+
13+
`./arduino-preprocessor sketch.ino.cpp -- [extra compiler options]`
14+
15+
**TODO**: add command line options
16+
17+
## The sketch (.ino) preprocessing
18+
19+
**TODO**: Describe what happens exactly in the preprocessing
20+
21+
* A sketch may be composed by many `.ino` files that are concatenated into a single `.ino.cpp` file
22+
* Libraries are detected and include path discovered
23+
* A pass of compiler with `-E` flag is made so all macros and include are resolved
24+
* The resulting file is preprocessed and missing prototypes are added
25+
26+
## Credits
27+
28+
This tool use code from the following projects:
29+
30+
- [Clang/LLVM](http://llvm.org)
31+
- [JSON for Modern C++](https://github.com/nlohmann/json)
32+

0 commit comments

Comments
 (0)