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

Versions0.1.0.0, 0.2.0.0, 0.2.0.1, 0.2.0.2, 0.3.0.0, 0.3.0.1
Change logNone available
Dependenciesbase (==4.6.*), Cabal (>=1.16.0), containers, parsec (>=3.1.3), pretty-tree [details]
LicenseMIT
AuthorElise Huard
Maintainerelise@jabberwocky.eu
StabilityExperimental
CategoryLanguage
Source repositoryhead: git clone https://github.com/elisehuard/language-pig
UploadedFri Nov 8 13:31:58 UTC 2013 by elisehuard
DistributionsNixOS:0.3.0.1
Downloads895 total (39 in last 30 days)
Votes
0 []
StatusDocs available [build log]
Successful builds reported [all 1 reports]

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for language-pig-0.2.0.2

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.

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 <$> parseFile "example.pig" >>= putStrLn