from cpl_core.application import StartupABC from cpl_core.configuration import ConfigurationABC, ConsoleArgument from cpl_core.dependency_injection import ServiceProviderABC, ServiceCollectionABC from cpl_core.environment import ApplicationEnvironment from lexer.abc.lexer_abc import LexerABC from lexer.service.lexer_service import LexerService from parser.abc.parser_abc import ParserABC from parser.service.parser_service import ParserService from runtime.abc.runtime_service_abc import RuntimeServiceABC from runtime.service.runtime_service import RuntimeService class Startup(StartupABC): def __init__(self): StartupABC.__init__(self) def configure_configuration(self, config: ConfigurationABC, env: ApplicationEnvironment) -> ConfigurationABC: config.add_console_argument(ConsoleArgument('-', 'p', [], ' ', is_value_token_optional=True)) config.add_console_arguments() return config def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironment) -> ServiceProviderABC: services.add_singleton(LexerABC, LexerService) services.add_singleton(ParserABC, ParserService) services.add_singleton(RuntimeServiceABC, RuntimeService) return services.build_service_provider()