class CLTK::CFG::Production
- CLTK::CFG::Production
- Reference
- Object
Overview
Oddly enough, the Production class represents a production in a context-free grammar.
Direct Known Subclasses
Defined in:
cltk/cfg/production.crcltk/parser/msgpack.cr
Class Method Summary
-
.new(id : Int32, lhs : String, rhs : Array(String))
Instantiates a new Production object with the specified ID, and left- and right-hand sides.
- .new(__temp_80 : MessagePack::Unpacker)
Instance Method Summary
-
#==(other)
Comparese on production to another.
-
#copy
@return [Production] A new copy of this production.
- #id : Int32
- #id=(_id : Int32)
-
#last_terminal
@return [Symbol] The last terminal in the right-hand side of the production.
- #lhs : String
- #lhs=(_lhs : String)
- #rhs : Array(String)
- #rhs=(_rhs : Array(String))
-
#to_item
@return [Item] An Item based on this production.
- #to_msgpack(packer : MessagePack::Packer)
-
#to_s(padding = 0)
Returns a string representation of this production.
Instance methods inherited from class Object
in?(collection : Array | Set)
in?
Class Method Detail
Instantiates a new Production object with the specified ID, and left- and right-hand sides.
@param [Integer] id ID number of this production. @param [Symbol] lhs Left-hand side of the production. @param [Array<Symbol>] rhs Right-hand side of the production.
Instance Method Detail
Comparese on production to another. Returns true only if the left- and right- hand sides match.
@param [Production] other Another production to compare to.
@return [Boolean]
Returns a string representation of this production.
@param [Integer] padding The ammount of padding spaces to add to the beginning of the string.
@return [String]