summaryrefslogtreecommitdiff
path: root/tool/lrama/lib/lrama/grammar/printer.rb
blob: 8984a96e1a65d712f8eef12b04e23a8630885611 (plain)
1
2
3
4
5
6
7
8
9
module Lrama
  class Grammar
    class Printer < Struct.new(:ident_or_tags, :token_code, :lineno, keyword_init: true)
      def translated_code(tag)
        Code::PrinterCode.new(type: :printer, token_code: token_code, tag: tag).translated_code
      end
    end
  end
end