Summary Files Commits Branches @commit @diff @stats
path: root / src / StringConsumer / BaseConsumers / KeywordsIfConsumer.cl
diff options
context:
space:
mode:
1 files changed, 15 insertions, 0 deletions
-rw-r--r--src/StringConsumer/BaseConsumers/KeywordsIfConsumer.cl15
diff --git a/src/StringConsumer/BaseConsumers/KeywordsIfConsumer.cl b/src/StringConsumer/BaseConsumers/KeywordsIfConsumer.cl
new file mode 100644
index 0000000..9bd76e9
--- /dev/null
+++ b/src/StringConsumer/BaseConsumers/KeywordsIfConsumer.cl
@@ -0,0 +1,15 @@
+class KeywordsIfConsumer inherits IWordsConsumer {
+ init() : IStringConsumer {{
+ matched_words <- matched_words
+ .push("if")
+ .push("then")
+ .push("else")
+ .push("fi")
+ ;
+ self;
+ }};
+
+ token() : IToken {
+ new KeywordToken
+ };
+};