Sha256: 3725d13baf21cc2e4fd0b0071aee816955ec811f766992dd777630119755fb91
Contents?: true
Size: 718 Bytes
Versions: 11
Compression:
Stored size: 718 Bytes
Contents
# frozen_string_literal: true require_relative 'edge' module Rley # This module is used as a namespace module GFG # This module is used as a namespace # Abstract class. Represents an edge in a grammar flow graph # Responsibilities: # - To know the successor vertex class ShortcutEdge < Edge # The terminal symbol expected from the input stream attr_reader :nonterminal def initialize(thePredecessor, theSuccessor) super(nil, theSuccessor) @nonterminal = thePredecessor.next_symbol thePredecessor.shortcut = self end def to_s " -#{nonterminal}-> #{successor.label}" end end # class end # module end # module # End of file
Version data entries
11 entries across 11 versions & 1 rubygems