Module: Idl::Rvalue
- Included in:
- ArrayLiteralAst, AryElementAccessAst, AryRangeAccessAst, BinaryExpressionAst, BitsCastAst, ConcatenationExpressionAst, CsrFieldReadExpressionAst, CsrFunctionCallAst, CsrReadExpressionAst, DontCareLvalueAst, DontCareReturnAst, EnumCastAst, EnumRefAst, FieldAccessExpressionAst, FunctionCallExpressionAst, IdAst, IntLiteralAst, ParenExpressionAst, ReplicationExpressionAst, SignCastAst, StringLiteralAst, TernaryOperatorExpressionAst, UnaryOperatorExpressionAst
- Defined in:
- lib/idl/ast.rb
Overview
interface for R-values (e.g., expressions that have a value)
Instance Method Summary collapse
-
#type(symtab) ⇒ Type
abstract
Given a specific symbol table, return the type of this node.
-
#value(symtab) ⇒ Object
abstract
Return the compile-time-known value of the node.
-
#values(symtab) ⇒ Array<Integer>, ...
Return a complete list of possible compile-time-known values of the node, or raise a ValueError if the full list cannot be determined.
Instance Method Details
#type(symtab) ⇒ Type
This method is abstract.
Given a specific symbol table, return the type of this node.
Should not be called until #type_check is called with the same arguments
479 |
# File 'lib/idl/ast.rb', line 479 def type(symtab) = raise NotImplementedError, "#{self.class.name} has no type" |
#value(symtab) ⇒ Object
This method is abstract.
Return the compile-time-known value of the node
502 |
# File 'lib/idl/ast.rb', line 502 def value(symtab) = raise NotImplementedError, "#{self.class.name} must implement value(symtab)" |
#values(symtab) ⇒ Array<Integer>, ...
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
516 |
# File 'lib/idl/ast.rb', line 516 def values(symtab) = [value(symtab)] |