Sha256: 2894be933fac60ed938d46872b83f83e645358ad5a25651ec0c4dbcc95a1ec2a
Contents?: true
Size: 1.16 KB
Versions: 6
Compression:
Stored size: 1.16 KB
Contents
module Lrama class Grammar class Code class DestructorCode < Code def initialize(type:, token_code:, tag:) super(type: type, token_code: token_code) @tag = tag end private # * ($$) *yyvaluep # * (@$) *yylocationp # * ($:$) error # * ($1) error # * (@1) error # * ($:1) error def reference_to_c(ref) case when ref.type == :dollar && ref.name == "$" # $$ member = @tag.member "((*yyvaluep).#{member})" when ref.type == :at && ref.name == "$" # @$ "(*yylocationp)" when ref.type == :index && ref.name == "$" # $:$ raise "$:#{ref.value} can not be used in #{type}." when ref.type == :dollar # $n raise "$#{ref.value} can not be used in #{type}." when ref.type == :at # @n raise "@#{ref.value} can not be used in #{type}." when ref.type == :index # $:n raise "$:#{ref.value} can not be used in #{type}." else raise "Unexpected. #{self}, #{ref}" end end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems