The language-pig package

[Tags:library, mit]

Parser and pretty printer for the Apache Pig scripting language (http:pig.apache.org/). The current version is implemented using Parsec parser combinators.


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.2.0.0, 0.2.0.1, 0.2.0.2, 0.3.0.0, 0.3.0.1
Dependencies base (==4.6.*), Cabal (>=1.16.0), containers, parsec (>=3.1.3), pretty-tree [details]
License MIT
Author Elise Huard
Maintainer elise@jabberwocky.eu
Stability Experimental
Category Language
Source repository head: git clone https://github.com/elisehuard/language-pig
Uploaded Mon Dec 16 13:38:36 UTC 2013 by elisehuard
Distributions NixOS:0.3.0.1
Downloads 1105 total (15 in the last 30 days)
Votes
0 []
Status Docs available [build log]
Successful builds reported [all 1 reports]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for language-pig

Readme for language-pig-0.3.0.1

language-pig

Parser and pretty printer for the Apache Pig scripting language (http://pig.apache.org/). The current version is implemented using Parsec parser combinators.

Install

Cabal project, now on hackage, so the usual

cabal install language-pig

Or from source

git clone ...
cd language-pig
cabal install

Use

Parse an expression:

parseString :: [Char] -> Root

Returns an AST (type Root is the root node).

Parse a file:

parseFile :: FilePath -> IO PigFile

PigFile contains the Root (of AST) and the file name. If you want just the AST, parseFileForAST would do it.

Pretty print the produced tree:

putStrLn $ prettyPrint tree

So to round it up, if you want to parse and pretty print the parsed AST of a Pig file (using Control.Applicative (<$>))

prettyPrint <$> parseFileForAST "example.pig" >>= putStrLn