-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Parser for JavaScript
--   
--   Parses Javascript into an Abstract Syntax Tree (AST). Initially
--   intended as frontend to hjsmin.
--   
--   Note: Version 0.5.0 breaks compatibility with prior versions, the AST
--   has been reworked to allow round trip processing of JavaScript.
@package language-javascript
@version 0.6.0.10

module Language.JavaScript.Parser.SrcLocation

-- | <a>TokenPosn</a> records the location of a token in the input text. It
--   has three fields: the address (number of characters preceding the
--   token), line number and column of a token within the file. Note: The
--   lexer assumes the usual eight character tab stops.
data TokenPosn
TokenPn :: !Int -> !Int -> !Int -> TokenPosn
tokenPosnEmpty :: TokenPosn
instance Data.Data.Data Language.JavaScript.Parser.SrcLocation.TokenPosn
instance GHC.Read.Read Language.JavaScript.Parser.SrcLocation.TokenPosn
instance GHC.Show.Show Language.JavaScript.Parser.SrcLocation.TokenPosn
instance GHC.Classes.Eq Language.JavaScript.Parser.SrcLocation.TokenPosn

module Language.JavaScript.Parser.Lexer

-- | Lexical tokens. Each may be annotated with any comment occuring
--   between the prior token and this one
data Token

-- | Single line comment.
CommentToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]

-- | White space, for preservation.
WsToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]

-- | Identifier.
IdentifierToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]

-- | Literal: Decimal
DecimalToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]

-- | Literal: Hexadecimal Integer
HexIntegerToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]

-- | Literal: Octal Integer
OctalToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]

-- | Literal: string, delimited by either single or double quotes
StringToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]

-- | Literal: Regular Expression
RegExToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
BreakToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
CaseToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
CatchToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
ConstToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
ContinueToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
DebuggerToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
DefaultToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
DeleteToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
DoToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
ElseToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
EnumToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
FalseToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
FinallyToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
ForToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
FunctionToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
IfToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
InToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
InstanceofToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
NewToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
NullToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
ReturnToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
SwitchToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
ThisToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
ThrowToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
TrueToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
TryToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
TypeofToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
VarToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
VoidToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
WhileToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
WithToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
FutureToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
GetToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
SetToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
AutoSemiToken :: !TokenPosn -> !String -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenLiteral] :: Token -> !String
[tokenComment] :: Token -> ![CommentAnnotation]
SemiColonToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
CommaToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
HookToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
ColonToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
OrToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
AndToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
BitwiseOrToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
BitwiseXorToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
BitwiseAndToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
StrictEqToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
EqToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
TimesAssignToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
DivideAssignToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
ModAssignToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
PlusAssignToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
MinusAssignToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
LshAssignToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
RshAssignToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
UrshAssignToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
AndAssignToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
XorAssignToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
OrAssignToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
SimpleAssignToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
StrictNeToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
NeToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
LshToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
LeToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
LtToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
UrshToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
RshToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
GeToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
GtToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
IncrementToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
DecrementToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
PlusToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
MinusToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
MulToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
DivToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
ModToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
NotToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
BitwiseNotToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
DotToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
LeftBracketToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
RightBracketToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
LeftCurlyToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
RightCurlyToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
LeftParenToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
RightParenToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
CondcommentEndToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]

-- | Stuff between last JS and EOF
TailToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]

-- | End of file
EOFToken :: !TokenPosn -> ![CommentAnnotation] -> Token
[tokenSpan] :: Token -> !TokenPosn
[tokenComment] :: Token -> ![CommentAnnotation]
data Alex a
lexCont :: (Token -> Alex a) -> Alex a
alexError :: String -> Alex a
runAlex :: String -> Alex a -> Either String a
alexTestTokeniser :: String -> Either String [Token]
instance GHC.Show.Show Language.JavaScript.Parser.Lexer.AlexPosn
instance GHC.Classes.Eq Language.JavaScript.Parser.Lexer.AlexPosn
instance GHC.Base.Functor Language.JavaScript.Parser.Lexer.Alex
instance GHC.Base.Applicative Language.JavaScript.Parser.Lexer.Alex
instance GHC.Base.Monad Language.JavaScript.Parser.Lexer.Alex

module Language.JavaScript.Parser.AST
data JSExpression

-- | Terminals
JSIdentifier :: !JSAnnot -> !String -> JSExpression
JSDecimal :: !JSAnnot -> !String -> JSExpression
JSLiteral :: !JSAnnot -> !String -> JSExpression
JSHexInteger :: !JSAnnot -> !String -> JSExpression
JSOctal :: !JSAnnot -> !String -> JSExpression
JSStringLiteral :: !JSAnnot -> !String -> JSExpression
JSRegEx :: !JSAnnot -> !String -> JSExpression

-- | lb, contents, rb
JSArrayLiteral :: !JSAnnot -> ![JSArrayElement] -> !JSAnnot -> JSExpression

-- | lhs, assignop, rhs
JSAssignExpression :: !JSExpression -> !JSAssignOp -> !JSExpression -> JSExpression

-- | expr, bl, args, rb
JSCallExpression :: !JSExpression -> !JSAnnot -> !(JSCommaList JSExpression) -> !JSAnnot -> JSExpression

-- | expr, dot, expr
JSCallExpressionDot :: !JSExpression -> !JSAnnot -> !JSExpression -> JSExpression

-- | expr, [, expr, ]
JSCallExpressionSquare :: !JSExpression -> !JSAnnot -> !JSExpression -> !JSAnnot -> JSExpression

-- | expression components
JSCommaExpression :: !JSExpression -> !JSAnnot -> !JSExpression -> JSExpression

-- | lhs, op, rhs
JSExpressionBinary :: !JSExpression -> !JSBinOp -> !JSExpression -> JSExpression

-- | lb,expression,rb
JSExpressionParen :: !JSAnnot -> !JSExpression -> !JSAnnot -> JSExpression

