Class: Stupidedi::Parser::InstructionTable
- Inherits:
-
Object
- Object
- Stupidedi::Parser::InstructionTable
- Includes:
- Inspect
- Defined in:
- lib/stupidedi/parser/instruction_table.rb
Direct Known Subclasses
Defined Under Namespace
Classes: NonEmpty
Constant Summary collapse
- Empty =
Class.new(InstructionTable) do # @return [Empty] def copy(changes = {}) self end # @return [Integer] def length 0 end def empty? true end # @return nil def at(segment_use) nil end # @return [NonEmpty] def push(instructions) InstructionTable::NonEmpty.new(instructions, self) end def matches(segment_tok, strict = false, mode = :insert) raise Exceptions::ParseError, "empty stack" end # @return [Empty] def pop(count) if count.zero? self else "empty stack" end end # @return [Empty] def drop(count) self end # @return [void] # :nocov: def pretty_print(q) q.text "InstructionTable.empty" end # :nocov: end.new
Constructors collapse
Methods included from Inspect
Class Method Details
.build(instructions) ⇒ InstructionTable::NonEmpty
214 215 216 |
# File 'lib/stupidedi/parser/instruction_table.rb', line 214 def build(instructions) empty.push(instructions) end |
.empty ⇒ InstructionTable::Empty
209 210 211 |
# File 'lib/stupidedi/parser/instruction_table.rb', line 209 def empty InstructionTable::Empty end |