class IWordConsumer inherits IStringConsumer { word: String; consume(s: String) : Int {{ consumed_length <- 0; if s.substr(0, word.length()) = word then consumed_length <- word.length() else consumed_length fi; }}; };