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.
3507 3508 3509 3510 3511 3512 |
# File 'lib/adlint/cc1/syntax.rb', line 3507 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.
3514 3515 3516 |
# File 'lib/adlint/cc1/syntax.rb', line 3514 def expression @expression end |
#header_terminator ⇒ Object (readonly)
Returns the value of attribute header_terminator.
3516 3517 3518 |
# File 'lib/adlint/cc1/syntax.rb', line 3516 def header_terminator @header_terminator end |
#statement ⇒ Object (readonly)
Returns the value of attribute statement.
3515 3516 3517 |
# File 'lib/adlint/cc1/syntax.rb', line 3515 def statement @statement end |
Instance Method Details
#inspect(indent = 0) ⇒ Object
3522 3523 3524 3525 |
# File 'lib/adlint/cc1/syntax.rb', line 3522 def inspect(indent = 0) " " * indent + "#{short_class_name}\n" + @expression.inspect(indent + 1) + "\n" + @statement.inspect(indent + 1) end |
#location ⇒ Object
3518 3519 3520 |
# File 'lib/adlint/cc1/syntax.rb', line 3518 def location head_location end |