Class: AdLint::Cc1::IfStatement
- Inherits:
-
SelectionStatement
- Object
- SyntaxNode
- Statement
- SelectionStatement
- AdLint::Cc1::IfStatement
- Defined in:
- lib/adlint/cc1/syntax.rb
Instance Attribute Summary collapse
-
#expression ⇒ Object
readonly
Returns the value of attribute expression.
-
#header_terminator ⇒ Object
readonly
Returns the value of attribute header_terminator.
-
#statement ⇒ Object
readonly
Returns the value of attribute statement.
Attributes inherited from Statement
Attributes inherited from SyntaxNode
#head_token, #subsequent_sequence_point, #tail_token
Instance Method Summary collapse
-
#initialize(expr, stmt, header_term) ⇒ IfStatement
constructor
A new instance of IfStatement.
- #inspect(indent = 0) ⇒ Object
- #location ⇒ Object
Methods inherited from Statement
Methods inherited from SyntaxNode
#head_location, #short_class_name, #tail_location
Methods included from LocationHolder
Methods included from Visitable
Constructor Details
#initialize(expr, stmt, header_term) ⇒ IfStatement
Returns a new instance of IfStatement.
3488 3489 3490 3491 3492 3493 |
# File 'lib/adlint/cc1/syntax.rb', line 3488 def initialize(expr, stmt, header_term) super() @expression = expr @statement = stmt @header_terminator = header_term end |
Instance Attribute Details
#expression ⇒ Object (readonly)
Returns the value of attribute expression.
3495 3496 3497 |
# File 'lib/adlint/cc1/syntax.rb', line 3495 def expression @expression end |
#header_terminator ⇒ Object (readonly)
Returns the value of attribute header_terminator.
3497 3498 3499 |
# File 'lib/adlint/cc1/syntax.rb', line 3497 def header_terminator @header_terminator end |
#statement ⇒ Object (readonly)
Returns the value of attribute statement.
3496 3497 3498 |
# File 'lib/adlint/cc1/syntax.rb', line 3496 def statement @statement end |
Instance Method Details
#inspect(indent = 0) ⇒ Object
3503 3504 3505 3506 |
# File 'lib/adlint/cc1/syntax.rb', line 3503 def inspect(indent = 0) " " * indent + "#{short_class_name}\n" + @expression.inspect(indent + 1) + "\n" + @statement.inspect(indent + 1) end |
#location ⇒ Object
3499 3500 3501 |
# File 'lib/adlint/cc1/syntax.rb', line 3499 def location head_location end |