-- | expression, operator
JSExpressionPostfix :: !JSExpression -> !JSUnaryOp -> JSExpression

-- | cond, ?, trueval, :, falseval
JSExpressionTernary :: !JSExpression -> !JSAnnot -> !JSExpression -> !JSAnnot -> !JSExpression -> JSExpression

-- | fn,name,lb, parameter list,rb,block`
JSFunctionExpression :: !JSAnnot -> !JSIdent -> !JSAnnot -> !(JSCommaList JSIdent) -> !JSAnnot -> !JSBlock -> JSExpression

-- | firstpart, dot, name
JSMemberDot :: !JSExpression -> !JSAnnot -> !JSExpression -> JSExpression
JSMemberExpression :: !JSExpression -> !JSAnnot -> !(JSCommaList JSExpression) -> !JSAnnot -> JSExpression

-- | new, name, lb, args, rb
JSMemberNew :: !JSAnnot -> !JSExpression -> !JSAnnot -> !(JSCommaList JSExpression) -> !JSAnnot -> JSExpression

-- | firstpart, lb, expr, rb
JSMemberSquare :: !JSExpression -> !JSAnnot -> !JSExpression -> !JSAnnot -> JSExpression

-- | new, expr
JSNewExpression :: !JSAnnot -> !JSExpression -> JSExpression

-- | lbrace contents rbrace
JSObjectLiteral :: !JSAnnot -> !JSObjectPropertyList -> !JSAnnot -> JSExpression
JSUnaryExpression :: !JSUnaryOp -> !JSExpression -> JSExpression

-- | identifier, initializer
JSVarInitExpression :: !JSExpression -> !JSVarInitializer -> JSExpression
data JSAnnot

-- | Annotation: position and comment/whitespace information
JSAnnot :: !TokenPosn -> ![CommentAnnotation] -> JSAnnot

-- | A single space character
JSAnnotSpace :: JSAnnot

-- | No annotation
JSNoAnnot :: JSAnnot
data JSBinOp
JSBinOpAnd :: !JSAnnot -> JSBinOp
JSBinOpBitAnd :: !JSAnnot -> JSBinOp
JSBinOpBitOr :: !JSAnnot -> JSBinOp
JSBinOpBitXor :: !JSAnnot -> JSBinOp
JSBinOpDivide :: !JSAnnot -> JSBinOp
JSBinOpEq :: !JSAnnot -> JSBinOp
JSBinOpGe :: !JSAnnot -> JSBinOp
JSBinOpGt :: !JSAnnot -> JSBinOp
JSBinOpIn :: !JSAnnot -> JSBinOp
JSBinOpInstanceOf :: !JSAnnot -> JSBinOp
JSBinOpLe :: !JSAnnot -> JSBinOp
JSBinOpLsh :: !JSAnnot -> JSBinOp
JSBinOpLt :: !JSAnnot -> JSBinOp
JSBinOpMinus :: !JSAnnot -> JSBinOp
JSBinOpMod :: !JSAnnot -> JSBinOp
JSBinOpNeq :: !JSAnnot -> JSBinOp
JSBinOpOr :: !JSAnnot -> JSBinOp
JSBinOpPlus :: !JSAnnot -> JSBinOp
JSBinOpRsh :: !JSAnnot -> JSBinOp
JSBinOpStrictEq :: !JSAnnot -> JSBinOp
JSBinOpStrictNeq :: !JSAnnot -> JSBinOp
JSBinOpTimes :: !JSAnnot -> JSBinOp
JSBinOpUrsh :: !JSAnnot -> JSBinOp
data JSUnaryOp
JSUnaryOpDecr :: !JSAnnot -> JSUnaryOp
JSUnaryOpDelete :: !JSAnnot -> JSUnaryOp
JSUnaryOpIncr :: !JSAnnot -> JSUnaryOp
JSUnaryOpMinus :: !JSAnnot -> JSUnaryOp
JSUnaryOpNot :: !JSAnnot -> JSUnaryOp
JSUnaryOpPlus :: !JSAnnot -> JSUnaryOp
JSUnaryOpTilde :: !JSAnnot -> JSUnaryOp
JSUnaryOpTypeof :: !JSAnnot -> JSUnaryOp
JSUnaryOpVoid :: !JSAnnot -> JSUnaryOp
data JSSemi
JSSemi :: !JSAnnot -> JSSemi
JSSemiAuto :: JSSemi
data JSAssignOp
JSAssign :: !JSAnnot -> JSAssignOp
JSTimesAssign :: !JSAnnot -> JSAssignOp
JSDivideAssign :: !JSAnnot -> JSAssignOp
JSModAssign :: !JSAnnot -> JSAssignOp
JSPlusAssign :: !JSAnnot -> JSAssignOp
JSMinusAssign :: !JSAnnot -> JSAssignOp
JSLshAssign :: !JSAnnot -> JSAssignOp
JSRshAssign :: !JSAnnot -> JSAssignOp
JSUrshAssign :: !JSAnnot -> JSAssignOp
JSBwAndAssign :: !JSAnnot -> JSAssignOp
JSBwXorAssign :: !JSAnnot -> JSAssignOp
JSBwOrAssign :: !JSAnnot -> JSAssignOp
data JSTryCatch

-- | catch,lb,ident,rb,block
JSCatch :: !JSAnnot -> !JSAnnot -> !JSExpression -> !JSAnnot -> !JSBlock -> JSTryCatch

-- | catch,lb,ident,if,expr,rb,block
JSCatchIf :: !JSAnnot -> !JSAnnot -> !JSExpression -> !JSAnnot -> !JSExpression -> !JSAnnot -> !JSBlock -> JSTryCatch
data JSTryFinally

-- | finally,block
JSFinally :: !JSAnnot -> !JSBlock -> JSTryFinally
JSNoFinally :: JSTryFinally
data JSStatement

-- | lbrace, stmts, rbrace, autosemi
JSStatementBlock :: !JSAnnot -> ![JSStatement] -> !JSAnnot -> !JSSemi -> JSStatement

-- | break,optional identifier, autosemi
JSBreak :: !JSAnnot -> !JSIdent -> !JSSemi -> JSStatement

-- | const, decl, autosemi
JSConstant :: !JSAnnot -> !(JSCommaList JSExpression) -> !JSSemi -> JSStatement

-- | continue, optional identifier,autosemi
JSContinue :: !JSAnnot -> !JSIdent -> !JSSemi -> JSStatement

-- | do,stmt,while,lb,expr,rb,autosemi
JSDoWhile :: !JSAnnot -> !JSStatement -> !JSAnnot -> !JSAnnot -> !JSExpression -> !JSAnnot -> !JSSemi -> JSStatement

-- | for,lb,expr,semi,expr,semi,expr,rb.stmt
JSFor :: !JSAnnot -> !JSAnnot -> !(JSCommaList JSExpression) -> !JSAnnot -> !(JSCommaList JSExpression) -> !JSAnnot -> !(JSCommaList JSExpression) -> !JSAnnot -> !JSStatement -> JSStatement

-- | for,lb,expr,in,expr,rb,stmt
JSForIn :: !JSAnnot -> !JSAnnot -> !JSExpression -> !JSBinOp -> !JSExpression -> !JSAnnot -> !JSStatement -> JSStatement

-- | for,lb,var,vardecl,semi,expr,semi,expr,rb,stmt
JSForVar :: !JSAnnot -> !JSAnnot -> !JSAnnot -> !(JSCommaList JSExpression) -> !JSAnnot -> !(JSCommaList JSExpression) -> !JSAnnot -> !(JSCommaList JSExpression) -> !JSAnnot -> !JSStatement -> JSStatement

-- | for,lb,var,vardecl,in,expr,rb,stmt
JSForVarIn :: !JSAnnot -> !JSAnnot -> !JSAnnot -> !JSExpression -> !JSBinOp -> !JSExpression -> !JSAnnot -> !JSStatement -> JSStatement

-- | fn,name, lb,parameter list,rb,block,autosemi
JSFunction :: !JSAnnot -> !JSIdent -> !JSAnnot -> !(JSCommaList JSIdent) -> !JSAnnot -> !JSBlock -> !JSSemi -> JSStatement

-- | if,(,expr,),stmt
JSIf :: !JSAnnot -> !JSAnnot -> !JSExpression -> !JSAnnot -> !JSStatement -> JSStatement

-- | if,(,expr,),stmt,else,rest
JSIfElse :: !JSAnnot -> !JSAnnot -> !JSExpression -> !JSAnnot -> !JSStatement -> !JSAnnot -> !JSStatement -> JSStatement

-- | identifier,colon,stmt
JSLabelled :: !JSIdent -> !JSAnnot -> !JSStatement -> JSStatement
JSEmptyStatement :: !JSAnnot -> JSStatement
JSExpressionStatement :: !JSExpression -> !JSSemi -> JSStatement

-- | lhs, assignop, rhs, autosemi
JSAssignStatement :: !JSExpression -> !JSAssignOp -> !JSExpression -> !JSSemi -> JSStatement
JSMethodCall :: !JSExpression -> !JSAnnot -> !(JSCommaList JSExpression) -> !JSAnnot -> !JSSemi -> JSStatement

-- | optional expression,autosemi
JSReturn :: !JSAnnot -> !(Maybe JSExpression) -> !JSSemi -> JSStatement

-- | switch,lb,expr,rb,caseblock,autosemi
JSSwitch :: !JSAnnot -> !JSAnnot -> !JSExpression -> !JSAnnot -> !JSAnnot -> ![JSSwitchParts] -> !JSAnnot -> !JSSemi -> JSStatement

-- | throw val autosemi
JSThrow :: !JSAnnot -> !JSExpression -> !JSSemi -> JSStatement

-- | try,block,catches,finally
JSTry :: !JSAnnot -> !JSBlock -> ![JSTryCatch] -> !JSTryFinally -> JSStatement

-- | var|const, decl, autosemi
JSVariable :: !JSAnnot -> !(JSCommaList JSExpression) -> !JSSemi -> JSStatement

-- | while,lb,expr,rb,stmt
JSWhile :: !JSAnnot -> !JSAnnot -> !JSExpression -> !JSAnnot -> !JSStatement -> JSStatement

-- | with,lb,expr,rb,stmt list
JSWith :: !JSAnnot -> !JSAnnot -> !JSExpression -> !JSAnnot -> !JSStatement -> !JSSemi -> JSStatement
data JSBlock

-- | lbrace, stmts, rbrace
JSBlock :: !JSAnnot -> ![JSStatement] -> !JSAnnot -> JSBlock
data JSSwitchParts

-- | expr,colon,stmtlist
JSCase :: !JSAnnot -> !JSExpression -> !JSAnnot -> ![JSStatement] -> JSSwitchParts

-- | colon,stmtlist
JSDefault :: !JSAnnot -> !JSAnnot -> ![JSStatement] -> JSSwitchParts
data JSAST

-- | source elements, tailing whitespace
JSAstProgram :: ![JSStatement] -> !JSAnnot -> JSAST
JSAstStatement :: !JSStatement -> !JSAnnot -> JSAST
JSAstExpression :: !JSExpression -> !JSAnnot -> JSAST
JSAstLiteral :: !JSExpression -> !JSAnnot -> JSAST
data JSObjectProperty

-- | (get|set), name, lb, params, rb, block
JSPropertyAccessor :: !JSAccessor -> !JSPropertyName -> !JSAnnot -> ![JSExpression] -> !JSAnnot -> !JSBlock -> JSObjectProperty

-- | name, colon, value
JSPropertyNameandValue :: !JSPropertyName -> !JSAnnot -> ![JSExpression] -> JSObjectProperty
data JSPropertyName
JSPropertyIdent :: !JSAnnot -> !String -> JSPropertyName
JSPropertyString :: !JSAnnot -> !String -> JSPropertyName
JSPropertyNumber :: !JSAnnot -> !String -> JSPropertyName
type JSObjectPropertyList = JSCommaTrailingList JSObjectProperty

-- | Accessors for JSObjectProperty is either <tt>get</tt> or <tt>set</tt>.
data JSAccessor
JSAccessorGet :: !JSAnnot -> JSAccessor
JSAccessorSet :: !JSAnnot -> JSAccessor
data JSIdent
JSIdentName :: !JSAnnot -> !String -> JSIdent
JSIdentNone :: JSIdent
data JSVarInitializer

-- | assignop, initializer
JSVarInit :: !JSAnnot -> !JSExpression -> JSVarInitializer
JSVarInitNone :: JSVarInitializer
data JSArrayElement
JSArrayElement :: !JSExpression -> JSArrayElement
JSArrayComma :: !JSAnnot -> JSArrayElement
data JSCommaList a

-- | head, comma, a
JSLCons :: !(JSCommaList a) -> !JSAnnot -> !a -> JSCommaList a

-- | single element (no comma)
JSLOne :: !a -> JSCommaList a
JSLNil :: JSCommaList a
data JSCommaTrailingList a

-- | list, trailing comma
JSCTLComma :: !(JSCommaList a) -> !JSAnnot -> JSCommaTrailingList a

-- | list
JSCTLNone :: !(JSCommaList a) -> JSCommaTrailingList a
binOpEq :: JSBinOp -> JSBinOp -> Bool

-- | Show the AST elements stipped of their JSAnnot data.
showStripped :: JSAST -> String
instance GHC.Show.Show Language.JavaScript.Parser.AST.JSAST
instance GHC.Classes.Eq Language.JavaScript.Parser.AST.JSAST
instance Data.Data.Data Language.JavaScript.Parser.AST.JSAST
instance GHC.Show.Show Language.JavaScript.Parser.AST.JSTryCatch
instance GHC.Classes.Eq Language.JavaScript.Parser.AST.JSTryCatch
instance Data.Data.Data Language.JavaScript.Parser.AST.JSTryCatch
instance GHC.Show.Show Language.JavaScript.Parser.AST.JSTryFinally
instance GHC.Classes.Eq Language.JavaScript.Parser.AST.JSTryFinally
instance Data.Data.Data Language.JavaScript.Parser.AST.JSTryFinally
instance GHC.Show.Show Language.JavaScript.Parser.AST.JSVarInitializer
instance GHC.Classes.Eq Language.JavaScript.Parser.AST.JSVarInitializer
instance Data.Data.Data Language.JavaScript.Parser.AST.JSVarInitializer
instance GHC.Show.Show Language.JavaScript.Parser.AST.JSArrayElement
instance GHC.Classes.Eq Language.JavaScript.Parser.AST.JSArrayElement
instance Data.Data.Data Language.JavaScript.Parser.AST.JSArrayElement
instance GHC.Show.Show Language.JavaScript.Parser.AST.JSExpression
instance GHC.Classes.Eq Language.JavaScript.Parser.AST.JSExpression
instance Data.Data.Data Language.JavaScript.Parser.AST.JSExpression
instance GHC.Show.Show Language.JavaScript.Parser.AST.JSSwitchParts
instance GHC.Classes.Eq Language.JavaScript.Parser.AST.JSSwitchParts
instance Data.Data.Data Language.JavaScript.Parser.AST.JSSwitchParts
instance GHC.Show.Show Language.JavaScript.Parser.AST.JSStatement
instance GHC.Classes.Eq Language.JavaScript.Parser.AST.JSStatement
instance Data.Data.Data Language.JavaScript.Parser.AST.JSStatement
instance GHC.Show.Show Language.JavaScript.Parser.AST.JSBlock
instance GHC.Classes.Eq Language.JavaScript.Parser.AST.JSBlock
instance Data.Data.Data Language.JavaScript.Parser.AST.JSBlock
instance GHC.Show.Show Language.JavaScript.Parser.AST.JSObjectProperty
instance GHC.Classes.Eq Language.JavaScript.Parser.AST.JSObjectProperty
instance Data.Data.Data Language.JavaScript.Parser.AST.JSObjectProperty
instance GHC.Show.Show a => GHC.Show.Show (Language.JavaScript.Parser.AST.JSCommaTrailingList a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.JavaScript.Parser.AST.JSCommaTrailingList a)
instance Data.Data.Data a => Data.Data.Data (Language.JavaScript.Parser.AST.JSCommaTrailingList a)
instance GHC.Show.Show a => GHC.Show.Show (Language.JavaScript.Parser.AST.JSCommaList a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.JavaScript.Parser.AST.JSCommaList a)
instance Data.Data.Data a => Data.Data.Data (Language.JavaScript.Parser.AST.JSCommaList a)
instance GHC.Show.Show Language.JavaScript.Parser.AST.JSIdent
instance GHC.Classes.Eq Language.JavaScript.Parser.AST.JSIdent
instance Data.Data.Data Language.JavaScript.Parser.AST.JSIdent
instance GHC.Show.Show Language.JavaScript.Parser.AST.JSAccessor
instance GHC.Classes.Eq Language.JavaScript.Parser.AST.JSAccessor
instance Data.Data.Data Language.JavaScript.Parser.AST.JSAccessor
instance GHC.Show.Show Language.JavaScript.Parser.AST.JSPropertyName
instance GHC.Classes.Eq Language.JavaScript.Parser.AST.JSPropertyName
instance Data.Data.Data Language.JavaScript.Parser.AST.JSPropertyName
instance GHC.Show.Show Language.JavaScript.Parser.AST.JSAssignOp
instance GHC.Classes.Eq Language.JavaScript.Parser.AST.JSAssignOp
instance Data.Data.Data Language.JavaScript.Parser.AST.JSAssignOp
instance GHC.Show.Show Language.JavaScript.Parser.AST.JSSemi
instance GHC.Classes.Eq Language.JavaScript.Parser.AST.JSSemi
instance Data.Data.Data Language.JavaScript.Parser.AST.JSSemi
instance GHC.Show.Show Language.JavaScript.Parser.AST.JSUnaryOp
instance GHC.Classes.Eq Language.JavaScript.Parser.AST.JSUnaryOp
instance Data.Data.Data Language.JavaScript.Parser.AST.JSUnaryOp
instance GHC.Show.Show Language.JavaScript.Parser.AST.JSBinOp
instance GHC.Classes.Eq Language.JavaScript.Parser.AST.JSBinOp
instance Data.Data.Data Language.JavaScript.Parser.AST.JSBinOp
instance GHC.Show.Show Language.JavaScript.Parser.AST.JSAnnot
instance GHC.Classes.Eq Language.JavaScript.Parser.AST.JSAnnot
instance Data.Data.Data Language.JavaScript.Parser.AST.JSAnnot
instance Language.JavaScript.Parser.AST.ShowStripped Language.JavaScript.Parser.AST.JSStatement
instance Language.JavaScript.Parser.AST.ShowStripped Language.JavaScript.Parser.AST.JSExpression
instance Language.JavaScript.Parser.AST.ShowStripped Language.JavaScript.Parser.AST.JSTryCatch
instance Language.JavaScript.Parser.AST.ShowStripped Language.JavaScript.Parser.AST.JSTryFinally
instance Language.JavaScript.Parser.AST.ShowStripped Language.JavaScript.Parser.AST.JSIdent
instance Language.JavaScript.Parser.AST.ShowStripped Language.JavaScript.Parser.AST.JSObjectProperty
instance Language.JavaScript.Parser.AST.ShowStripped Language.JavaScript.Parser.AST.JSPropertyName
instance Language.JavaScript.Parser.AST.ShowStripped Language.JavaScript.Parser.AST.JSAccessor
instance Language.JavaScript.Parser.AST.ShowStripped Language.JavaScript.Parser.AST.JSBlock
instance Language.JavaScript.Parser.AST.ShowStripped Language.JavaScript.Parser.AST.JSSwitchParts
instance Language.JavaScript.Parser.AST.ShowStripped Language.JavaScript.Parser.AST.JSBinOp
instance Language.JavaScript.Parser.AST.ShowStripped Language.JavaScript.Parser.AST.JSUnaryOp
instance Language.JavaScript.Parser.AST.ShowStripped Language.JavaScript.Parser.AST.JSAssignOp
instance Language.JavaScript.Parser.AST.ShowStripped Language.JavaScript.Parser.AST.JSVarInitializer
instance Language.JavaScript.Parser.AST.ShowStripped Language.JavaScript.Parser.AST.JSSemi
instance Language.JavaScript.Parser.AST.ShowStripped Language.JavaScript.Parser.AST.JSArrayElement
instance Language.JavaScript.Parser.AST.ShowStripped a => Language.JavaScript.Parser.AST.ShowStripped (Language.JavaScript.Parser.AST.JSCommaList a)
instance Language.JavaScript.Parser.AST.ShowStripped a => Language.JavaScript.Parser.AST.ShowStripped (Language.JavaScript.Parser.AST.JSCommaTrailingList a)
instance Language.JavaScript.Parser.AST.ShowStripped a => Language.JavaScript.Parser.AST.ShowStripped [a]

module Language.JavaScript.Pretty.Printer
renderJS :: JSAST -> Builder
renderToString :: JSAST -> String
renderToText :: JSAST -> Text
instance Language.JavaScript.Pretty.Printer.RenderJS Language.JavaScript.Parser.AST.JSAST
instance Language.JavaScript.Pretty.Printer.RenderJS Language.JavaScript.Parser.AST.JSExpression
instance Language.JavaScript.Pretty.Printer.RenderJS Language.JavaScript.Parser.AST.JSAnnot
instance Language.JavaScript.Pretty.Printer.RenderJS GHC.Base.String
instance Language.JavaScript.Pretty.Printer.RenderJS Language.JavaScript.Parser.SrcLocation.TokenPosn
instance Language.JavaScript.Pretty.Printer.RenderJS [Language.JavaScript.Parser.Token.CommentAnnotation]
instance Language.JavaScript.Pretty.Printer.RenderJS Language.JavaScript.Parser.Token.CommentAnnotation
instance Language.JavaScript.Pretty.Printer.RenderJS [Language.JavaScript.Parser.AST.JSExpression]
instance Language.JavaScript.Pretty.Printer.RenderJS Language.JavaScript.Parser.AST.JSBinOp
instance Language.JavaScript.Pretty.Printer.RenderJS Language.JavaScript.Parser.AST.JSUnaryOp
instance Language.JavaScript.Pretty.Printer.RenderJS Language.JavaScript.Parser.AST.JSAssignOp
instance Language.JavaScript.Pretty.Printer.RenderJS Language.JavaScript.Parser.AST.JSSemi
instance Language.JavaScript.Pretty.Printer.RenderJS Language.JavaScript.Parser.AST.JSTryCatch
instance Language.JavaScript.Pretty.Printer.RenderJS [Language.JavaScript.Parser.AST.JSTryCatch]
instance Language.JavaScript.Pretty.Printer.RenderJS Language.JavaScript.Parser.AST.JSTryFinally
instance Language.JavaScript.Pretty.Printer.RenderJS Language.JavaScript.Parser.AST.JSSwitchParts
instance Language.JavaScript.Pretty.Printer.RenderJS [Language.JavaScript.Parser.AST.JSSwitchParts]
instance Language.JavaScript.Pretty.Printer.RenderJS Language.JavaScript.Parser.AST.JSStatement
instance Language.JavaScript.Pretty.Printer.RenderJS [Language.JavaScript.Parser.AST.JSStatement]
instance Language.JavaScript.Pretty.Printer.RenderJS Language.JavaScript.Parser.AST.JSBlock
instance Language.JavaScript.Pretty.Printer.RenderJS Language.JavaScript.Parser.AST.JSObjectProperty
instance Language.JavaScript.Pretty.Printer.RenderJS Language.JavaScript.Parser.AST.JSPropertyName
instance Language.JavaScript.Pretty.Printer.RenderJS Language.JavaScript.Parser.AST.JSAccessor
instance Language.JavaScript.Pretty.Printer.RenderJS Language.JavaScript.Parser.AST.JSArrayElement
instance Language.JavaScript.Pretty.Printer.RenderJS [Language.JavaScript.Parser.AST.JSArrayElement]
instance Language.JavaScript.Pretty.Printer.RenderJS a => Language.JavaScript.Pretty.Printer.RenderJS (Language.JavaScript.Parser.AST.JSCommaList a)
instance Language.JavaScript.Pretty.Printer.RenderJS a => Language.JavaScript.Pretty.Printer.RenderJS (Language.JavaScript.Parser.AST.JSCommaTrailingList a)
instance Language.JavaScript.Pretty.Printer.RenderJS Language.JavaScript.Parser.AST.JSIdent
instance Language.JavaScript.Pretty.Printer.RenderJS (GHC.Base.Maybe Language.JavaScript.Parser.AST.JSExpression)
instance Language.JavaScript.Pretty.Printer.RenderJS Language.JavaScript.Parser.AST.JSVarInitializer

module Language.JavaScript.Parser.Grammar5
parseProgram :: Alex JSAST
parseStatement :: Alex JSAST
parseExpression :: Alex JSAST
parseLiteral :: Alex JSAST

module Language.JavaScript.Parser.Parser

-- | Parse one compound statement, or a sequence of simple statements.
--   Generally used for interactive input, such as from the command line of
--   an interpreter. Return comments in addition to the parsed statements.
parse :: String -> String -> Either String JSAST
readJs :: String -> JSAST

-- | Parse the given file. For UTF-8 support, make sure your locale is set
--   such that "System.IO.localeEncoding" returns "utf8"
parseFile :: FilePath -> IO JSAST

-- | Parse the given file, explicitly setting the encoding to UTF8 when
--   reading it
parseFileUtf8 :: FilePath -> IO JSAST

-- | Parse one compound statement, or a sequence of simple statements.
--   Generally used for interactive input, such as from the command line of
--   an interpreter. Return comments in addition to the parsed statements.
parseUsing :: Alex JSAST -> String -> String -> Either String JSAST
showStripped :: JSAST -> String
showStrippedMaybe :: Show a => Either a JSAST -> String

module Language.JavaScript.Process.Minify
minifyJS :: JSAST -> JSAST
instance Language.JavaScript.Process.Minify.MinifyJS Language.JavaScript.Parser.AST.JSExpression
instance Language.JavaScript.Process.Minify.MinifyJS Language.JavaScript.Parser.AST.JSBinOp
instance Language.JavaScript.Process.Minify.MinifyJS Language.JavaScript.Parser.AST.JSUnaryOp
instance Language.JavaScript.Process.Minify.MinifyJS Language.JavaScript.Parser.AST.JSAssignOp
instance Language.JavaScript.Process.Minify.MinifyJS Language.JavaScript.Parser.AST.JSTryCatch
instance Language.JavaScript.Process.Minify.MinifyJS Language.JavaScript.Parser.AST.JSTryFinally
instance Language.JavaScript.Process.Minify.MinifyJS Language.JavaScript.Parser.AST.JSBlock
instance Language.JavaScript.Process.Minify.MinifyJS Language.JavaScript.Parser.AST.JSObjectProperty
instance Language.JavaScript.Process.Minify.MinifyJS Language.JavaScript.Parser.AST.JSPropertyName
instance Language.JavaScript.Process.Minify.MinifyJS Language.JavaScript.Parser.AST.JSAccessor
instance Language.JavaScript.Process.Minify.MinifyJS Language.JavaScript.Parser.AST.JSArrayElement
instance Language.JavaScript.Process.Minify.MinifyJS a => Language.JavaScript.Process.Minify.MinifyJS (Language.JavaScript.Parser.AST.JSCommaList a)
instance Language.JavaScript.Process.Minify.MinifyJS a => Language.JavaScript.Process.Minify.MinifyJS (Language.JavaScript.Parser.AST.JSCommaTrailingList a)
instance Language.JavaScript.Process.Minify.MinifyJS Language.JavaScript.Parser.AST.JSIdent
instance Language.JavaScript.Process.Minify.MinifyJS (GHC.Base.Maybe Language.JavaScript.Parser.AST.JSExpression)
instance Language.JavaScript.Process.Minify.MinifyJS Language.JavaScript.Parser.AST.JSVarInitializer

module Language.JavaScript.Parser

-- | Parse one compound statement, or a sequence of simple statements.
--   Generally used for interactive input, such as from the command line of
--   an interpreter. Return comments in addition to the parsed statements.
parse :: String -> String -> Either String JSAST
readJs :: String -> JSAST

-- | Parse the given file. For UTF-8 support, make sure your locale is set
--   such that "System.IO.localeEncoding" returns "utf8"
parseFile :: FilePath -> IO JSAST

-- | Parse the given file, explicitly setting the encoding to UTF8 when
--   reading it
parseFileUtf8 :: FilePath -> IO JSAST
showStripped :: JSAST -> String
showStrippedMaybe :: Show a => Either a JSAST -> String
data JSExpression

-- | Terminals
JSIdentifier :: !JSAnnot -> !String -> JSExpression
JSDecimal :: !JSAnnot -> !String -> JSExpression
JSLiteral :: !JSAnnot -> !String -> JSExpression
JSHexInteger :: !JSAnnot -> !String -> JSExpression
JSOctal :: !JSAnnot -> !String -> JSExpression
JSStringLiteral :: !JSAnnot -> !String -> JSExpression
JSRegEx :: !JSAnnot -> !String -> JSExpression

-- | lb, contents, rb
JSArrayLiteral :: !JSAnnot -> ![JSArrayElement] -> !JSAnnot -> JSExpression

-- | lhs, assignop, rhs
JSAssignExpression :: !JSExpression -> !JSAssignOp -> !JSExpression -> JSExpression

-- | expr, bl, args, rb
JSCallExpression :: !JSExpression -> !JSAnnot -> !(JSCommaList JSExpression) -> !JSAnnot -> JSExpression

-- | expr, dot, expr
JSCallExpressionDot :: !JSExpression -> !JSAnnot -> !JSExpression -> JSExpression

-- | expr, [, expr, ]
JSCallExpressionSquare :: !JSExpression -> !JSAnnot -> !JSExpression -> !JSAnnot -> JSExpression

-- | expression components
JSCommaExpression :: !JSExpression -> !JSAnnot -> !JSExpression -> JSExpression

-- | lhs, op, rhs
JSExpressionBinary :: !JSExpression -> !JSBinOp -> !JSExpression -> JSExpression

-- | lb,expression,rb
JSExpressionParen :: !JSAnnot -> !JSExpression -> !JSAnnot -> JSExpression

-- | expression, operator
JSExpressionPostfix :: !JSExpression -> !JSUnaryOp -> JSExpression

-- | cond, ?, trueval, :, falseval
JSExpressionTernary :: !JSExpression -> !JSAnnot -> !JSExpression -> !JSAnnot -> !JSExpression -> JSExpression

-- | fn,name,lb, parameter list,rb,block`
JSFunctionExpression :: !JSAnnot -> !JSIdent -> !JSAnnot -> !(JSCommaList JSIdent) -> !JSAnnot -> !JSBlock -> JSExpression

