Class: Sexpir::Body
- Defined in:
- lib/sexpir/ast.rb,
lib/sexpir/ast_sexp.rb
Overview
statements
Instance Attribute Summary collapse
-
#stmts ⇒ Object
Returns the value of attribute stmts.
Attributes inherited from Ast
Instance Method Summary collapse
- #<<(e) ⇒ Object
-
#initialize ⇒ Body
constructor
A new instance of Body.
- #sexp ⇒ Object
Methods inherited from Ast
Constructor Details
#initialize ⇒ Body
Returns a new instance of Body.
44 45 46 |
# File 'lib/sexpir/ast.rb', line 44 def initialize @stmts=[] end |
Instance Attribute Details
#stmts ⇒ Object
Returns the value of attribute stmts.
43 44 45 |
# File 'lib/sexpir/ast.rb', line 43 def stmts @stmts end |
Instance Method Details
#<<(e) ⇒ Object
48 49 50 |
# File 'lib/sexpir/ast.rb', line 48 def << e @stmts << e end |
#sexp ⇒ Object
72 73 74 75 76 |
# File 'lib/sexpir/ast_sexp.rb', line 72 def sexp code=Code.new stmts.each{|stmt| code << stmt.sexp} code end |