Sha256: 4115da5d2284014467f33231eabdfe8d995a67e9a20ef55ea45bb7acc62d32ea

Contents?: true

Size: 832 Bytes

Versions: 33

Compression:

Stored size: 832 Bytes

Contents

# frozen_string_literal: true

require_relative 'lox_compound_expr'

module Loxxy
  module Ast
    class LoxBinaryExpr < LoxCompoundExpr
      # @return [Symbol] message name to be sent to receiver
      attr_reader :operator

      # @param aPosition [Rley::Lexical::Position] Position of the entry in the input stream.
      # @param operand1 [Loxxy::Ast::LoxNode]
      # @param operand2 [Loxxy::Ast::LoxNode]
      def initialize(aPosition, anOperator, operand1, operand2)
        super(aPosition, [operand1, operand2])
        @operator = anOperator
      end

      # Part of the 'visitee' role in Visitor design pattern.
      # @param visitor [Ast::ASTVisitor] the visitor
      def accept(visitor)
        visitor.visit_binary_expr(self)
      end

      alias operands subnodes
    end # class
  end # module
end # module

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
loxxy-0.2.02 lib/loxxy/ast/lox_binary_expr.rb
loxxy-0.2.01 lib/loxxy/ast/lox_binary_expr.rb
loxxy-0.2.00 lib/loxxy/ast/lox_binary_expr.rb
loxxy-0.1.17 lib/loxxy/ast/lox_binary_expr.rb
loxxy-0.1.16 lib/loxxy/ast/lox_binary_expr.rb
loxxy-0.1.15 lib/loxxy/ast/lox_binary_expr.rb
loxxy-0.1.14 lib/loxxy/ast/lox_binary_expr.rb
loxxy-0.1.13 lib/loxxy/ast/lox_binary_expr.rb
loxxy-0.1.12 lib/loxxy/ast/lox_binary_expr.rb
loxxy-0.1.11 lib/loxxy/ast/lox_binary_expr.rb
loxxy-0.1.10 lib/loxxy/ast/lox_binary_expr.rb
loxxy-0.1.09 lib/loxxy/ast/lox_binary_expr.rb
loxxy-0.1.08 lib/loxxy/ast/lox_binary_expr.rb
loxxy-0.1.07 lib/loxxy/ast/lox_binary_expr.rb
loxxy-0.1.06 lib/loxxy/ast/lox_binary_expr.rb
loxxy-0.1.05 lib/loxxy/ast/lox_binary_expr.rb
loxxy-0.1.04 lib/loxxy/ast/lox_binary_expr.rb
loxxy-0.1.03 lib/loxxy/ast/lox_binary_expr.rb
loxxy-0.1.02 lib/loxxy/ast/lox_binary_expr.rb
loxxy-0.1.01 lib/loxxy/ast/lox_binary_expr.rb