Class: AdLint::Cc1::FunctionDeclarator
- Inherits:
-
Declarator
- Object
- SyntaxNode
- Declarator
- AdLint::Cc1::FunctionDeclarator
- Defined in:
- lib/adlint/cc1/syntax.rb
Direct Known Subclasses
AbbreviatedFunctionDeclarator, AnsiFunctionDeclarator, KandRFunctionDeclarator
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
Attributes inherited from Declarator
Attributes inherited from SyntaxNode
#head_token, #subsequent_sequence_point, #tail_token
Instance Method Summary collapse
- #function?(stack = []) ⇒ Boolean
- #identifier ⇒ Object
-
#initialize(base_dcr) ⇒ FunctionDeclarator
constructor
A new instance of FunctionDeclarator.
- #inspect(indent = 0) ⇒ Object
- #location ⇒ Object
Methods inherited from Declarator
#abstract?, #full=, #full?, #identifier_list, #innermost_parameter_type_list, #parameter_type_list, #variable?
Methods inherited from SyntaxNode
#head_location, #short_class_name, #tail_location
Methods included from LocationHolder
Methods included from Visitable
Constructor Details
#initialize(base_dcr) ⇒ FunctionDeclarator
Returns a new instance of FunctionDeclarator.
3257 3258 3259 3260 |
# File 'lib/adlint/cc1/syntax.rb', line 3257 def initialize(base_dcr) super() @base = base_dcr end |
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base.
3262 3263 3264 |
# File 'lib/adlint/cc1/syntax.rb', line 3262 def base @base end |
Instance Method Details
#function?(stack = []) ⇒ Boolean
3272 3273 3274 3275 3276 3277 |
# File 'lib/adlint/cc1/syntax.rb', line 3272 def function?(stack = []) stack.push(:pointer) if pointer stack.push(:function) @base.function?(stack) stack.last == :function end |
#identifier ⇒ Object
3268 3269 3270 |
# File 'lib/adlint/cc1/syntax.rb', line 3268 def identifier @base.identifier end |
#inspect(indent = 0) ⇒ Object
3279 3280 3281 |
# File 'lib/adlint/cc1/syntax.rb', line 3279 def inspect(indent = 0) " " * indent + "#{short_class_name}\n" + @base.inspect(indent + 1) end |
#location ⇒ Object
3264 3265 3266 |
# File 'lib/adlint/cc1/syntax.rb', line 3264 def location @base ? @base.location || head_location : head_location end |