class CLTK::CFG::Item
Overview
The Item class represents a CFG production with dot in it.
Defined in:
cltk/cfg/item.crConstructors
-
.new(dot : Int32, *args)
Instantiates a new Item object with a dot located before the symbol at index dot of the right-hand side.
Instance Method Summary
-
#==(other : Item)
Compares two items.
-
#advance
Moves the items dot forward by one if the end of the right-hand side hasn't already been reached.
-
#at_end?
Tests to see if the dot is at the end of the right-hand side.
-
#copy
@return [Item] A new copy of this item.
-
#dot : Int32
@return [Integer] Index of the next symbol in this item.
-
#next_symbol
Returns the symbol located after the dot.
-
#to_s(padding = 0)
Returns a string representation of this item.
Instance methods inherited from class CLTK::CFG::Production
==(other)
==,
copy
copy,
id : Int32
id,
last_terminal
last_terminal,
lhs : String
lhs,
rhs : Array(String)
rhs,
to_item
to_item,
to_s(padding = 0)
to_s
Constructor methods inherited from class CLTK::CFG::Production
new(id : Int32, lhs : String, rhs : Array(String))
new
Instance methods inherited from class Object
in?(collection : Array | Set)
in?
Constructor Detail
Instantiates a new Item object with a dot located before the symbol at index dot of the right-hand side. The remaining arguments (args) should be as specified by {Production#initialize}.
@param [Integer] dot Location of the dot in this Item. @param [Array