Class: Idl::ParenExpressionAst
- Includes:
- Rvalue
- Defined in:
- lib/idl/ast.rb
Overview
represents a parenthesized expression
for example:
(a + b)
Instance Method Summary collapse
- #expression ⇒ Object
-
#initialize(input, interval, exp) ⇒ ParenExpressionAst
constructor
A new instance of ParenExpressionAst.
- #invert(symtab) ⇒ Object
-
#to_idl ⇒ String
Return valid IDL representation of the node (and its subtree).
-
#type(symtab) ⇒ Type
Given a specific symbol table, return the type of this node.
-
#type_check(symtab) ⇒ void
type check this node and all children.
-
#value(symtab) ⇒ Object
Return the compile-time-known value of the node.
-
#values(symtab) ⇒ Array<Integer>, ...
included
from Rvalue
Return a complete list of possible compile-time-known values of the node, or raise a ValueError if the full list cannot be determined.
Constructor Details
#initialize(input, interval, exp) ⇒ ParenExpressionAst
Returns a new instance of ParenExpressionAst.
3023 |
# File 'lib/idl/ast.rb', line 3023 def initialize(input, interval, exp) = super(input, interval, [exp]) |
Instance Method Details
#expression ⇒ Object
3025 |
# File 'lib/idl/ast.rb', line 3025 def expression = @children[0] |
#invert(symtab) ⇒ Object
3027 |
# File 'lib/idl/ast.rb', line 3027 def invert(symtab) = expression.invert(symtab) |
#to_idl ⇒ String
Return valid IDL representation of the node (and its subtree)
3039 |
# File 'lib/idl/ast.rb', line 3039 def to_idl = "(#{expression.to_idl})" |
#type(symtab) ⇒ Type
Given a specific symbol table, return the type of this node.
Should not be called until #type_check is called with the same arguments
3033 |
# File 'lib/idl/ast.rb', line 3033 def type(symtab) = expression.type(symtab) |
#type_check(symtab) ⇒ void
3030 |
# File 'lib/idl/ast.rb', line 3030 def type_check(symtab) = expression.type_check(symtab) |
#value(symtab) ⇒ Object
Return the compile-time-known value of the node
3036 |
# File 'lib/idl/ast.rb', line 3036 def value(symtab) = expression.value(symtab) |
#values(symtab) ⇒ Array<Integer>, ... Originally defined in module Rvalue
Return a complete list of possible compile-time-known values of the node, or raise a ValueError if the full list cannot be determined
For most AstNodes, this will just be a single-entry array