class Merlin::Context(IdentT, NodeT)

Defined in:

context/context.cr
context/modifying.cr
context/querying.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(name : IdentT | Nil, nodes : Array(NodeT) | Nil = nil, tokens : Array(MatchedToken(IdentT)) | Nil = nil, sub_contexts : Hash(IdentT, Context(IdentT, NodeT)) | Nil = nil) #

[View source]

Instance Method Detail

def [](key : IdentT | Nil) : Context(IdentT, NodeT) #

[View source]
def []?(key : IdentT | Nil) : Context(IdentT, NodeT) | Nil #

[View source]
def absorb(key : IdentT | Nil) : Nil #

[View source]
def add(key : IdentT | Nil, value : Context(IdentT, NodeT), clone : Bool = true) : Nil #

[View source]
def add(key : IdentT | Nil, value : NodeT | Array(NodeT) | MatchedToken(IdentT) | Array(MatchedToken(IdentT))) : Nil #

[View source]
def add(values : Array(MatchedToken(IdentT))) : Nil #

[View source]
def add(values : Array(NodeT)) : Nil #

[View source]
def add(value : MatchedToken(IdentT)) : Nil #

[View source]
def add(value : NodeT) : Nil #

[View source]
def after_last_position : Position #

[View source]
def after_last_position? : Position | Nil #

[View source]
def become(key : IdentT | Nil) : Nil #

[View source]
def become(value : NodeT | MatchedToken(IdentT)) : Nil #

[View source]
def clear : Nil #

[View source]
def clone #

[View source]
def copy_with(name = @name.dup, nodes = @nodes.dup, tokens = @tokens.dup, sub_contexts = @sub_contexts.clone) #

[View source]
def drop(key : IdentT | Nil, index : Int32) : NodeT | MatchedToken(IdentT) | Nil #

[View source]
def drop(key : IdentT | Nil) : Context(IdentT, NodeT) | Nil #

[View source]
def drop_context(key : IdentT | Nil) : Context(IdentT, NodeT) | Nil #

[View source]
def drop_contexts : Nil #

[View source]
def drop_nodes : Nil #

[View source]
def drop_tokens : Nil #

[View source]
def empty? : Bool #

[View source]
def first_position : Position #

[View source]
def first_position? : Position | Nil #

[View source]
def flatten : Nil #

[View source]
def last_position : Position #

[View source]
def last_position? : Position | Nil #

[View source]
def merge(from : Context(IdentT, NodeT), clone : Bool = true) : Nil #

[View source]
def name : IdentT | Nil #

[View source]
def name=(name : IdentT | Nil) #

[View source]
def name_s : String #

[View source]
def node(index : Int32 = 0) : NodeT #

[View source]
def node?(index : Int32 = 0) : NodeT | Nil #

[View source]
def nodes : Array(NodeT) #

[View source]
def nodes? : Array(NodeT) | Nil #

[View source]
def rename(from_key : IdentT | Nil, to_key : IdentT | Nil) : Nil #

[View source]
def reset(name : IdentT | Nil) : Nil #

[View source]
def result : NodeT #

Root result


[View source]
def subcontext_self(as_key : IdentT = @name.not_nil!) : Nil #

[View source]
def to_subcontext(key : IdentT | Nil) : Nil #

[View source]
def token(index : Int32 = 0) : MatchedToken(IdentT) #

[View source]
def token?(index : Int32 = 0) : MatchedToken(IdentT) | Nil #

[View source]
def tokens : Array(MatchedToken(IdentT)) #

[View source]
def tokens? : Array(MatchedToken(IdentT)) | Nil #

[View source]
def unsafe_add(key : IdentT | Nil, value : Context(IdentT, NodeT)) : Nil #

[View source]
def unsafe_merge(from : Context(IdentT, NodeT)) #

[View source]