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.
3510 3511 3512 3513 3514 3515 3516 3517 |
# File 'lib/adlint/cc1/syntax.rb', line 3510 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.
3523 3524 3525 |
# File 'lib/adlint/cc1/syntax.rb', line 3523 def else_header_terminator @else_header_terminator end |
#else_statement ⇒ Object (readonly)
Returns the value of attribute else_statement.
3521 3522 3523 |
# File 'lib/adlint/cc1/syntax.rb', line 3521 def else_statement @else_statement end |
#expression ⇒ Object (readonly)
Returns the value of attribute expression.
3519 3520 3521 |
# File 'lib/adlint/cc1/syntax.rb', line 3519 def expression @expression end |
#then_header_terminator ⇒ Object (readonly)
Returns the value of attribute then_header_terminator.
3522 3523 3524 |
# File 'lib/adlint/cc1/syntax.rb', line 3522 def then_header_terminator @then_header_terminator end |
#then_statement ⇒ Object (readonly)
Returns the value of attribute then_statement.
3520 3521 3522 |
# File 'lib/adlint/cc1/syntax.rb', line 3520 def then_statement @then_statement end |
Instance Method Details
#inspect(indent = 0) ⇒ Object
3529 3530 3531 3532 3533 3534 |
# File 'lib/adlint/cc1/syntax.rb', line 3529 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
3525 3526 3527 |
# File 'lib/adlint/cc1/syntax.rb', line 3525 def location head_location end |