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.
3238 3239 3240 3241 |
# File 'lib/adlint/cc1/syntax.rb', line 3238 def initialize(base_dcr) super() @base = base_dcr end |
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base.
3243 3244 3245 |
# File 'lib/adlint/cc1/syntax.rb', line 3243 def base @base end |
Instance Method Details
#function?(stack = []) ⇒ Boolean
3253 3254 3255 3256 3257 3258 |
# File 'lib/adlint/cc1/syntax.rb', line 3253 def function?(stack = []) stack.push(:pointer) if pointer stack.push(:function) @base.function?(stack) stack.last == :function end |
#identifier ⇒ Object
3249 3250 3251 |
# File 'lib/adlint/cc1/syntax.rb', line 3249 def identifier @base.identifier end |
#inspect(indent = 0) ⇒ Object
3260 3261 3262 |
# File 'lib/adlint/cc1/syntax.rb', line 3260 def inspect(indent = 0) " " * indent + "#{short_class_name}\n" + @base.inspect(indent + 1) end |
#location ⇒ Object
3245 3246 3247 |
# File 'lib/adlint/cc1/syntax.rb', line 3245 def location @base ? @base.location || head_location : head_location end |