Class: Stone::AST::NullLiteral

Inherits:
Expression show all
Defined in:
lib/stone/ast/null_literal.rb

Instance Attribute Summary

Attributes inherited from Stone::AST

#children, #name

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeNullLiteral



11
12
13
# File 'lib/stone/ast/null_literal.rb', line 11

def initialize
  @name = :null_literal
end

Class Method Details

.parse(_text, _location) ⇒ Object



7
8
9
# File 'lib/stone/ast/null_literal.rb', line 7

def self.parse(_text, _location)
  new
end

Instance Method Details

#to_llir(_builder, _mod, _scope = Stone::Scope.top_level) ⇒ Object



15
16
17
# File 'lib/stone/ast/null_literal.rb', line 15

def to_llir(_builder, _mod, _scope = Stone::Scope.top_level)
  LLVM::Type.ptr.null
end

#to_sObject



19
20
21
# File 'lib/stone/ast/null_literal.rb', line 19

def to_s
  "NULL"
end

#type(_context = nil) ⇒ Object



23
24
25
# File 'lib/stone/ast/null_literal.rb', line 23

def type(_context = nil)
  Stone::Type::Null
end