class CLTK::Parser::Environment

Overview

############################### All actions passed to Parser.producation and Parser.clause are evaluated inside an instance of the Environment class or its subclass (which must have the same name).

Defined in:

cltk/parser/environment.cr

Constructors

Instance Method Summary

Instance methods inherited from class Object

in?(collection : Array | Set) in?

Constructor Detail

def self.new #

Instantiate a new Environment object.


[View source]

Instance Method Detail

def error(o) #

Adds an object to the list of errors.

@return [void]


[View source]
def errors : Array(CLTK::Type) #

A list of all objects added using the error method.

@return [Array]


def he : Bool? #

Indicates if an error was encountered and handled.

@return [Boolean]


def he=(he : Bool | Nil) #

Indicates if an error was encountered and handled.

@return [Boolean]


def pos(n) #

Returns a StreamPosition object for the symbol at location n, indexed from zero.

@param [Integer] n Index for symbol position.

@return [StreamPosition] Position of symbol at index n.


def reset #

Reset any variables that need to be re-initialized between parse calls.

@return [void]


def set_positions(positions : Array(CLTK::StreamPosition)) #

Setter for the positions array.

@param [Array] positions

@return [Array] The same array of positions.


def yield_with_self(&) #