Class: AdLint::Cc1::Enumerator
- Inherits:
-
SyntaxNode
- Object
- SyntaxNode
- AdLint::Cc1::Enumerator
- Includes:
- SymbolicElement
- Defined in:
- lib/adlint/cc1/syntax.rb
Instance Attribute Summary collapse
-
#expression ⇒ Object
readonly
Returns the value of attribute expression.
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from SyntaxNode
#head_token, #subsequent_sequence_point, #tail_token
Instance Method Summary collapse
-
#initialize(id, expr, sym) ⇒ Enumerator
constructor
A new instance of Enumerator.
- #inspect(indent = 0) ⇒ Object
- #location ⇒ Object
- #to_s ⇒ Object
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(id, expr, sym) ⇒ Enumerator
Returns a new instance of Enumerator.
3011 3012 3013 3014 3015 3016 |
# File 'lib/adlint/cc1/syntax.rb', line 3011 def initialize(id, expr, sym) super() @identifier = id @expression = expr @symbol = sym end |
Instance Attribute Details
#expression ⇒ Object (readonly)
Returns the value of attribute expression.
3019 3020 3021 |
# File 'lib/adlint/cc1/syntax.rb', line 3019 def expression @expression end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
3018 3019 3020 |
# File 'lib/adlint/cc1/syntax.rb', line 3018 def identifier @identifier end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
3020 3021 3022 |
# File 'lib/adlint/cc1/syntax.rb', line 3020 def symbol @symbol end |
#type ⇒ Object
Returns the value of attribute type.
3022 3023 3024 |
# File 'lib/adlint/cc1/syntax.rb', line 3022 def type @type end |
#value ⇒ Object
Returns the value of attribute value.
3021 3022 3023 |
# File 'lib/adlint/cc1/syntax.rb', line 3021 def value @value end |
Instance Method Details
#inspect(indent = 0) ⇒ Object
3036 3037 3038 |
# File 'lib/adlint/cc1/syntax.rb', line 3036 def inspect(indent = 0) " " * indent + short_class_name end |
#location ⇒ Object
3024 3025 3026 |
# File 'lib/adlint/cc1/syntax.rb', line 3024 def location @identifier.location end |
#to_s ⇒ Object
3028 3029 3030 3031 3032 3033 3034 |
# File 'lib/adlint/cc1/syntax.rb', line 3028 def to_s if @expression "#{@identifier.value} = #{@expression.to_s}" else "#{@identifier.value}" end end |