Added CPL workspace
This commit is contained in:
parent
aee3441f15
commit
9c6034f7ae
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
*.pyc
|
*.pyc
|
||||||
/.idea/
|
/.idea/
|
||||||
|
venv
|
15
appsettings.json
Normal file
15
appsettings.json
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"TimeFormatSettings": {
|
||||||
|
"DateFormat": "%Y-%m-%d",
|
||||||
|
"TimeFormat": "%H:%M:%S",
|
||||||
|
"DateTimeFormat": "%Y-%m-%d %H:%M:%S.%f",
|
||||||
|
"DateTimeLogFormat": "%Y-%m-%d_%H-%M-%S"
|
||||||
|
},
|
||||||
|
|
||||||
|
"LoggingSettings": {
|
||||||
|
"Path": "logs/",
|
||||||
|
"Filename": "log_$start_time.log",
|
||||||
|
"ConsoleLogLevel": "ERROR",
|
||||||
|
"FileLogLevel": "WARN"
|
||||||
|
}
|
||||||
|
}
|
10
cpl-workspace.json
Normal file
10
cpl-workspace.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"WorkspaceSettings": {
|
||||||
|
"DefaultProject": "cc-lang",
|
||||||
|
"Projects": {
|
||||||
|
"cc-lang": "src/cc_lang/cc-lang.json",
|
||||||
|
"parser": "src/parser/parser.json",
|
||||||
|
"lexer": "src/lexer/lexer.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
27
old/src/test.cc
Normal file
27
old/src/test.cc
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# olc test 1
|
||||||
|
// olc test 2
|
||||||
|
/* mlc Test 1 */
|
||||||
|
/*
|
||||||
|
mlc Test 2
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
public lib Main {
|
||||||
|
class Program {
|
||||||
|
var test: bool = false;
|
||||||
|
var test2: Program2 = empty;
|
||||||
|
var test3: Program2 = Test(34);
|
||||||
|
|
||||||
|
func Main(): void {
|
||||||
|
#func Main {
|
||||||
|
var hallo: any;
|
||||||
|
#output('Hello');
|
||||||
|
#output(this.isTrue(false));
|
||||||
|
}
|
||||||
|
|
||||||
|
func isTrue(value: bool): bool {
|
||||||
|
#func isTrue {
|
||||||
|
#return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
1
src/cc_lang/__init__.py
Normal file
1
src/cc_lang/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
# imports:
|
16
src/cc_lang/application.py
Normal file
16
src/cc_lang/application.py
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
from cpl.application import ApplicationABC
|
||||||
|
from cpl.configuration import ConfigurationABC
|
||||||
|
from cpl.console import Console
|
||||||
|
from cpl.dependency_injection import ServiceProviderABC
|
||||||
|
|
||||||
|
|
||||||
|
class Application(ApplicationABC):
|
||||||
|
|
||||||
|
def __init__(self, config: ConfigurationABC, services: ServiceProviderABC):
|
||||||
|
ApplicationABC.__init__(self, config, services)
|
||||||
|
|
||||||
|
def configure(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def main(self):
|
||||||
|
Console.write_line('Hello World')
|
43
src/cc_lang/cc-lang.json
Normal file
43
src/cc_lang/cc-lang.json
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"ProjectSettings": {
|
||||||
|
"Name": "cc-lang",
|
||||||
|
"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.main",
|
||||||
|
"EntryPoint": "cc-lang",
|
||||||
|
"IncludePackageData": false,
|
||||||
|
"Included": [],
|
||||||
|
"Excluded": [
|
||||||
|
"*/__pycache__",
|
||||||
|
"*/logs",
|
||||||
|
"*/tests"
|
||||||
|
],
|
||||||
|
"PackageData": {},
|
||||||
|
"ProjectReferences": []
|
||||||
|
}
|
||||||
|
}
|
14
src/cc_lang/main.py
Normal file
14
src/cc_lang/main.py
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
from cpl.application import ApplicationBuilder
|
||||||
|
|
||||||
|
from cc_lang.application import Application
|
||||||
|
from cc_lang.startup import Startup
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
app_builder = ApplicationBuilder(Application)
|
||||||
|
app_builder.use_startup(Startup)
|
||||||
|
app_builder.build().run()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
19
src/cc_lang/startup.py
Normal file
19
src/cc_lang/startup.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
from cpl.application import StartupABC
|
||||||
|
from cpl.configuration import ConfigurationABC
|
||||||
|
from cpl.dependency_injection import ServiceProviderABC, ServiceCollectionABC
|
||||||
|
|
||||||
|
|
||||||
|
class Startup(StartupABC):
|
||||||
|
|
||||||
|
def __init__(self, config: ConfigurationABC, services: ServiceCollectionABC):
|
||||||
|
StartupABC.__init__(self)
|
||||||
|
|
||||||
|
self._configuration = config
|
||||||
|
self._environment = self._configuration.environment
|
||||||
|
self._services = services
|
||||||
|
|
||||||
|
def configure_configuration(self) -> ConfigurationABC:
|
||||||
|
return self._configuration
|
||||||
|
|
||||||
|
def configure_services(self) -> ServiceProviderABC:
|
||||||
|
return self._services.build_service_provider()
|
1
src/lexer/__init__.py
Normal file
1
src/lexer/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
# imports:
|
43
src/lexer/lexer.json
Normal file
43
src/lexer/lexer.json
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"ProjectSettings": {
|
||||||
|
"Name": "lexer",
|
||||||
|
"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": "lexer.main",
|
||||||
|
"EntryPoint": "lexer",
|
||||||
|
"IncludePackageData": false,
|
||||||
|
"Included": [],
|
||||||
|
"Excluded": [
|
||||||
|
"*/__pycache__",
|
||||||
|
"*/logs",
|
||||||
|
"*/tests"
|
||||||
|
],
|
||||||
|
"PackageData": {},
|
||||||
|
"ProjectReferences": []
|
||||||
|
}
|
||||||
|
}
|
1
src/parser/__init__.py
Normal file
1
src/parser/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
# imports:
|
43
src/parser/parser.json
Normal file
43
src/parser/parser.json
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"ProjectSettings": {
|
||||||
|
"Name": "parser",
|
||||||
|
"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": "parser.main",
|
||||||
|
"EntryPoint": "parser",
|
||||||
|
"IncludePackageData": false,
|
||||||
|
"Included": [],
|
||||||
|
"Excluded": [
|
||||||
|
"*/__pycache__",
|
||||||
|
"*/logs",
|
||||||
|
"*/tests"
|
||||||
|
],
|
||||||
|
"PackageData": {},
|
||||||
|
"ProjectReferences": []
|
||||||
|
}
|
||||||
|
}
|
1
src/tests/__init__.py
Normal file
1
src/tests/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
# imports:
|
Loading…
Reference in New Issue
Block a user