private function createCompiler($filename) { // Get string to render $input = file_get_contents($this->getSourceFilename($filename)); // Create lexer & parser $lexer = new Lexer(); $parser = new Parser(); // Create the compiler $compiler = new Compiler($parser->parse($lexer->tokenize($input))); return $compiler; }
private function tokenValueTypeShouldMatch($input, $type, $position = 0) { $lexer = new Lexer(); $stream = $lexer->tokenize($input); $this->assertInternalType($type, $stream->getToken($position)->getValue(), 'Type of value of token does not match ' . $type); }