GenericLanguage.php
<?php
namespace Tlf\Lexer2\Language;
class GenericLanguage implements \Tlf\Lexer2\Language {
protected array $directives;
public function __construct(
protected string $code,
protected string $namespace
){
$parser = new \Tlf\Lexer2\Parser();
$this->directives = $parser->parse_directive_code($code);
//echo "\n\n\n$code\n\n\n";
}
public function get_namespace(): string {
return $this->namespace;
}
public function get_directives(): array {
return $this->directives;
}
}