Sha256: 3f2fbe51ae573e0638298e6532dcb4807bd33cca04543477cb7c11234fa29b81
Contents?: true
Size: 940 Bytes
Versions: 17
Compression:
Stored size: 940 Bytes
Contents
# frozen_string_literal: true require_relative 'lox_compound_expr' module Loxxy module Ast class LoxIfStmt < LoxCompoundExpr # @return [LoxNode] code of then branch attr_reader :then_stmt # @return [LoxNode, NilClass] code of else branch attr_reader :else_stmt # @param aPosition [Rley::Lexical::Position] Position of the entry in the input stream. # @param condExpr [Loxxy::Ast::LoxNode] # @param thenStmt [Loxxy::Ast::LoxNode] # @param elseStmt [Loxxy::Ast::LoxNode] def initialize(aPosition, condExpr, thenStmt, elseStmt) super(aPosition, [condExpr]) @then_stmt = thenStmt @else_stmt = elseStmt end # Accessor to the condition expression # @return [LoxNode] def condition subnodes[0] end define_accept # Add `accept` method as found in Visitor design pattern end # class end # module end # module
Version data entries
17 entries across 17 versions & 1 rubygems