Class: AdLint::Cc1::UnaryExpression
- Inherits:
-
Expression
- Object
- SyntaxNode
- Expression
- AdLint::Cc1::UnaryExpression
- Defined in:
- lib/adlint/cc1/syntax.rb
Direct Known Subclasses
AddressExpression, AlignofExpression, AlignofTypeExpression, IndirectionExpression, PrefixDecrementExpression, PrefixIncrementExpression, SizeofExpression, SizeofTypeExpression, UnaryArithmeticExpression
Instance Attribute Summary collapse
-
#operand ⇒ Object
readonly
Returns the value of attribute operand.
-
#operator ⇒ Object
readonly
Returns the value of attribute operator.
Attributes inherited from SyntaxNode
#head_token, #subsequent_sequence_point, #tail_token
Instance Method Summary collapse
-
#initialize(op, ope) ⇒ UnaryExpression
constructor
A new instance of UnaryExpression.
- #inspect(indent = 0) ⇒ Object
- #location ⇒ Object
- #to_s ⇒ Object
Methods inherited from Expression
#arithmetic?, #bitwise?, #constant?, #full=, #have_side_effect?, #logical?, #object_specifiers, #to_complemental_logical, #to_normalized_logical
Methods inherited from SyntaxNode
#head_location, #short_class_name, #tail_location
Methods included from LocationHolder
Methods included from Visitable
Constructor Details
#initialize(op, ope) ⇒ UnaryExpression
Returns a new instance of UnaryExpression.
1306 1307 1308 1309 1310 |
# File 'lib/adlint/cc1/syntax.rb', line 1306 def initialize(op, ope) super() @operator = op @operand = ope end |
Instance Attribute Details
#operand ⇒ Object (readonly)
Returns the value of attribute operand.
1313 1314 1315 |
# File 'lib/adlint/cc1/syntax.rb', line 1313 def operand @operand end |
#operator ⇒ Object (readonly)
Returns the value of attribute operator.
1312 1313 1314 |
# File 'lib/adlint/cc1/syntax.rb', line 1312 def operator @operator end |
Instance Method Details
#inspect(indent = 0) ⇒ Object
1323 1324 1325 1326 |
# File 'lib/adlint/cc1/syntax.rb', line 1323 def inspect(indent = 0) " " * indent + "#{short_class_name} (#{location.inspect}) " + "#{@operator.value} #{@operand.inspect}" end |
#location ⇒ Object
1315 1316 1317 |
# File 'lib/adlint/cc1/syntax.rb', line 1315 def location @operator.location end |
#to_s ⇒ Object
1319 1320 1321 |
# File 'lib/adlint/cc1/syntax.rb', line 1319 def to_s @operator.value + @operand.to_s end |