Class: AdLint::Cpp::GroupedExpression

Inherits:
PrimaryExpression show all
Defined in:
lib/adlint/cpp/syntax.rb

Instance Attribute Summary collapse

Attributes inherited from Expression

#value

Instance Method Summary collapse

Methods inherited from SyntaxNode

#short_class_name

Methods included from LocationHolder

#analysis_target?

Methods included from Visitable

#accept

Constructor Details

#initialize(val, expr) ⇒ GroupedExpression

Returns a new instance of GroupedExpression.



766
767
768
769
# File 'lib/adlint/cpp/syntax.rb', line 766

def initialize(val, expr)
  super(val)
  @expression = expr
end

Instance Attribute Details

#expressionObject (readonly)

Returns the value of attribute expression.



771
772
773
# File 'lib/adlint/cpp/syntax.rb', line 771

def expression
  @expression
end

Instance Method Details

#inspect(indent = 0) ⇒ Object



781
782
783
784
# File 'lib/adlint/cpp/syntax.rb', line 781

def inspect(indent = 0)
  " " * indent + "#{short_class_name}\n" +
    @expression.inspect(indent + 1)
end

#locationObject



773
774
775
# File 'lib/adlint/cpp/syntax.rb', line 773

def location
  @expression.location
end

#to_sObject



777
778
779
# File 'lib/adlint/cpp/syntax.rb', line 777

def to_s
  "(#{@expression.to_s})"
end