-- | firstpart, dot, name
JSMemberDot :: !JSExpression -> !JSAnnot -> !JSExpression -> JSExpression
JSMemberExpression :: !JSExpression -> !JSAnnot -> !(JSCommaList JSExpression) -> !JSAnnot -> JSExpression

-- | new, name, lb, args, rb
JSMemberNew :: !JSAnnot -> !JSExpression -> !JSAnnot -> !(JSCommaList JSExpression) -> !JSAnnot -> JSExpression

-- | firstpart, lb, expr, rb
JSMemberSquare :: !JSExpression -> !JSAnnot -> !JSExpression -> !JSAnnot -> JSExpression

-- | new, expr
JSNewExpression :: !JSAnnot -> !JSExpression -> JSExpression

-- | lbrace contents rbrace
JSObjectLiteral :: !JSAnnot -> !JSObjectPropertyList -> !JSAnnot -> JSExpression
JSUnaryExpression :: !JSUnaryOp -> !JSExpression -> JSExpression

-- | identifier, initializer
JSVarInitExpression :: !JSExpression -> !JSVarInitializer -> JSExpression
data JSAnnot

-- | Annotation: position and comment/whitespace information
JSAnnot :: !TokenPosn -> ![CommentAnnotation] -> JSAnnot

-- | A single space character
JSAnnotSpace :: JSAnnot

