Class: AdLint::Cc1::NullConstantSpecifier

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

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

Methods included from LocationHolder

#analysis_target?

Methods included from Visitable

#accept

Constructor Details

#initialize(tok) ⇒ NullConstantSpecifier

Returns a new instance of NullConstantSpecifier.



749
750
751
752
# File 'lib/adlint/cc1/syntax.rb', line 749

def initialize(tok)
  super()
  @token = tok
end

Instance Attribute Details

#tokenObject (readonly)

Returns the value of attribute token.



754
755
756
# File 'lib/adlint/cc1/syntax.rb', line 754

def token
  @token
end

Instance Method Details

#arithmetic?Boolean

Returns:

  • (Boolean)


768
769
770
# File 'lib/adlint/cc1/syntax.rb', line 768

def arithmetic?
  false
end

#bitwise?Boolean

Returns:

  • (Boolean)


772
773
774
# File 'lib/adlint/cc1/syntax.rb', line 772

def bitwise?
  false
end

#have_side_effect?Boolean

Returns:

  • (Boolean)


760
761
762
# File 'lib/adlint/cc1/syntax.rb', line 760

def have_side_effect?
  false
end

#inspect(indent = 0) ⇒ Object



793
794
795
796
# File 'lib/adlint/cc1/syntax.rb', line 793

def inspect(indent = 0)
  " " * indent + "#{short_class_name} (#{location.inspect}) " +
    "#{@token.value}"
end

#locationObject



756
757
758
# File 'lib/adlint/cc1/syntax.rb', line 756

def location
  @token.location
end

#logical?Boolean

Returns:

  • (Boolean)


764
765
766
# File 'lib/adlint/cc1/syntax.rb', line 764

def logical?
  false
end

#to_complemental_logicalObject



785
786
787
# File 'lib/adlint/cc1/syntax.rb', line 785

def to_complemental_logical
  self
end

#to_normalized_logical(parent_expr = nil) ⇒ Object



776
777
778
779
780
781
782
783
# File 'lib/adlint/cc1/syntax.rb', line 776

def to_normalized_logical(parent_expr = nil)
  case parent_expr
  when nil, LogicalAndExpression, LogicalOrExpression
    create_normalized_logical_of(self)
  else
    self
  end
end

#to_sObject



789
790
791
# File 'lib/adlint/cc1/syntax.rb', line 789

def to_s
  @token.value
end