class Savi::Program::Declarator

Defined in:

savi/program/declarator.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(name : Savi::AST::Identifier, intrinsic : Bool = false, context : Savi::AST::Identifier = (AST::Identifier.new("top")).with_pos(Source::Pos.none), begins : Array(String) = [] of String, terms : Array(Savi::Program::Declarator::TermAcceptor) = [] of Declarator::TermAcceptor, body_allowed : Bool = false, body_required : Bool = false) #

[View source]

Class Method Detail

def self.new_bootstrap(name, intrinsic = false, context = "top", begins = [] of String, terms = [] of Declarator::TermAcceptor, body_allowed = false, body_required = false) #

This is a convenience constructor that will create fake AST nodes for those fields which expect an AST node. This is used in bootstrapping, because in bootstrapping they are not coming from Savi source code, and thus there is no true AST node with a real source position. However, all of these bootstrap instances will be replaced with ones defined in Savi source code before user code is run, so all of these fake AST nodes and will not plague our presentation of user errors.


[View source]

Instance Method Detail

def begins : Array(String) #

[View source]
def begins=(begins : Array(String)) #

[View source]
def body_allowed : Bool #

[View source]
def body_allowed=(body_allowed : Bool) #

[View source]
def body_required : Bool #

[View source]
def body_required=(body_required : Bool) #

[View source]
def context : AST::Identifier #

[View source]
def context=(context : AST::Identifier) #

[View source]
def finish(ctx, scope) #

[View source]
def intrinsic : Bool #

[View source]
def intrinsic=(intrinsic : Bool) #

[View source]
def matches_head?(head, errors : Array(Error::Info) | Nil = nil) #

[View source]
def matches_name?(name) #

[View source]
def name : AST::Identifier #

[View source]
def name=(name : AST::Identifier) #

[View source]
def run(ctx, scope, declare, terms) #

[View source]

[View source]
def terms=(terms : Array(Declarator::TermAcceptor)) #

[View source]