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.
4723 4724 4725 4726 |
# File 'lib/idl/ast.rb', line 4723 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)
4744 |
# File 'lib/idl/ast.rb', line 4744 def to_idl = text_value |
#type(symtab) ⇒ Object
4736 4737 4738 4739 4740 4741 |
# File 'lib/idl/ast.rb', line 4736 def type(symtab) typ = @type_cache[symtab.cfg_arch] return typ unless typ.nil? @type_cache[symtab.cfg_arch] = 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
4729 4730 4731 4732 4733 |
# File 'lib/idl/ast.rb', line 4729 def type_check(symtab) type = type(symtab) type_error "#{text_value} is not a type" unless type.is_a?(Type) end |