class Savi::Program::Declarator
- Savi::Program::Declarator
- Reference
- Object
Defined in:
savi/program/declarator.crConstructors
Class Method Summary
-
.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.
Instance Method Summary
- #begins : Array(String)
- #begins=(begins : Array(String))
- #body_allowed : Bool
- #body_allowed=(body_allowed : Bool)
- #body_required : Bool
- #body_required=(body_required : Bool)
- #context : AST::Identifier
- #context=(context : AST::Identifier)
- #finish(ctx, scope)
- #intrinsic : Bool
- #intrinsic=(intrinsic : Bool)
- #matches_head?(head, errors : Array(Error::Info) | Nil = nil)
- #matches_name?(name)
- #name : AST::Identifier
- #name=(name : AST::Identifier)
- #run(ctx, scope, declare, terms)
- #terms : Array(Declarator::TermAcceptor)
- #terms=(terms : Array(Declarator::TermAcceptor))
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)
#
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.