V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
haoxun
V2EX  ›  分享创造

推广个人项目 clidoc,与命令行程序说明( synopsis of command-line program)相关

  •  
  •   haoxun · 2015-05-30 18:29:21 +08:00 · 1795 次点击
    这是一个创建于 3417 天前的主题,其中的信息可能已经有所发展或是发生改变。

    项目地址: https://github.com/clidoc/clidoc
    项目状态:v0.2-rc-3,基本已经能用。

    功能上与 docopt 类似,是用来自动处理 shell 传入参数的。与 docopt 的区别在于

    • 做了 front end 与 back end 的分离,front end 用来分析用户定义的 synopsis ,back end 用来生成特定语言(目前支持 C++11 与 Python 2/3)的 codgen。这么做的好处是,不用像每次运行都解析一次 synopsis 。
    • 定义了更为严谨的 synopsis 语法。

    希望各位可以帮忙做文档的 review(英文捉急),指出问题。

    以下是 README.md 的开头,直接搬运过来:

    clidoc analyses the synopsis of command-line program, then generates code of specific programming language that could be used to process shell inputed values.

    Workflow of clidoc is as follow:

    # front end.
    synopsis --> | synopsis analyser | --> AST
    
    # back end.
            | cpp11 codegen  |
    AST --> | python codegen | --> argument processing code
            | rust codegen   |
            | ...            |
    

    where

    • the front end of clidoc would build up an AST(abstract syntax tree) according to user defined synopsis,
    • and the back ends would generate argument processing code with respect to front end generated AST.

    As you can see, clidoc plans to support codegen for multiple programming languages. Currently in v0.2, clidoc supports codegen of programming language C++11 and Python 2/3.

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1688 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 00:29 · PVG 08:29 · LAX 17:29 · JFK 20:29
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.