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.



2928
2929
2930
2931
2932
# File 'lib/adlint/cc1/syntax.rb', line 2928

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

Instance Attribute Details

#declaratorObject (readonly)

Returns the value of attribute declarator.



2934
2935
2936
# File 'lib/adlint/cc1/syntax.rb', line 2934

def declarator
  @declarator
end

#expressionObject (readonly)

Returns the value of attribute expression.



2935
2936
2937
# File 'lib/adlint/cc1/syntax.rb', line 2935

def expression
  @expression
end

Instance Method Details

#bitfield?Boolean

Returns:

  • (Boolean)


2941
2942
2943
# File 'lib/adlint/cc1/syntax.rb', line 2941

def bitfield?
  @expression != nil
end

#inspect(indent = 0) ⇒ Object



2945
2946
2947
# File 'lib/adlint/cc1/syntax.rb', line 2945

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

#locationObject



2937
2938
2939
# File 'lib/adlint/cc1/syntax.rb', line 2937

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