diff --git a/lib/imbecile/grammar.rb b/lib/imbecile/grammar.rb index 2a0375b..1a6db4e 100644 --- a/lib/imbecile/grammar.rb +++ b/lib/imbecile/grammar.rb @@ -13,6 +13,10 @@ module Imbecile # Tokens. attr_reader :tokens + # @return [Array] + # Rules. + attr_reader :rules + def initialize(input) @tokens = [] @rules = [] diff --git a/lib/imbecile/grammar/rule.rb b/lib/imbecile/grammar/rule.rb index 31368e0..5733326 100644 --- a/lib/imbecile/grammar/rule.rb +++ b/lib/imbecile/grammar/rule.rb @@ -3,8 +3,12 @@ module Imbecile class Rule + attr_reader :name + attr_reader :components + attr_reader :code + def initialize(name, rule, code) @name = name rule_components = rule.split(/\s+/)