Class: AdLint::Cc1::StructDeclarator

Inherits:
SyntaxNode 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 SyntaxNode

#head_location, #short_class_name, #tail_location

Methods included from LocationHolder

#analysis_target?

Methods included from Visitable

#accept

Constructor Details

#initialize(dcr, expr) ⇒ StructDeclarator

Returns a new instance of StructDeclarator.



2947
2948
2949
2950
2951
# File 'lib/adlint/cc1/syntax.rb', line 2947

def initialize(dcr, expr)
  super()
  @declarator = dcr
  @expression = expr
end

Instance Attribute Details

#declaratorObject (readonly)

Returns the value of attribute declarator.



2953
2954
2955
# File 'lib/adlint/cc1/syntax.rb', line 2953

def declarator
  @declarator
end

#expressionObject (readonly)

Returns the value of attribute expression.



2954
2955
2956
# File 'lib/adlint/cc1/syntax.rb', line 2954

def expression
  @expression
end

Instance Method Details

#bitfield?Boolean

Returns:

  • (Boolean)


2960
2961
2962
# File 'lib/adlint/cc1/syntax.rb', line 2960

def bitfield?
  @expression != nil
end

#inspect(indent = 0) ⇒ Object



2964
2965
2966
# File 'lib/adlint/cc1/syntax.rb', line 2964

def inspect(indent = 0)
  " " * indent + short_class_name
end

#locationObject



2956
2957
2958
# File 'lib/adlint/cc1/syntax.rb', line 2956

def location
  @declarator ? @declarator.location : @expression.location
end