Sha256: b3f9b8c48de346c95f7c14e51415cf10e2f1f65e5a7383874a9fce01cb18b12c
Contents?: true
Size: 911 Bytes
Versions: 24
Compression:
Stored size: 911 Bytes
Contents
# frozen_string_literal: true require_relative 'lox_compound_expr' module Loxxy module Ast class LoxWhileStmt < LoxCompoundExpr # @return [LoxNode] body of the while loop (as a statement) attr_reader :body # @param aPosition [Rley::Lexical::Position] Position of the entry in the input stream. # @param condExpr [Loxxy::Ast::LoxNode] iteration condition # @param theBody [Loxxy::Ast::LoxNode] def initialize(aPosition, condExpr, theBody) super(aPosition, [condExpr]) @body = theBody end # Part of the 'visitee' role in Visitor design pattern. # @param visitor [Ast::ASTVisitor] the visitor def accept(visitor) visitor.visit_while_stmt(self) end # Accessor to the condition expression # @return [LoxNode] def condition subnodes[0] end end # class end # module end # module
Version data entries
24 entries across 24 versions & 1 rubygems