Skip to content

Commit

Permalink
Readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
ph4r05 committed Nov 11, 2014
1 parent d0fdd3a commit 52d11c9
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ For example usage see `demo.py`.

My use case: automated refactoring of `.proto` files.

* Benefit of this project is support for easy refactoring of the protocol buffers files. From the parse
result one can simply determine position of a particular lexical unit in the source text and replace it.
* The visitor pattern is used for processing a parse tree.

## Dependency
* This project has only one dependency, [PLY] [1].
* `ply/` subdirectory is present in this repo for demonstration purposes and completeness only. If you intend to use this project, prefer better original
Expand All @@ -19,12 +23,25 @@ If you find a bug, please feel free to submit a pull request or file an issue.
## Bugs
* `Oneof` is not implemented yet.

## Demo 1
* `demo.py`
* The first demo file shows simple parsing of the example protocol buffer message. It produces a parse tree of this simple
examples.

## Demo 2 - Protocol Buffers file refactoring.
* `prefixize.py`
* Main use-case is rename refactoring of entities in Protocol Buffers.
* [Protocol Buffers Objetive C compiler] [5] does not prefix entities and this may conflict with some objects in the project.
This script renames all entties in protobuf file by prefixing them wth specified string. Also identifiers with conflicting
names can be renamed if specified by parameter (e.g., hash, description). Result of this refactoring can be then used with
objeciveC protoc without conflicts.

## Acknowledgement
This work was inspired by:
* [plyj] [2], Java lexer & parser for PLY.
* [pyparsing] [3], Protocol Buffers parsing example.
* [PLYTalk] [4], nice tutorial for PLY I used.

## Disclaimer
* This project was created because I needed it for myself and I didn't find Protocol Buffers parser for PLY.
It is my first PLY / parser generator project and the first version was created in couple hours so it is not polished code.
Expand All @@ -39,4 +56,5 @@ inspiration or a starting point. You will probably adapt it for your own needs.
[1]: https://github.com/dabeaz/ply
[2]: https://github.com/musiKk/plyj
[3]: http://pyparsing.wikispaces.com/
[4]: http://www.dabeaz.com/ply/PLYTalk.pdf
[4]: http://www.dabeaz.com/ply/PLYTalk.pdf
[5]: https://github.com/alexeyxo/protobuf-objc

0 comments on commit 52d11c9

Please sign in to comment.