Class: IDL::Expression::ScopedName
- Inherits:
-
IDL::Expression
- Object
- IDL::Expression
- IDL::Expression::ScopedName
- Defined in:
- lib/ridl/expression.rb
Instance Attribute Summary collapse
-
#node ⇒ Object
readonly
Returns the value of attribute node.
Attributes inherited from IDL::Expression
Instance Method Summary collapse
-
#initialize(node) ⇒ ScopedName
constructor
A new instance of ScopedName.
- #instantiate(_context) ⇒ Object
- #is_node?(node_class) ⇒ Boolean
- #is_template? ⇒ Boolean
- #resolved_node ⇒ Object
Methods inherited from IDL::Expression
Constructor Details
#initialize(node) ⇒ ScopedName
Returns a new instance of ScopedName.
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/ridl/expression.rb', line 38 def initialize(node) if $DEBUG unless IDL::AST::Const === node || (IDL::AST::TemplateParam === node && node.idltype.is_a?(IDL::Type::Const)) raise RuntimeError, "#{node.scoped_name} must be constant: #{node.class.name}." end end @node = node @idltype = node.idltype @value = @idltype.narrow(node.value) unless node.is_template? end |
Instance Attribute Details
#node ⇒ Object (readonly)
Returns the value of attribute node.
37 38 39 |
# File 'lib/ridl/expression.rb', line 37 def node @node end |
Instance Method Details
#instantiate(_context) ⇒ Object
52 53 54 55 56 57 58 59 |
# File 'lib/ridl/expression.rb', line 52 def instantiate(_context) if self.is_template? cp = IDL::AST::TemplateParam.concrete_param(_context, @node) cp.is_a?(Expression) ? cp : ScopedName.new(cp) else self end end |
#is_node?(node_class) ⇒ Boolean
60 61 62 |
# File 'lib/ridl/expression.rb', line 60 def is_node?(node_class) @node.is_a?(node_class) end |
#is_template? ⇒ Boolean
49 50 51 |
# File 'lib/ridl/expression.rb', line 49 def is_template? @node.is_template? end |
#resolved_node ⇒ Object
63 64 65 |
# File 'lib/ridl/expression.rb', line 63 def resolved_node @node end |