Module: Idl::Returns
- Included in:
- ConditionalReturnStatementAst, ElseIfAst, ForLoopAst, FunctionBodyAst, IfAst, IfBodyAst, ReturnStatementAst
- Defined in:
- lib/idl/ast.rb
Overview
interface for nodes that might return a value in a function body
Instance Method Summary collapse
-
#return_value(symtab) ⇒ Integer, ...
Evaluate the compile-time return value of this node, or, if the node does not return (e.g., because it is an IfAst but there is no return on the taken path), execute the node and update the symtab.
-
#return_values(symtab) ⇒ Array<Integer>, Array<Boolean>
Evaluate all possible compile-time return values of this node, or, if the node does not return (e.g., because it is an IfAst but there is no return on a possible path), execute the node and update the symtab.
Instance Method Details
#return_value(symtab) ⇒ Integer, ...
Evaluate the compile-time return value of this node, or, if the node does not return (e.g., because it is an IfAst but there is no return on the taken path), execute the node and update the symtab
446 |
# File 'lib/idl/ast.rb', line 446 def return_value(symtab) = raise NotImplementedError, "#{self.class.name} must implement return_value" |
#return_values(symtab) ⇒ Array<Integer>, Array<Boolean>
Evaluate all possible compile-time return values of this node, or, if the node does not return (e.g., because it is an IfAst but there is no return on a possible path), execute the node and update the symtab
459 |
# File 'lib/idl/ast.rb', line 459 def return_values(symtab) = raise NotImplementedError, "#{self.class.name} must implement return_values" |