Prototxt file parsing python library prototxt-parser (using parsy custom file format parsing)

Prototxt file parsing library python-Parser https://github.com/yogin16/prototxt_parser https://test.pypi.org/project/prototxt-parser prototxt
1.yield let function performs segmentation support, so that the memory function support and state, allowing a function into a state machine, such a process execution state machine may be directly expressed in a function, the whole process flow more smoothly.
2.parsy of optional, Returns a parser that expects the initial parser zero or once and maps the result to the time None in the case of no match. Optional matching is not on the return None instead of directly being given the opportunity to make the program match not on the branching process.
Parser of 3.parsy of <<, at The Same, AS parser.skip (other_parser) -. See Parser.skip ()
the parse Parser of 4.parsy of, Attempts to parse the given string ( or list) If the parse is successful. Consumes at the String at the Entire and the Result returned iS - otherwise iS a ParseError raised.
prototxt syntax definition 1https 5.proto3 of:? //developers.google.com/protocol-buffers/docs/reference/proto3-spec hl = zh-CN
6.parsy can be achieved is to set some language parsing capability, through similar syntax description (Language Specification) mode programming, parsing the specific format text, the text description of resolve to follow grammar syntax tree (dictionary). It can easily implement custom file format parsing.

Guess you like

Origin www.cnblogs.com/dongzhiquan/p/11588414.html