Sha256: 90a92543ee10a54ee610505509689f7e0f41c37b7bd1e2a0175388b161e82a1a

Contents?: true

Size: 837 Bytes

Versions: 26

Compression:

Stored size: 837 Bytes

Contents

# frozen_string_literal: true

require_relative 'lox_compound_expr'

module Loxxy
  module Ast
    # This AST node represents the assignment of a value to a variable
    class LoxAssignExpr < LoxCompoundExpr
      # @return [String] variable name
      attr_reader :name

      # @param aPosition [Rley::Lexical::Position] Position of the entry in the input stream.
      # @param aName [String] name of the variable
      # @param aValue [Loxxy::Ast::LoxNode, NilClass] value to assign
      def initialize(aPosition, aName, aValue)
        super(aPosition, [aValue])
        @name = aName
      end

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

Version data entries

26 entries across 26 versions & 1 rubygems

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