Improved workspace structure

This commit is contained in:
2021-08-02 15:58:05 +02:00
parent 1577c78c51
commit a97de91fc4
27 changed files with 222 additions and 20 deletions

View File

@@ -25,11 +25,11 @@
"Classifiers": []
},
"BuildSettings": {
"ProjectType": "console",
"ProjectType": "library",
"SourcePath": "",
"OutputPath": "../../dist",
"Main": "cc_lang.main",
"EntryPoint": "cc-lang",
"Main": "",
"EntryPoint": "",
"IncludePackageData": false,
"Included": [],
"Excluded": [

View File

@@ -0,0 +1 @@
# imports:

View File

@@ -3,14 +3,28 @@ from cpl.configuration import ConfigurationABC
from cpl.console import Console
from cpl.dependency_injection import ServiceProviderABC
from lexer.abc.lexer_abc import LexerABC
class Application(ApplicationABC):
def __init__(self, config: ConfigurationABC, services: ServiceProviderABC):
ApplicationABC.__init__(self, config, services)
self._lexer: LexerABC = services.get_service(LexerABC)
self._path = config.get_configuration('p')
def _console(self): pass
def _files(self): pass
def configure(self):
pass
def main(self):
Console.write_line('Hello World')
Console.write_line(self._configuration.additional_arguments, self._path)
if self._path is None:
self._console()
return
self._files()

View File

@@ -0,0 +1,43 @@
{
"ProjectSettings": {
"Name": "cc-lang-interpreter",
"Version": {
"Major": "0",
"Minor": "0",
"Micro": "0"
},
"Author": "",
"AuthorEmail": "",
"Description": "",
"LongDescription": "",
"URL": "",
"CopyrightDate": "",
"CopyrightName": "",
"LicenseName": "",
"LicenseDescription": "",
"Dependencies": [
"sh_cpl==2021.4.0.post2"
],
"PythonVersion": ">=3.9.2",
"PythonPath": {
"linux": ""
},
"Classifiers": []
},
"BuildSettings": {
"ProjectType": "console",
"SourcePath": "",
"OutputPath": "../../dist",
"Main": "cc_lang_interpreter.main",
"EntryPoint": "cc-lang-interpreter",
"IncludePackageData": false,
"Included": [],
"Excluded": [
"*/__pycache__",
"*/logs",
"*/tests"
],
"PackageData": {},
"ProjectReferences": []
}
}

View File

@@ -1,7 +1,7 @@
from cpl.application import ApplicationBuilder
from cc_lang.application import Application
from cc_lang.startup import Startup
from cc_lang_interpreter.application import Application
from cc_lang_interpreter.startup import Startup
def main():

View File

@@ -1,7 +1,10 @@
from cpl.application import StartupABC
from cpl.configuration import ConfigurationABC
from cpl.configuration import ConfigurationABC, ConsoleArgument
from cpl.dependency_injection import ServiceProviderABC, ServiceCollectionABC
from lexer.abc.lexer_abc import LexerABC
from lexer.service.lexer_service import LexerService
class Startup(StartupABC):
@@ -13,7 +16,12 @@ class Startup(StartupABC):
self._services = services
def configure_configuration(self) -> ConfigurationABC:
self._configuration.add_console_argument(ConsoleArgument('-', 'p', [], ' '))
self._configuration.add_console_arguments()
return self._configuration
def configure_services(self) -> ServiceProviderABC:
self._services.add_singleton(LexerABC, LexerService)
return self._services.build_service_provider()

View File

@@ -1 +1 @@
# imports:
# imports

View File

@@ -0,0 +1 @@
# imports

View File

@@ -0,0 +1,7 @@
from abc import ABC, abstractmethod
class LexerABC(ABC):
@abstractmethod
def __init__(self): pass

View File

@@ -28,8 +28,8 @@
"ProjectType": "library",
"SourcePath": "",
"OutputPath": "../../dist",
"Main": "lexer.main",
"EntryPoint": "lexer",
"Main": "",
"EntryPoint": "",
"IncludePackageData": false,
"Included": [],
"Excluded": [

View File

@@ -0,0 +1 @@
# imports

View File

@@ -0,0 +1,7 @@
from lexer.abc.lexer_abc import LexerABC
class LexerService(LexerABC):
def __init__(self):
pass

View File

@@ -28,8 +28,8 @@
"ProjectType": "library",
"SourcePath": "",
"OutputPath": "../../dist",
"Main": "parser.main",
"EntryPoint": "parser",
"Main": "",
"EntryPoint": "",
"IncludePackageData": false,
"Included": [],
"Excluded": [

1
src/runtime/__init__.py Normal file
View File

@@ -0,0 +1 @@
# imports

View File

@@ -0,0 +1 @@
# imports

View File

@@ -0,0 +1,7 @@
from abc import ABC, abstractmethod
class ClassStackABC(ABC):
@abstractmethod
def __init__(self): pass

View File

@@ -0,0 +1,7 @@
from abc import ABC, abstractmethod
class FunctionStackABC(ABC):
@abstractmethod
def __init__(self): pass

View File

@@ -0,0 +1,7 @@
from abc import ABC, abstractmethod
class LibraryStackABC(ABC):
@abstractmethod
def __init__(self): pass

View File

@@ -0,0 +1,7 @@
from abc import ABC, abstractmethod
class VariableStackABC(ABC):
@abstractmethod
def __init__(self): pass

43
src/runtime/runtime.json Normal file
View File

@@ -0,0 +1,43 @@
{
"ProjectSettings": {
"Name": "runtime",
"Version": {
"Major": "0",
"Minor": "0",
"Micro": "0"
},
"Author": "",
"AuthorEmail": "",
"Description": "",
"LongDescription": "",
"URL": "",
"CopyrightDate": "",
"CopyrightName": "",
"LicenseName": "",
"LicenseDescription": "",
"Dependencies": [
"sh_cpl==2021.4.0.post2"
],
"PythonVersion": ">=3.9.2",
"PythonPath": {
"linux": ""
},
"Classifiers": []
},
"BuildSettings": {
"ProjectType": "library",
"SourcePath": "",
"OutputPath": "../../dist",
"Main": "",
"EntryPoint": "",
"IncludePackageData": false,
"Included": [],
"Excluded": [
"*/__pycache__",
"*/logs",
"*/tests"
],
"PackageData": {},
"ProjectReferences": []
}
}