You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
450 B
20 lines
450 B
2 years ago
|
module Lox
|
||
|
module Expr
|
||
|
Binary = Struct.new(:left, :op, :right) do
|
||
|
def accept(visitor) = visitor.visit_binary(self)
|
||
|
end
|
||
|
|
||
|
Grouping = Struct.new(:expr) do
|
||
|
def accept(visitor) = visitor.visit_grouping(self)
|
||
|
end
|
||
|
|
||
|
Literal = Struct.new(:value) do
|
||
|
def accept(visitor) = visitor.visit_literal(self)
|
||
|
end
|
||
|
|
||
|
Unary = Struct.new(:op, :right) do
|
||
|
def accept(visitor) = visitor.visit_unary(self)
|
||
|
end
|
||
|
end
|
||
|
end
|