Class: AdLint::Cc1::StringLiteralSpecifier

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(lit) ⇒ StringLiteralSpecifier

Returns a new instance of StringLiteralSpecifier.



694
695
696
697
# File 'lib/adlint/cc1/syntax.rb', line 694

def initialize(lit)
  super()
  @literal = lit
end

Instance Attribute Details

#literalObject (readonly)

Returns the value of attribute literal.



699
700
701
# File 'lib/adlint/cc1/syntax.rb', line 699

def literal
  @literal
end

Instance Method Details

#arithmetic?Boolean

Returns:

  • (Boolean)


717
718
719
# File 'lib/adlint/cc1/syntax.rb', line 717

def arithmetic?
  false
end

#bitwise?Boolean

Returns:

  • (Boolean)


721
722
723
# File 'lib/adlint/cc1/syntax.rb', line 721

def bitwise?
  false
end

#have_side_effect?Boolean

Returns:

  • (Boolean)


709
710
711
# File 'lib/adlint/cc1/syntax.rb', line 709

def have_side_effect?
  false
end

#inspect(indent = 0) ⇒ Object



742
743
744
745
# File 'lib/adlint/cc1/syntax.rb', line 742

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

#locationObject



701
702
703
# File 'lib/adlint/cc1/syntax.rb', line 701

def location
  @literal.location
end

#logical?Boolean

Returns:

  • (Boolean)


713
714
715
# File 'lib/adlint/cc1/syntax.rb', line 713

def logical?
  false
end

#prefixObject



705
706
707
# File 'lib/adlint/cc1/syntax.rb', line 705

def prefix
  @literal.value.scan(/\AL/i).first
end

#to_complemental_logicalObject



734
735
736
# File 'lib/adlint/cc1/syntax.rb', line 734

def to_complemental_logical
  self
end

#to_normalized_logical(parent_expr = nil) ⇒ Object



725
726
727
728
729
730
731
732
# File 'lib/adlint/cc1/syntax.rb', line 725

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



738
739
740
# File 'lib/adlint/cc1/syntax.rb', line 738

def to_s
  @literal.value
end