Class: AdLint::Cpp::DefinedExpression

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

Instance Attribute Summary collapse

Attributes inherited from UnaryExpression

#operator

Attributes inherited from Expression

#value

Instance Method Summary collapse

Methods inherited from UnaryExpression

#location

Methods inherited from SyntaxNode

#location, #short_class_name

Methods included from LocationHolder

#analysis_target?

Methods included from Visitable

#accept

Constructor Details

#initialize(val, op, id) ⇒ DefinedExpression

Returns a new instance of DefinedExpression.



819
820
821
822
# File 'lib/adlint/cpp/syntax.rb', line 819

def initialize(val, op, id)
  super(val, op)
  @identifier = id
end

Instance Attribute Details

#identifierObject (readonly)

Returns the value of attribute identifier.



824
825
826
# File 'lib/adlint/cpp/syntax.rb', line 824

def identifier
  @identifier
end

Instance Method Details

#inspect(indent = 0) ⇒ Object



830
831
832
833
# File 'lib/adlint/cpp/syntax.rb', line 830

def inspect(indent = 0)
  " " * indent + "#{short_class_name} " +
    "(#{operator.inspect} #{@identifier.inspect}"
end

#to_sObject



826
827
828
# File 'lib/adlint/cpp/syntax.rb', line 826

def to_s
  "#{operator.value}(#{@identifier.value})"
end