Class: AdLint::Cc1::TranslationUnit
- Inherits:
-
SyntaxNode
- Object
- SyntaxNode
- AdLint::Cc1::TranslationUnit
- Defined in:
- lib/adlint/cc1/syntax.rb
Instance Attribute Summary collapse
-
#external_declarations ⇒ Object
readonly
Returns the value of attribute external_declarations.
Attributes inherited from SyntaxNode
#head_token, #subsequent_sequence_point, #tail_token
Instance Method Summary collapse
-
#initialize ⇒ TranslationUnit
constructor
A new instance of TranslationUnit.
- #inspect(indent = 0) ⇒ Object
- #location ⇒ Object
- #push(external_dcl) ⇒ Object
Methods inherited from SyntaxNode
#head_location, #short_class_name, #tail_location
Methods included from LocationHolder
Methods included from Visitable
Constructor Details
#initialize ⇒ TranslationUnit
Returns a new instance of TranslationUnit.
3980 3981 3982 3983 |
# File 'lib/adlint/cc1/syntax.rb', line 3980 def initialize super @external_declarations = [] end |
Instance Attribute Details
#external_declarations ⇒ Object (readonly)
Returns the value of attribute external_declarations.
3985 3986 3987 |
# File 'lib/adlint/cc1/syntax.rb', line 3985 def external_declarations @external_declarations end |
Instance Method Details
#inspect(indent = 0) ⇒ Object
4000 4001 4002 4003 |
# File 'lib/adlint/cc1/syntax.rb', line 4000 def inspect(indent = 0) ([" " * indent + short_class_name] + @external_declarations.map { |d| d.inspect(indent + 1) }).join("\n") end |
#location ⇒ Object
3996 3997 3998 |
# File 'lib/adlint/cc1/syntax.rb', line 3996 def location head_location ? head_location : Location.new end |
#push(external_dcl) ⇒ Object
3987 3988 3989 3990 3991 3992 3993 3994 |
# File 'lib/adlint/cc1/syntax.rb', line 3987 def push(external_dcl) if @external_declarations.empty? self.head_token = external_dcl.head_token end @external_declarations.push(external_dcl) self.tail_token = external_dcl.tail_token self end |