V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
爱意满满的作品展示区。
haoxun

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

  •  
  •   haoxun · May 30, 2015 · 2297 views
    This topic created in 3984 days ago, the information mentioned may be changed or developed.

    项目地址: 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.

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5387 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 01:23 · PVG 09:23 · LAX 18:23 · JFK 21:23
    ♥ Do have faith in what you're doing.