Class: Sexpir::Sequential

Inherits:
Ast
  • Object
show all
Defined in:
lib/sexpir/ast.rb,
lib/sexpir/ast_sexp.rb

Instance Attribute Summary collapse

Attributes inherited from Ast

#node

Instance Method Summary collapse

Methods inherited from Ast

#accept

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



58
59
60
# File 'lib/sexpir/ast.rb', line 58

def body
  @body
end

#labelObject

Returns the value of attribute label.



58
59
60
# File 'lib/sexpir/ast.rb', line 58

def label
  @label
end

Instance Method Details

#sexpObject



93
94
95
96
97
98
99
100
101
102
# File 'lib/sexpir/ast_sexp.rb', line 93

def sexp
  code=Code.new
  label_s=label ? label : "nil"
  code << "(sequential #{label_s}"
  code.indent=2
  code << body.sexp
  code.indent=0
  code << ")"
  code
end