Example #1
0
#!/usr/bin/php -q
<?php 
require_once __DIR__ . "/include/Options.php";
require_once __DIR__ . "/include/include.php";
$opts = getopt("coq:i:");
Options::$infile = isset($opts["i"]) ? $opts["i"] : "";
Options::$outfile = isset($opts["o"]) ? $opts["o"] : "";
Options::$quiet = isset($opts["q"]);
if (!Options::$quiet) {
    echo "Carrot Programming Language Compiler(CPLC) v0.1\n";
    echo "License:MIT License\n";
    echo "2015 @pumpkin031\n";
    echo "\n";
}
if (Options::$infile == "") {
    echo "cplc: No input file. Stop.\n";
    exit;
}
CPLParser::Parse(Options::$infile);