Class: AdLint::Cc1::FunctionDeclaration
- Inherits:
-
SyntaxNode
- Object
- SyntaxNode
- AdLint::Cc1::FunctionDeclaration
- Defined in:
- lib/adlint/cc1/syntax.rb
Instance Attribute Summary collapse
-
#declaration_specifiers ⇒ Object
readonly
Returns the value of attribute declaration_specifiers.
-
#init_declarator ⇒ Object
readonly
Returns the value of attribute init_declarator.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from SyntaxNode
#head_token, #subsequent_sequence_point, #tail_token
Instance Method Summary collapse
- #function_declarator ⇒ Object
- #identifier ⇒ Object
-
#initialize(dcl_specs, init_dcr, sym) ⇒ FunctionDeclaration
constructor
A new instance of FunctionDeclaration.
- #inspect(indent = 0) ⇒ Object
- #location ⇒ Object
- #signature ⇒ Object
Methods included from SyntaxNodeCollector
collect_additive_expressions, collect_array_declarators, collect_compound_assignment_expressions, collect_constant_specifiers, collect_equality_expressions, collect_function_declarators, collect_generic_labeled_statements, collect_goto_statements, collect_identifier_declarators, collect_if_else_statements, collect_if_statements, collect_logical_and_expressions, collect_logical_or_expressions, collect_object_specifiers, collect_postfix_decrement_expressions, collect_postfix_increment_expressions, collect_prefix_decrement_expressions, collect_prefix_increment_expressions, collect_relational_expressions, collect_simple_assignment_expressions, collect_typedef_type_specifiers
Methods included from DeclarationSpecifiersHolder
#explicitly_typed?, #function_specifier, #implicitly_typed?, #storage_class_specifier, #type_qualifiers, #type_specifiers
Methods included from SymbolicElement
Methods inherited from SyntaxNode
#head_location, #short_class_name, #tail_location
Methods included from LocationHolder
Methods included from Visitable
Constructor Details
#initialize(dcl_specs, init_dcr, sym) ⇒ FunctionDeclaration
Returns a new instance of FunctionDeclaration.
2405 2406 2407 2408 2409 2410 2411 |
# File 'lib/adlint/cc1/syntax.rb', line 2405 def initialize(dcl_specs, init_dcr, sym) super() @declaration_specifiers = dcl_specs @init_declarator = init_dcr @symbol = sym @type = nil end |
Instance Attribute Details
#declaration_specifiers ⇒ Object (readonly)
Returns the value of attribute declaration_specifiers.
2413 2414 2415 |
# File 'lib/adlint/cc1/syntax.rb', line 2413 def declaration_specifiers @declaration_specifiers end |
#init_declarator ⇒ Object (readonly)
Returns the value of attribute init_declarator.
2414 2415 2416 |
# File 'lib/adlint/cc1/syntax.rb', line 2414 def init_declarator @init_declarator end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
2415 2416 2417 |
# File 'lib/adlint/cc1/syntax.rb', line 2415 def symbol @symbol end |
#type ⇒ Object
Returns the value of attribute type.
2416 2417 2418 |
# File 'lib/adlint/cc1/syntax.rb', line 2416 def type @type end |
Instance Method Details
#function_declarator ⇒ Object
2426 2427 2428 |
# File 'lib/adlint/cc1/syntax.rb', line 2426 def function_declarator collect_function_declarators(@init_declarator).first end |
#identifier ⇒ Object
2418 2419 2420 |
# File 'lib/adlint/cc1/syntax.rb', line 2418 def identifier @init_declarator.declarator.identifier end |
#inspect(indent = 0) ⇒ Object
2434 2435 2436 2437 |
# File 'lib/adlint/cc1/syntax.rb', line 2434 def inspect(indent = 0) " " * indent + "#{short_class_name} (#{location.inspect}) " + identifier.value end |
#location ⇒ Object
2430 2431 2432 |
# File 'lib/adlint/cc1/syntax.rb', line 2430 def location identifier.location end |
#signature ⇒ Object
2422 2423 2424 |
# File 'lib/adlint/cc1/syntax.rb', line 2422 def signature FunctionSignature.new(identifier.value, @type) end |