Exemplo n.º 1
0
void parse_options() {
    // Parse command line options, and update the environment to match the
    // specified options.
    argp->usage(
        "Usage: jgdoc [OPTIONS] FILE...\n"
        "Generates documentation from comments found in Jogo source files.\n\n"
        "   -o, --output DIR     Write output to DIR.\n"
        "   -i, --include DIR    Add the directory DIR to the search path.\n"
        "   -h, --help           Print this help message.\n"
        "   -f, --format FORMAT  Set output format to FORMAT.\n"
        "   -v, --verbose        Print extra information.\n"
        "   --version            Print the compiler version number.\n");

    for (ArgToken tok = argp->next(); tok; tok = argp->next()) {
        // Convert abbreviated flags into the longer descriptive form (e.g.,
        // convert -p to --path)
        if (ArgToken::SHORT == tok.type()) {
            parse_short_option(tok.value());
        } else if (ArgToken::LONG == tok.type()) {
            parse_option(tok.value());
        } else {
            env->input(tok.value());
        }
    }

    std::string gen = env->generator();
    if (gen != "Markdown") {
        argp->error("Invalid output format (options: Markdown");
    }
}
Exemplo n.º 2
0
void parse_options() {
    // Parse command line options, and update the environment to match the 
    // specified options.
    argp->usage(
        "Usage: jogo [OPTIONS] FILE...\n\n"
        "Compiles Jogo source files into a library or executable.\n\n"
        "   -a, --assembly       Compile, but do not assemble or link.\n"
        "   -c, --compile        Compile and assemble, but do not link.\n"
        "   -e, --execute        Execute program as a script.\n"
        "   -d, --debug          Emit debug information.\n"
        "   -l, --library LIB    Compile and link with native library LIB.\n"
        "   -i, --include DIR    Add the directory DIR to the search path.\n"
        "   -o, --output FILE    Write compiler output to FILE.\n"
        "   -m, --make           Compile input files and out-of-date dependencies.\n"
        "   -h, --help           Print this help message.\n"
        "   -v, --verbose        Print extra information during compilation.\n"
        "   -g, --generator GEN  Use code generator GEN.\n"
        "   --build-dir DIR      Output directory for object files.\n"
        "   --dump-ir            Output the intermediate representation.\n"
        "   --dump-ast           Output the abstract syntax tree.\n"
        "   --dump-liveness      Output liveness info when printing the IR.\n"
        "   --dump-regalloc      Dump register allocations.\n"
        "   --dump-reggraph      Dump register interference graphs.\n"
        "   --version            Print the compiler version number.\n");

    for (ArgToken tok = argp->next(); tok; tok = argp->next()) {
        // Convert abbreviated flags into the longer descriptive form (e.g.,
        // convert -p to --path)
        if (ArgToken::SHORT == tok.type()) {
            parse_short_option(tok.value());
        } else if (ArgToken::LONG == tok.type()) {
            parse_option(tok.value());
        } else {
            env->input(tok.value());
        }
    } 

    std::string gen = env->generator();
    if (gen != "Intel64" && gen != "C" && gen != "Nasm64") {
        argp->error("Invalid code generator (options: Intel64, NAsm64, C)"); 
    }
    if (!env->inputs()) {
        argp->error("No input files.");
    }
}
Exemplo n.º 3
0
void parse_options() {
    // Parse command line options, and update the environment to match the 
    // specified options.
    argp->usage(
        "Usage: jgmake [OPTIONS] PACKAGE...\n\n"
        "Builds a Jogo project from the current working directory.  Source files should\n"
        "be under ./src; output files go to ./build, ./lib, ./bin, and ./doc.  Options\n"
        "given to jgmake are recorded.  After an option is set, it will remain set the\n"
        "next time jgmake is run.\n\n"
        "   -l, --library LIB    Compile and link with native library LIB.\n"
        "   -i, --include DIR    Add the directory DIR to the search path.\n"
        "   -d, --debug          Emit debug information.\n"
        "   -o, --optimize       Enable compiler optimizations.\n"
        "   -g, --generator GEN  Use code generator GEN.\n"
        "   -h, --help           Print this help message.\n"
        "   -v, --verbose        Print extra information during compilation.\n"
        "   -r, --reset          Erase all build options.\n"
        "   -c, --clean          Remove all output directories.\n"
        "   --version            Print the program version number.\n");

    for (ArgToken tok = argp->next(); tok; tok = argp->next()) {
        // Convert abbreviated flags into the longer descriptive form (e.g.,
        // convert -p to --path)
        if (ArgToken::SHORT == tok.type()) {
            parse_short_option(tok.value());
        } else if (ArgToken::LONG == tok.type()) {
            parse_option(tok.value());
        } else {
            env->input(tok.value());
        }
    } 

    std::string gen = env->generator();
    if (gen != "Intel64" && gen != "C" && gen != "Nasm64") {
        argp->error("Invalid code generator (options: Intel64, Nasm64, C)"); 
    }
}