blob: d4ffa131fd9e9a7c0f063db97ef1d4fd62143e74 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
classes / enums / interfaces / services / serviceinterfaces
===========================================================
See also `class_kinds_keywords.txt`
The kinds of types could be:
classes
enums
interfaces
services
service interfaces
There are some constraints:
* enums can have a constructor, but it can only be accessed locally to
instantiate the enum values.
* interfaces cannot have constructors or fields
* service interfaces might have abstract constructors, but not fields
* services might have a specific constructor (or just an optional
zero-argument constructor?)
Declaration ordering constraints:
* Fields must already come before functions/constructors
* Require constructors to come before functions?
* Require the following to come before anything else (anything else would
implicitly be considered to be a class that doesn't implement any
interfaces):
- enum values
- class/service "implements" lines
- interface/service interface specifiers
* Don't require any particular ordering of service entry points?
Should it be required to declare exported services/entry's?
See also `main_startup.txt`
Syntax test
-----------
Class, normal:
int x
int y
Class, implementing an interface:
implements SomeInterface
impl to_string
returns
String s
code
...
end
Enum:
typekind enum
values
# `new` could be implicit, unless another constructor is specified
red = 255 0 0
green = 0 255 0
yellow = 255 255 0
blue = 0 0 255
end
Interfaces
typekind interface
func to_string
returns
String s
end
Services
# TODO more inuitive syntax/keywords than `typekind service ...`
# TODO should maybe have mulitple lines
typekind service CLIApp
# or this:
servicetype CLIApp
# or this: (best?)
be CommandMain
# TODO more inuitive syntax/keywords than `inject`
inject CLIParams params
entry main
code
...
end
Service Interfaces
typekind serviceinterface
# TODO more inuitive keyword than `injectable`
injectable CLIParams params
entry main
end
|