Skip to content

Commit

Permalink
First pass at PEG parser.
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Oct 13, 2024
1 parent c0c9516 commit b66d6be
Show file tree
Hide file tree
Showing 27 changed files with 4,775 additions and 63,414 deletions.
6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ group :development do
gem 'json-ld-preloaded',github: 'ruby-rdf/json-ld-preloaded', branch: 'develop'
gem 'ld-patch', github: 'ruby-rdf/ld-patch', branch: 'develop'
gem 'linkeddata', github: 'ruby-rdf/linkeddata', branch: 'develop'
gem 'rdf-hamster-repo', github: 'ruby-rdf/rdf-hamster-repo', branch: 'develop'
gem 'rdf-hamster-repo', github: 'ruby-rdf/rdf-hamster-repo', branch: 'develop'
gem 'rdf-isomorphic', github: 'ruby-rdf/rdf-isomorphic', branch: 'develop'
gem 'rdf-json', github: 'ruby-rdf/rdf-json', branch: 'develop'
gem 'rdf-microdata', github: 'ruby-rdf/rdf-microdata', branch: 'develop'
gem 'rdf-n3', github: 'ruby-rdf/rdf-n3', branch: 'develop'
gem 'rdf-normalize', github: 'ruby-rdf/rdf-normalize', branch: 'develop'
gem 'rdf-ordered-repo', github: 'ruby-rdf/rdf-ordered-repo', branch: 'develop'
gem 'rdf-ordered-repo', github: 'ruby-rdf/rdf-ordered-repo', branch: 'develop'
gem 'rdf-rdfa', github: 'ruby-rdf/rdf-rdfa', branch: 'develop'
gem 'rdf-rdfxml', github: 'ruby-rdf/rdf-rdfxml', branch: 'develop'
gem 'rdf-reasoner', github: 'ruby-rdf/rdf-reasoner', branch: 'develop'
Expand All @@ -35,6 +35,8 @@ group :development do
gem 'erubis', '>= 2.7.0'
gem 'htmlentities', '>= 4.3.4'
gem 'equivalent-xml', '>= 0.6.0'
gem 'ostruct', '>= 0.6.0'
gem 'ruby-prof', platforms: :mri
end

group :debug do
Expand Down
16 changes: 8 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,32 +73,32 @@ file "etc/manifest-cache.nt" do
end

desc 'Create versions of ebnf files in etc'
task etc: %w{etc/sparql12.sxp etc/sparql12.html etc/sparql12.ll1.sxp}
task etc: %w{etc/sparql12.sxp etc/sparql12.html etc/sparql12.peg.sxp}

desc 'Build first, follow and branch tables'
task meta: "lib/sparql/grammar/meta.rb"

file "lib/sparql/grammar/meta.rb" => "etc/sparql12.bnf" do |t|
sh %{
ebnf --ll1 QueryUnit --ll1 UpdateUnit --format rb \
ebnf --peg --format rb \
--mod-name SPARQL::Grammar::Meta \
--output lib/sparql/grammar/meta.rb \
etc/sparql12.bnf
}
end

file "etc/sparql12.ll1.sxp" => "etc/sparql12.bnf" do |t|
file "etc/sparql12.sxp" => "etc/sparql12.bnf" do |t|
sh %{
ebnf --ll1 QueryUnit --ll1 UpdateUnit --format sxp \
--output etc/sparql12.ll1.sxp \
ebnf --bnf --format sxp \
--output etc/sparql12.sxp \
etc/sparql12.bnf
}
end

file "etc/sparql12.sxp" => "etc/sparql12.bnf" do |t|
file "etc/sparql12.peg.sxp" => "etc/sparql12.bnf" do |t|
sh %{
ebnf --bnf --format sxp \
--output etc/sparql12.sxp \
ebnf --peg --format sxp \
--output etc/sparql12.peg.sxp \
etc/sparql12.bnf
}
end
Expand Down
586 changes: 287 additions & 299 deletions etc/sparql12.bnf

Large diffs are not rendered by default.

Loading

0 comments on commit b66d6be

Please sign in to comment.