class CLTK::Parser::Environment
- CLTK::Parser::Environment
- Reference
- Object
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.crClass Method Summary
-
.new
Instantiate a new Environment object.
Instance Method Summary
-
#error(o)
Adds an object to the list of errors.
-
#errors : Array(CLTK::Type)
A list of all objects added using the error method.
-
#he : Bool?
Indicates if an error was encountered and handled.
-
#he=(he)
Indicates if an error was encountered and handled.
-
#pos(n)
Returns a StreamPosition object for the symbol at location n, indexed from zero.
-
#reset
Reset any variables that need to be re-initialized between parse calls.
-
#set_positions(positions)
Setter for the positions array.
- #yield_with_self(&block)
Instance methods inherited from class Object
in?(collection : Array | Set)
in?
Class Method Detail
Instance Method Detail
A list of all objects added using the error method.
@return [Array<Object>]
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.
Setter for the positions array.
@param [Array<StreamPosition>] positions
@return [Array<StreamPosition>] The same array of positions.