8000 GitHub - codygustafson/sparkql at v2
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

codygustafson/sparkql

 
 

Repository files navigation

SparkQL parser

This gem contains the syntax parser for processing Spark Query Language filter queries into a manageable structure. To get an overview of the language syntax-wise, refer to the following files:

  • lib/sparkql_v2/parser.y # BNF Grammar
  • lib/sparkql_v2/token.rb # Token matching rules

Installation

Add the gem to your gemfile:

Gemfile gem 'sparkql', '~> 2.0.0'

When completed, run 'bundle install'.

Usage

Parsing documentation can be found here. Semantic Analysis documentation can be found here.

Development

The parser is based on racc, a yacc like LR parser that is a part of the ruby runtime. The grammar is located at lib/sparkql_v2/parser.y and is compiled as part of the test process. Refer to the Rakefile for details. When modifying the grammar, please checkin BOTH the parser.y and parser.rb files.

Debugging grammar issues can be done by hand using the "racc" command. For example, a dump of the parser states (and conflicts) can be generated via

racc -o lib/sparkql_v2/parser.rb lib/sparkql_v2/parser.y -v  # see lib/sparkql_v2/parser.output

About

Racc based parser for the spark API filter syntax.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 95.4%
  • Yacc 4.4%
  • Shell 0.2%
0