-- | No annotation
JSNoAnnot :: JSAnnot
data JSBinOp
JSBinOpAnd :: !JSAnnot -> JSBinOp
JSBinOpBitAnd :: !JSAnnot -> JSBinOp
JSBinOpBitOr :: !JSAnnot -> JSBinOp
JSBinOpBitXor :: !JSAnnot -> JSBinOp
JSBinOpDivide :: !JSAnnot -> JSBinOp
JSBinOpEq :: !JSAnnot -> JSBinOp
JSBinOpGe :: !JSAnnot -> JSBinOp
JSBinOpGt :: !JSAnnot -> JSBinOp
JSBinOpIn :: !JSAnnot -> JSBinOp
JSBinOpInstanceOf :: !JSAnnot -> JSBinOp
JSBinOpLe :: !JSAnnot -> JSBinOp
JSBinOpLsh :: !JSAnnot -> JSBinOp
JSBinOpLt :: !JSAnnot -> JSBinOp
JSBinOpMinus :: !JSAnnot -> JSBinOp
JSBinOpMod :: !JSAnnot -> JSBinOp
JSBinOpNeq :: !JSAnnot -> JSBinOp
JSBinOpOr :: !JSAnnot -> JSBinOp
JSBinOpPlus :: !JSAnnot -> JSBinOp
JSBinOpRsh :: !JSAnnot -> JSBinOp
JSBinOpStrictEq :: !JSAnnot -> JSBinOp
JSBinOpStrictNeq :: !JSAnnot -> JSBinOp
JSBinOpTimes :: !JSAnnot -> JSBinOp
JSBinOpUrsh :: !JSAnnot -> JSBinOp
data JSBlock

