summaryrefslogtreecommitdiff
path: root/mnml
blob: 32937d581b2e8bd315a0f7b7bb91288e14541754 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/env php

<?php

require "vendor/autoload.php";

use Mnml\Interpreter\Interpreter;
use Mnml\Lexer\Lexer;
use Mnml\Parser\Parser;

$input = file_get_contents(realpath($argv[1]));

$lexer = new Lexer($input);
$tokens = $lexer->lex();

$parser = new Parser($tokens);
$nodes = $parser->parse();
#$parser->printTree();

$compiler = new Interpreter($nodes);
$compiler->compile([array_slice($argv, 1)]);