Class: Idl::GlobalAst

Inherits:
AstNode show all
Includes:
Declaration
Defined in:
lib/idl/ast.rb

Instance Method Summary collapse

Constructor Details

#initialize(input, interval, declaration) ⇒ GlobalAst

Returns a new instance of GlobalAst.



688
689
690
691
# File 'lib/idl/ast.rb', line 688

def initialize(input, interval, declaration)
  super(input, interval, [declaration])
  declaration.make_global
end

Instance Method Details

#add_symbol(symtab) ⇒ Object



701
702
703
704
705
# File 'lib/idl/ast.rb', line 701

def add_symbol(symtab)
  internal_error "Should be at global scope" unless symtab.levels == 1

  declaration.add_symbol(symtab)
end

#declarationVariableDeclarationAst

Returns The decl.

Returns:



684
685
686
# File 'lib/idl/ast.rb', line 684

def declaration
  @children[0]
end

#type(symtab) ⇒ Object



697
698
699
# File 'lib/idl/ast.rb', line 697

def type(symtab)
  declaration.type(symtab)
end

#type_check(symtab) ⇒ Object



693
694
695
# File 'lib/idl/ast.rb', line 693

def type_check(symtab)
  declaration.type_check(symtab)
end