-- | lbrace, stmts, rbrace
JSBlock :: !JSAnnot -> ![JSStatement] -> !JSAnnot -> JSBlock
data JSUnaryOp
JSUnaryOpDecr :: !JSAnnot -> JSUnaryOp
JSUnaryOpDelete :: !JSAnnot -> JSUnaryOp
JSUnaryOpIncr :: !JSAnnot -> JSUnaryOp
JSUnaryOpMinus :: !JSAnnot -> JSUnaryOp
JSUnaryOpNot :: !JSAnnot -> JSUnaryOp
JSUnaryOpPlus :: !JSAnnot -> JSUnaryOp
JSUnaryOpTilde :: !JSAnnot -> JSUnaryOp
JSUnaryOpTypeof :: !JSAnnot -> JSUnaryOp
JSUnaryOpVoid :: !JSAnnot -> JSUnaryOp
data JSSemi
JSSemi :: !JSAnnot -> JSSemi
JSSemiAuto :: JSSemi
data JSAssignOp
JSAssign :: !JSAnnot -> JSAssignOp
JSTimesAssign :: !JSAnnot -> JSAssignOp
JSDivideAssign :: !JSAnnot -> JSAssignOp
JSModAssign :: !JSAnnot -> JSAssignOp
JSPlusAssign :: !JSAnnot -> JSAssignOp
JSMinusAssign :: !JSAnnot -> JSAssignOp
JSLshAssign :: !JSAnnot -> JSAssignOp
JSRshAssign :: !JSAnnot -> JSAssignOp
JSUrshAssign :: !JSAnnot -> JSAssignOp
JSBwAndAssign :: !JSAnnot -> JSAssignOp
JSBwXorAssign :: !JSAnnot -> JSAssignOp
JSBwOrAssign :: !JSAnnot -> JSAssignOp
data JSTryCatch

