Class: AdLint::Cc1::IfElseStatement
- Inherits:
-
SelectionStatement
- Object
- SyntaxNode
- Statement
- SelectionStatement
- AdLint::Cc1::IfElseStatement
- Defined in:
- lib/adlint/cc1/syntax.rb
Instance Attribute Summary collapse
-
#else_header_terminator ⇒ Object
readonly
Returns the value of attribute else_header_terminator.
-
#else_statement ⇒ Object
readonly
Returns the value of attribute else_statement.
-
#expression ⇒ Object
readonly
Returns the value of attribute expression.
-
#then_header_terminator ⇒ Object
readonly
Returns the value of attribute then_header_terminator.
-
#then_statement ⇒ Object
readonly
Returns the value of attribute then_statement.
Attributes inherited from Statement
Attributes inherited from SyntaxNode
#head_token, #subsequent_sequence_point, #tail_token
Instance Method Summary collapse
-
#initialize(expr, then_stmt, else_stmt, then_term, else_term) ⇒ IfElseStatement
constructor
A new instance of IfElseStatement.
- #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, then_stmt, else_stmt, then_term, else_term) ⇒ IfElseStatement
Returns a new instance of IfElseStatement.
3529 3530 3531 3532 3533 3534 3535 3536 |
# File 'lib/adlint/cc1/syntax.rb', line 3529 def initialize(expr, then_stmt, else_stmt, then_term, else_term) super() @expression = expr @then_statement = then_stmt @else_statement = else_stmt @then_header_terminator = then_term @else_header_terminator = else_term end |
Instance Attribute Details
#else_header_terminator ⇒ Object (readonly)
Returns the value of attribute else_header_terminator.
3542 3543 3544 |
# File 'lib/adlint/cc1/syntax.rb', line 3542 def else_header_terminator @else_header_terminator end |
#else_statement ⇒ Object (readonly)
Returns the value of attribute else_statement.
3540 3541 3542 |
# File 'lib/adlint/cc1/syntax.rb', line 3540 def else_statement @else_statement end |
#expression ⇒ Object (readonly)
Returns the value of attribute expression.
3538 3539 3540 |
# File 'lib/adlint/cc1/syntax.rb', line 3538 def expression @expression end |
#then_header_terminator ⇒ Object (readonly)
Returns the value of attribute then_header_terminator.
3541 3542 3543 |
# File 'lib/adlint/cc1/syntax.rb', line 3541 def then_header_terminator @then_header_terminator end |
#then_statement ⇒ Object (readonly)
Returns the value of attribute then_statement.
3539 3540 3541 |
# File 'lib/adlint/cc1/syntax.rb', line 3539 def then_statement @then_statement end |
Instance Method Details
#inspect(indent = 0) ⇒ Object
3548 3549 3550 3551 3552 3553 |
# File 'lib/adlint/cc1/syntax.rb', line 3548 def inspect(indent = 0) " " * indent + "#{short_class_name}\n" + @expression.inspect(indent + 1) + "\n" + @then_statement.inspect(indent + 1) + "\n" + @else_statement.inspect(indent + 1) end |
#location ⇒ Object
3544 3545 3546 |
# File 'lib/adlint/cc1/syntax.rb', line 3544 def location head_location end |