Class: AdLint::Cc1::GroupedExpression
Instance Attribute Summary collapse
Attributes inherited from SyntaxNode
#head_token, #subsequent_sequence_point, #tail_token
Instance Method Summary
collapse
Methods inherited from Expression
#constant?, #full=, #object_specifiers
Methods inherited from SyntaxNode
#head_location, #short_class_name, #tail_location
#analysis_target?
Methods included from Visitable
#accept
Constructor Details
Returns a new instance of GroupedExpression.
800
801
802
803
804
805
|
# File 'lib/adlint/cc1/syntax.rb', line 800
def initialize(expr)
super()
@expression = expr
self.head_token = expr.head_token
self.tail_token = expr.tail_token
end
|
Instance Attribute Details
#expression ⇒ Object
Returns the value of attribute expression.
807
808
809
|
# File 'lib/adlint/cc1/syntax.rb', line 807
def expression
@expression
end
|
Instance Method Details
#arithmetic? ⇒ Boolean
821
822
823
|
# File 'lib/adlint/cc1/syntax.rb', line 821
def arithmetic?
@expression.arithmetic?
end
|
#bitwise? ⇒ Boolean
825
826
827
|
# File 'lib/adlint/cc1/syntax.rb', line 825
def bitwise?
@expression.bitwise?
end
|
#have_side_effect? ⇒ Boolean
813
814
815
|
# File 'lib/adlint/cc1/syntax.rb', line 813
def have_side_effect?
@expression.have_side_effect?
end
|
#inspect(indent = 0) ⇒ Object
846
847
848
849
|
# File 'lib/adlint/cc1/syntax.rb', line 846
def inspect(indent = 0)
" " * indent + "#{short_class_name} (#{location.inspect})\n" +
@expression.inspect(indent + 1)
end
|
809
810
811
|
# File 'lib/adlint/cc1/syntax.rb', line 809
def location
head_location
end
|
#logical? ⇒ Boolean
817
818
819
|
# File 'lib/adlint/cc1/syntax.rb', line 817
def logical?
@expression.logical?
end
|
#to_complemental_logical ⇒ Object
838
839
840
|
# File 'lib/adlint/cc1/syntax.rb', line 838
def to_complemental_logical
GroupedExpression.new(@expression.to_complemental_logical)
end
|
#to_normalized_logical(parent_expr = nil) ⇒ Object
842
843
844
|
# File 'lib/adlint/cc1/syntax.rb', line 842
def to_s
"(#{expression.to_s})"
end
|