Class: Idl::UserTypeNameAst
Instance Method Summary collapse
-
#initialize(input, interval) ⇒ UserTypeNameAst
constructor
A new instance of UserTypeNameAst.
-
#to_idl ⇒ String
Return valid IDL representation of the node (and its subtree).
- #type(symtab) ⇒ Object
-
#type_check(symtab) ⇒ void
type check this node and all children.
Constructor Details
#initialize(input, interval) ⇒ UserTypeNameAst
Returns a new instance of UserTypeNameAst.
4688 4689 4690 4691 |
# File 'lib/idl/ast.rb', line 4688 def initialize(input, interval) super(input, interval, EMPTY_ARRAY) @type_cache = {} end |
Instance Method Details
#to_idl ⇒ String
Return valid IDL representation of the node (and its subtree)
4709 |
# File 'lib/idl/ast.rb', line 4709 def to_idl = text_value |
#type(symtab) ⇒ Object
4701 4702 4703 4704 4705 4706 |
# File 'lib/idl/ast.rb', line 4701 def type(symtab) typ = @type_cache[symtab.archdef] return typ unless typ.nil? @type_cache[symtab.archdef] = symtab.get(text_value) end |
#type_check(symtab) ⇒ void
This method returns an undefined value.
type check this node and all children
Calls to #type and/or #value may depend on type_check being called first with the same symtab. If not, those functions may raise an AstNode::InternalError
4694 4695 4696 4697 4698 |
# File 'lib/idl/ast.rb', line 4694 def type_check(symtab) type = type(symtab) type_error "#{text_value} is not a type" unless type.is_a?(Type) end |