Summary Files Commits Branches @commit @diff @stats
path: root / src / StringConsumer / BaseConsumers / IntegerConsumer.cl
diff options
context:
space:
mode:
1 files changed, 21 insertions, 0 deletions
-rw-r--r--src/StringConsumer/BaseConsumers/IntegerConsumer.cl21
diff --git a/src/StringConsumer/BaseConsumers/IntegerConsumer.cl b/src/StringConsumer/BaseConsumers/IntegerConsumer.cl
new file mode 100644
index 0000000..5b4cd82
--- /dev/null
+++ b/src/StringConsumer/BaseConsumers/IntegerConsumer.cl
@@ -0,0 +1,21 @@
+class IntegerConsumer inherits IWordsConsumer {
+ init() : IStringConsumer {{
+ matched_words <- matched_words
+ .push("0")
+ .push("1")
+ .push("2")
+ .push("3")
+ .push("4")
+ .push("5")
+ .push("6")
+ .push("7")
+ .push("8")
+ .push("9")
+ ;
+ self;
+ }};
+
+ token() : IToken {
+ new IntegerToken
+ };
+};