Class: AdLint::Cpp::UnaryArithmeticExpression
Instance Attribute Summary collapse
#operator
Attributes inherited from Expression
#value
Instance Method Summary
collapse
#location
Methods inherited from SyntaxNode
#location, #short_class_name
#analysis_target?
Methods included from Visitable
#accept
Constructor Details
801
802
803
804
|
# File 'lib/adlint/cpp/syntax.rb', line 801
def initialize(val, op, expr)
super(val, op)
@expression = expr
end
|
Instance Attribute Details
#expression ⇒ Object
Returns the value of attribute expression.
806
807
808
|
# File 'lib/adlint/cpp/syntax.rb', line 806
def expression
@expression
end
|
Instance Method Details
#inspect(indent = 0) ⇒ Object
812
813
814
815
|
# File 'lib/adlint/cpp/syntax.rb', line 812
def inspect(indent = 0)
" " * indent + "#{short_class_name} (#{operator.inspect})\n" +
@expression.inspect(indent + 1)
end
|
#to_s ⇒ Object
808
809
810
|
# File 'lib/adlint/cpp/syntax.rb', line 808
def to_s
"#{operator.value} #{@expression.to_s}"
end
|