Class: IcAgent::Ast::Nodes::StatementNode
- Inherits:
-
Treetop::Runtime::SyntaxNode
- Object
- Treetop::Runtime::SyntaxNode
- IcAgent::Ast::Nodes::StatementNode
show all
- Defined in:
- lib/ic_agent/ast/nodes/statement_nodes.rb
Direct Known Subclasses
IcBaseType, IcBaseTypeChild, IcBaseTypeContent, IcBaseTypeFunc, IcBaseTypeKey, IcBaseTypeOpt, IcBaseTypeOther, IcBaseTypeRecord, IcBaseTypeSingle, IcBaseTypeValue, IcBaseTypeVariant, IcBaseTypeVec, IcTypeDef, IcTypeName, StatementBlock, StatementContent
Instance Attribute Summary collapse
Instance Method Summary
collapse
Instance Attribute Details
#child_count ⇒ Object
Returns the value of attribute child_count.
7
8
9
|
# File 'lib/ic_agent/ast/nodes/statement_nodes.rb', line 7
def child_count
@child_count
end
|
#depth ⇒ Object
Returns the value of attribute depth.
7
8
9
|
# File 'lib/ic_agent/ast/nodes/statement_nodes.rb', line 7
def depth
@depth
end
|
Instance Method Details
#add_child ⇒ Object
25
26
27
|
# File 'lib/ic_agent/ast/nodes/statement_nodes.rb', line 25
def add_child
@child_count ||= 0 + 1
end
|
#elements_to_s ⇒ Object
21
22
23
|
# File 'lib/ic_agent/ast/nodes/statement_nodes.rb', line 21
def elements_to_s
elements.map(&:to_s).join("\n")
end
|
#source_content ⇒ Object
29
30
31
|
# File 'lib/ic_agent/ast/nodes/statement_nodes.rb', line 29
def source_content
self.text_value.strip
end
|
#title ⇒ Object
9
10
11
|
# File 'lib/ic_agent/ast/nodes/statement_nodes.rb', line 9
def title
:named_node
end
|
#to_array ⇒ Object
13
14
15
|
# File 'lib/ic_agent/ast/nodes/statement_nodes.rb', line 13
def to_array
[title] + elements.map(&:to_array)
end
|
#to_s ⇒ Object
17
18
19
|
# File 'lib/ic_agent/ast/nodes/statement_nodes.rb', line 17
def to_s
"#{title.to_s.upcase} #{elements_to_s}"
end
|