require 'lgenerator'
gen = Generator.new do |g|
main.is :hello, "\n", :ex1, "\n", :ex2
hello.is "Hello, ", :somebody, "!"
somebody.is "matz" | "world"
ex1.is "This is a more ", ("complex " | "elaborate "), :example, "."
example.is "example" | "test"
ex2.define do
is "Some simple sentence."
is "Another, involving ", ["a more complex ", :exp] | "harder stuff ", "."
is "Yet another possibility; each one is chosen with prob. 1/3."
end
exp.is "expression" | "disjunction" | :example
end
puts gen.generate