Module CPP.ICode.Parser.SQL.AST

This module defines the AST structure generated by the parser and used for the translation of SQL statements.

Author: Julia Krone

Version: 0.1

Summary of exported operations:

Exported datatypes:


Statement

Constructors:


ColumnRef

Constructors:

  • Column :: Tab -> String -> Type -> Bool -> Int -> ColumnRef

Tab

Constructors:

  • Unique :: String -> Tab
  • Def :: [String] -> Tab

Type

Constructors:

  • I :: Type
  • B :: Type
  • F :: Type
  • C :: Type
  • S :: Type
  • D :: Type
  • Key :: String -> Type
  • Entity :: String -> Type
  • Unknown :: Type

Assign

Constructors:


Value

Constructors:

  • Emb :: String -> Type -> Value
  • IntExp :: Int -> Value
  • KeyExp :: String -> Int -> Value
  • FloatExp :: Float -> Value
  • StringExp :: String -> Value
  • DateExp :: CalendarTime -> Value
  • BoolExp :: Bool -> Value
  • CharExp :: Char -> Value
  • AbsNull :: Value

SelectHead

Constructors:


SelectClause

Constructors:


SelElement

Constructors:


Table

Constructors:

  • Table :: String -> String -> Int -> Table

TableRef

Constructors:


JoinClause

Constructors:


JoinCond

Constructors:


ASpecifier

Constructors:

  • AAll :: ASpecifier
  • ADistinct :: ASpecifier

Condition

Constructors:


AbsRel

Constructors:

  • AMToN :: String -> AbsRel
  • ANToOne :: String -> AbsRel
  • AOneToN :: String -> AbsRel
  • NotSpec :: String -> AbsRel

Operand

Type synonym: Operand = Either ColumnRef Value


AstOp

Constructors:

  • ALth :: AstOp
  • ALe :: AstOp
  • AGth :: AstOp
  • AGe :: AstOp
  • AEq :: AstOp
  • AUnEq :: AstOp
  • ALike :: AstOp

ALogOp

Constructors:

  • AAnd :: ALogOp
  • AOr :: ALogOp

ASetOp

Constructors:

  • AUnion :: ASetOp
  • AExcept :: ASetOp
  • AIntersect :: ASetOp

Group

Constructors:


Having

Constructors:


AFun

Constructors:

  • ASum :: AFun
  • ACount :: AFun
  • AAvg :: AFun
  • AMin :: AFun
  • AMax :: AFun

Order

Constructors:


Dir

Constructors:

  • Asc :: Dir
  • Desc :: Dir

Exported operations: