项目作者: quiverteam

项目描述 :
Parser for Valve KeyValues format
高级语言: F#
项目地址: git://github.com/quiverteam/kv1-parser.git
创建时间: 2019-04-18T18:56:07Z
项目社区:https://github.com/quiverteam/kv1-parser

开源协议:

下载


KeyValues Parser

An F# implementation of a parser for the KeyValues file format. Used in QPC
to parse qpc and qgc files.

Dependencies

  • FParsec via Nuget

Status

The full kv1 spec parses. Here’s a stress test of what it can parse:

  1. $Configuration
  2. {
  3. $Include "windows.h" [$WINDOWS]
  4. $Include "posix.h" [$OSX || ($LINUX && $POSIX)]
  5. }

Which parses successfully to this F# representation of the data:

  1. Statement
  2. ("$Configuration",
  3. BlockValue
  4. [Statement ("$Include", StringValue "windows.h", DefCond "$WINDOWS");
  5. Statement
  6. ("$Include", StringValue "posix.h",
  7. OrCond (DefCond "$OSX", AndCond (DefCond "$LINUX", DefCond "$POSIX")))],
  8. EmptyCond)