-- | catch,lb,ident,rb,block
JSCatch :: !JSAnnot -> !JSAnnot -> !JSExpression -> !JSAnnot -> !JSBlock -> JSTryCatch

-- | catch,lb,ident,if,expr,rb,block
JSCatchIf :: !JSAnnot -> !JSAnnot -> !JSExpression -> !JSAnnot -> !JSExpression -> !JSAnnot -> !JSBlock -> JSTryCatch
data JSTryFinally

-- | finally,block
JSFinally :: !JSAnnot -> !JSBlock -> JSTryFinally
JSNoFinally :: JSTryFinally
data JSStatement

-- | lbrace, stmts, rbrace, autosemi
JSStatementBlock :: !JSAnnot -> ![JSStatement] -> !JSAnnot -> !JSSemi -> JSStatement

-- | break,optional identifier, autosemi
JSBreak :: !JSAnnot -> !JSIdent -> !JSSemi -> JSStatement

-- | const, decl, autosemi
JSConstant :: !JSAnnot -> !(JSCommaList JSExpression) -> !JSSemi -> JSStatement

-- | continue, optional identifier,autosemi
JSContinue :: !JSAnnot -> !JSIdent -> !JSSemi -> JSStatement

-- | do,stmt,while,lb,expr,rb,autosemi
JSDoWhile :: !JSAnnot -> !JSStatement -> !JSAnnot -> !JSAnnot -> !JSExpression -> !JSAnnot -> !JSSemi -> JSStatement

-- | for,lb,expr,semi,expr,semi,expr,rb.stmt
JSFor :: !JSAnnot -> !JSAnnot -> !(JSCommaList JSExpression) -> !JSAnnot -> !(JSCommaList JSExpression) -> !JSAnnot -> !(JSCommaList JSExpression) -> !JSAnnot -> !JSStatement -> JSStatement

-- | for,lb,expr,in,expr,rb,stmt
JSForIn :: !JSAnnot -> !JSAnnot -> !JSExpression -> !JSBinOp -> !JSExpression -> !JSAnnot -> !JSStatement -> JSStatement

-- | for,lb,var,vardecl,semi,expr,semi,expr,rb,stmt
JSForVar :: !JSAnnot -> !JSAnnot -> !JSAnnot -> !(JSCommaList JSExpression) -> !JSAnnot -> !(JSCommaList JSExpression) -> !JSAnnot -> !(JSCommaList JSExpression) -> !JSAnnot -> !JSStatement -> JSStatement

-- | for,lb,var,vardecl,in,expr,rb,stmt
JSForVarIn :: !JSAnnot -> !JSAnnot -> !JSAnnot -> !JSExpression -> !JSBinOp -> !JSExpression -> !JSAnnot -> !JSStatement -> JSStatement

-- | fn,name, lb,parameter list,rb,block,autosemi
JSFunction :: !JSAnnot -> !JSIdent -> !JSAnnot -> !(JSCommaList JSIdent) -> !JSAnnot -> !JSBlock -> !JSSemi -> JSStatement

