Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from json2protobuf import Lexer
- from json2protobuf import Parser
- from json2protobuf import Converter
- def json2pb(json):
- try:
- lexer = Lexer.Lexer(json)
- tokens = lexer.lex()
- parser = Parser.Parser(tokens)
- obj = parser.parse()
- converter = Converter.Converter(obj)
- pb = converter.convert()
- return pb
- except Exception as error:
- print(error)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement