[Non-SP] KeyValues parsers
Someone asked me what they thought was a good language for parsing KeyValues for some standalone application. The #1 factor that came to mind was "Does a parser exist for that language?"
Turns out it's harder to find parsers than I thought. I wanted to collect the results of my search in one place, so here goes: Note: I haven't used or reviewed most of these personally C++ Valve KeyValues Implementation: KeyValues.h KeyValues.cpp - LOW portability (Requires lots of hl2sdk by default) C++ SM TextParsers Implementation: TextParsers.h TextParsers.cpp - MEDIUM portability (Linked version is psychonic's GDC fork port) Node/Javascript: keyvalues-node - Should be portable, but their output format is questionable. PHP: SourceBans KeyValues/SMC_Parser implementation PHP: KVReader2.php another PHP implementation that doesn't use token_get_all C#: SteamKit implementation Python: py-keyvalues Those are my finds thus far. I was hoping for a Python implementation personally, but I couldn't find one. Also: If anyone can give me formatted links for the bitbucket/sm repos that give latest version instead of revisioned version that would be helpful I think. Edit: Got python, fixed repo links. |
Re: [Non-SP] KeyValues parsers
Quote:
|
Re: [Non-SP] KeyValues parsers
Quote:
|
Re: [Non-SP] KeyValues parsers
Quote:
|
Re: [Non-SP] KeyValues parsers
I have a python parser that I'm working on. (it works perfectly but looks ugly as sin right now)
|
Re: [Non-SP] KeyValues parsers
Quote:
Quote:
Quote:
Quote:
|
Re: [Non-SP] KeyValues parsers
Here it is in its current form: https://github.com/necavi/py-keyvalues
I'm working on changing it quite a bit, but for now this'll work (and thanks to python being awesome I can keep most of the syntax the same when I change it). |
Re: [Non-SP] KeyValues parsers
Here's another PHP one which doesn't use token_get_all (which doesn't appear to work with some php versions): https://github.com/nikkiii/kvreader/.../kvreader2.php
It parses admins.cfg (Which I believe is SMC) and standard items_game.txt, tf_english.txt (language file) etc just fine, however it won't write correctly with multiple sections which have the same keys. |
Re: [Non-SP] KeyValues parsers
is there one for brainfuck? i could use it
|
Re: [Non-SP] KeyValues parsers
My attempt at a python KV parser, doesn't support comments or #include stuff for KV though, I kinda wrote it for Source-Python, but it works independently anyway and is Python 3 (note: self-singed cert on the svn :P) https://svn.german-slaughterhouse.de...s/keyvalues.py
|
All times are GMT -4. The time now is 00:01. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.