Sha256: f0a992484b2ee3509ba4c8e94a44bdf9bb9e8363490844499c58dd696ec2a493
Contents?: true
Size: 500 Bytes
Versions: 10
Compression:
Stored size: 500 Bytes
Contents
# frozen_string_literal: true # Load the builder class require_relative '../../../lib/rley/syntax/base_grammar_builder' module GrammarABCHelper # Factory method. Creates a grammar builder for a simple grammar. # (based on example in N. Wirth "Compiler Construction" book, p. 6) def grammar_abc_builder Rley::Syntax::BaseGrammarBuilder.new do add_terminals('a', 'b', 'c') rule 'S' => 'A' rule 'A' => 'a A c' rule 'A' => 'b' end end end # module # End of file
Version data entries
10 entries across 10 versions & 1 rubygems