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.
2992 2993 2994 2995 2996 2997 |
# File 'lib/adlint/cc1/syntax.rb', line 2992 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.
3000 3001 3002 |
# File 'lib/adlint/cc1/syntax.rb', line 3000 def expression @expression end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
2999 3000 3001 |
# File 'lib/adlint/cc1/syntax.rb', line 2999 def identifier @identifier end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol.
3001 3002 3003 |
# File 'lib/adlint/cc1/syntax.rb', line 3001 def symbol @symbol end |
#type ⇒ Object
Returns the value of attribute type.
3003 3004 3005 |
# File 'lib/adlint/cc1/syntax.rb', line 3003 def type @type end |
#value ⇒ Object
Returns the value of attribute value.
3002 3003 3004 |
# File 'lib/adlint/cc1/syntax.rb', line 3002 def value @value end |
Instance Method Details
#inspect(indent = 0) ⇒ Object
3017 3018 3019 |
# File 'lib/adlint/cc1/syntax.rb', line 3017 def inspect(indent = 0) " " * indent + short_class_name end |
#location ⇒ Object
3005 3006 3007 |
# File 'lib/adlint/cc1/syntax.rb', line 3005 def location @identifier.location end |
#to_s ⇒ Object
3009 3010 3011 3012 3013 3014 3015 |
# File 'lib/adlint/cc1/syntax.rb', line 3009 def to_s if @expression "#{@identifier.value} = #{@expression.to_s}" else "#{@identifier.value}" end end |