def expand(symbol)
      expansion = rules[symbol] || context[symbol]

      if expansion.nil?
        if @options.strict?
          raise Errors::UndefinedRule.new(@last_expansion, symbol)
        else
          expansion = Production::Terminal.new('')
        end
      end

      @last_expansion = expansion
      expansion
    end
def expand(symbol)
      expansion = rules[symbol] || context[symbol]

      if expansion.nil?
        if @options.strict?
          raise Errors::UndefinedRule.new(@last_expansion, symbol)
        else
          expansion = Production::Terminal.new('')
        end
      end

      @last_expansion = expansion
      expansion
    end
Expands the given symbol to its rule.

 @param [Symbol] symbol
 @return [Calyx::Rule]