Summary Files Commits Branches @commit @diff @stats
path: root / src / Token / IToken.cl
diff options
context:
space:
mode:
Commitb43c94ca62a747f2f9fb222cdf887c041dd544bb (patch)
Author
 Syndamia <kamen@syndamia.com>
2025-11-01 16:28:08 +0200
Committer
 Syndamia <kamen@syndamia.com>
2025-11-01 16:28:08 +0200
Files43e0ea846844257cf46055e68cc2661056b05965 /src/Token/IToken.cl
cool-self-hosted-b43c94ca62a747f2f9fb222cdf887c041dd544bb.tar
cool-self-hosted-b43c94ca62a747f2f9fb222cdf887c041dd544bb.tar.gz
cool-self-hosted-b43c94ca62a747f2f9fb222cdf887c041dd544bb.zip
Parent0830615386f036acc55a72b2548efb65526c761f (diff)
feat!: Add basic lexer components
1 files changed, 24 insertions, 0 deletions
-rw-r--r--src/Token/IToken.cl24
diff --git a/src/Token/IToken.cl b/src/Token/IToken.cl
new file mode 100644
index 0000000..05282ab
--- /dev/null
+++ b/src/Token/IToken.cl
@@ -0,0 +1,24 @@
+class IToken inherits System {
+---
+ name() : String {
+ not_implemented_retstr("name")
+ };
+
+ value() : String {
+ not_implemented_retstr("value")
+ };
+
+---
+ id: Int;
+
+ id() : Int {
+ id
+ };
+
+ init(iid: Int) : Object {{
+ assert(iid = 0, "init", "ID 0 is not allowed for a token!");
+ assert(not (id = 0), "init", "token object '".concat(name()).concat("' is already initialized!"));
+ id <- iid;
+ void;
+ }};
+};