From 66a3830f30ed12281938fae30e5fb77a248333cc Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Thu, 13 Sep 2018 01:07:45 +0430 Subject: updated the reame --- README.md | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 97e8ccd..bbc105e 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,7 @@ # faultreiber -`faultreiber` generates a parser library in C for a structured file format. The input is an XML file that describes the format.
-The C source code will be in the form of multiple source and header files. a makefile is also included.
-The generated source code does not include a main.
- -## faultreiber XML file -The root node should have two childs, named exactly `READ` and `DEFINITION`(order not important).
-The `READ` node will include the actual structures that the parser will read and can return.
-The `DEFINITION` node includes the definitions for the structures that are aggregate.
+`faultreiber` generates a parser library in C for a structured (binary) file format. The input is an XML file that describes the format.
+The C source code will be in the form of multiple source and header files.
+The headers have header guards and are already `extern "C"`ed.
## Demo For a practical example, look at the example XML file under `resources`. The XML file describes the format of a WASM object file:
@@ -36,7 +31,12 @@ free(lib_ret->obj); free(lib_ret); ``` -### Rules: +## faultreiber XML file +The root node should have two childs, named exactly `READ` and `DEFINITION`(order not important).
+The `READ` node will include the actual structures that the parser will read and can return.
+The `DEFINITION` node includes the definitions for the structures that are aggregate.
+ +## Rules: Any child node of either `DEFINITION` or `READ` will have to at least have the attributes `name` and `type` defined. The presence of the attribute `count` is optional but if it's not present faultreiber will assume that the count is one.
The presence of the attribute `isaggregate` signifies the fact that the data structure is composed of other smaller parts. faultreiber will only read the children of a node that is the child of either the `DEFINITION` or `READ` node(unless a child node has the attribute `conditional` set). If a data structure requires more children then you should add a new node under `DEFINITION` and reference that node from it's parent. In other words, an aggregate node can't itself have child nodes that are aggregate.
@@ -107,14 +107,13 @@ The `FT::conditional` tag for a type means that the actual content of the node w --name will be used in generating some code identifiers ``` - ## limitations Big-Endian reads are not supported.
None-byte-sized raw reads are not supported.
## makefile That would be on you but there is an example makefile in the `test` directory so you can take a look if you want.
-To get a list of the targets the makfile supports you can run its `help` target.
+You can also get generic ones from [here](https://github.com/bloodstalker/lazymakefiles). They're licensed under the Unlicense.
## TODO All the items under limitations.
@@ -125,4 +124,4 @@ The list of the projects that use faulreiber:
* [bruiser](https://github.com/bloodstalker/mutator/tree/master/bruiser)
## License -`faultreiber` along with the makefile, are provided under MIT. I'm not sure whether the generated code is considered "derived work", but if it is, then the generated code will also fall under MIT
+`faultreiber` is provided under MIT. I'm assuming(I'm not a lawyer) the generated code is considered "derived work". If it is, then the generated code will also fall under MIT.
-- cgit v1.2.3