-- | if,(,expr,),stmt
JSIf :: !JSAnnot -> !JSAnnot -> !JSExpression -> !JSAnnot -> !JSStatement -> JSStatement

-- | if,(,expr,),stmt,else,rest
JSIfElse :: !JSAnnot -> !JSAnnot -> !JSExpression -> !JSAnnot -> !JSStatement -> !JSAnnot -> !JSStatement -> JSStatement

-- | identifier,colon,stmt
JSLabelled :: !JSIdent -> !JSAnnot -> !JSStatement -> JSStatement
JSEmptyStatement :: !JSAnnot -> JSStatement
JSExpressionStatement :: !JSExpression -> !JSSemi -> JSStatement

-- | lhs, assignop, rhs, autosemi
JSAssignStatement :: !JSExpression -> !JSAssignOp -> !JSExpression -> !JSSemi -> JSStatement
JSMethodCall :: !JSExpression -> !JSAnnot -> !(JSCommaList JSExpression) -> !JSAnnot -> !JSSemi -> JSStatement

-- | optional expression,autosemi
JSReturn :: !JSAnnot -> !(Maybe JSExpression) -> !JSSemi -> JSStatement

-- | switch,lb,expr,rb,caseblock,autosemi
JSSwitch :: !JSAnnot -> !JSAnnot -> !JSExpression -> !JSAnnot -> !JSAnnot -> ![JSSwitchParts] -> !JSAnnot -> !JSSemi -> JSStatement

-- | throw val autosemi
JSThrow :: !JSAnnot -> !JSExpression -> !JSSemi -> JSStatement

-- | try,block,catches,finally
JSTry :: !JSAnnot -> !JSBlock -> ![JSTryCatch] -> !JSTryFinally -> JSStatement

-- | var|const, decl, autosemi
JSVariable :: !JSAnnot -> !(JSCommaList JSExpression) -> !JSSemi -> JSStatement

-- | while,lb,expr,rb,stmt
JSWhile :: !JSAnnot -> !JSAnnot -> !JSExpression -> !JSAnnot -> !JSStatement -> JSStatement

-- | with,lb,expr,rb,stmt list
JSWith :: !JSAnnot -> !JSAnnot -> !JSExpression -> !JSAnnot -> !JSStatement -> !JSSemi -> JSStatement
data JSSwitchParts

-- | expr,colon,stmtlist
JSCase :: !JSAnnot -> !JSExpression -> !JSAnnot -> ![JSStatement] -> JSSwitchParts

-- | colon,stmtlist
JSDefault :: !JSAnnot -> !JSAnnot -> ![JSStatement] -> JSSwitchParts
data JSAST

-- | source elements, tailing whitespace
JSAstProgram :: ![JSStatement] -> !JSAnnot -> JSAST
JSAstStatement :: !JSStatement -> !JSAnnot -> JSAST
JSAstExpression :: !JSExpression -> !JSAnnot -> JSAST
JSAstLiteral :: !JSExpression -> !JSAnnot -> JSAST
data CommentAnnotation
CommentA :: TokenPosn -> String -> CommentAnnotation
WhiteSpace :: TokenPosn -> String -> CommentAnnotation
NoComment :: CommentAnnotation

-- | <a>TokenPosn</a> records the location of a token in the input text. It
--   has three fields: the address (number of characters preceding the
--   token), line number and column of a token within the file. Note: The
--   lexer assumes the usual eight character tab stops.
data TokenPosn
TokenPn :: !Int -> !Int -> !Int -> TokenPosn
tokenPosnEmpty :: TokenPosn
renderJS :: JSAST -> Builder
renderToString :: JSAST -> String
renderToText :: JSAST -> Text
