language-c-0.4.7: Analysis and generation of C code

Copyright | (c) 2008 Benedikt Huber
License | BSD-style
Maintainer | benedikt.huber@gmail.com
Stability | experimental
Portability | ghc
Safe Haskell | None
Language | Haskell98

Language.C.Syntax.Ops

Contents

- Assignment operators
- Binary operators
- Unary operators

Description

Unary, binary and asssignment operators. Exported via AST.

Synopsis

- data CAssignOp
  - = CAssignOp
  - | CMulAssOp
  - | CDivAssOp
  - | CRmdAssOp
  - | CAddAssOp
  - | CSubAssOp
  - | CShlAssOp
  - | CShrAssOp
  - | CAndAssOp
  - | CXorAssOp
  - | COrAssOp
- assignBinop :: CAssignOp -> CBinaryOp
- data CBinaryOp
  - = CMulOp
  - | CDivOp
  - | CRmdOp
  - | CAddOp
  - | CSubOp
  - | CShlOp
  - | CShrOp
  - | CLeOp
  - | CGrOp
  - | CLeqOp
  - | CGeqOp
  - | CEqOp
  - | CNeqOp
  - | CAndOp
  - | CXorOp
  - | COrOp
  - | CLndOp
  - | CLorOp
- isCmpOp :: CBinaryOp -> Bool
- isPtrOp :: CBinaryOp -> Bool
- isBitOp :: CBinaryOp -> Bool
- isLogicOp :: CBinaryOp -> Bool
- data CUnaryOp
  - = CPreIncOp
  - | CPreDecOp
  - | CPostIncOp
  - | CPostDecOp
  - | CAdrOp
  - | CIndOp
  - | CPlusOp
  - | CMinOp
  - | CCompOp
  - | CNegOp
- isEffectfulOp :: CUnaryOp -> Bool

# Assignment operators

data CAssignOp

C assignment operators (K&R A7.17)

Constructors

CAssignOp |
CMulAssOp |
CDivAssOp |
CRmdAssOp | remainder and assignment
CAddAssOp |
CSubAssOp |
CShlAssOp |
CShrAssOp |
CAndAssOp |
CXorAssOp |
COrAssOp |

Instances

Eq CAssignOp |
Data CAssignOp |
Ord CAssignOp |
Show CAssignOp |
Pretty CAssignOp |

assignBinop :: CAssignOp -> CBinaryOp

# Binary operators

data CBinaryOp

C binary operators (K&R A7.6-15)

Constructors

CMulOp |
CDivOp |
CRmdOp | remainder of division
CAddOp |
CSubOp |
CShlOp | shift left
CShrOp | shift right
CLeOp | less
CGrOp | greater
CLeqOp | less or equal
CGeqOp | greater or equal
CEqOp | equal
CNeqOp | not equal
CAndOp | bitwise and
CXorOp | exclusive bitwise or
COrOp | inclusive bitwise or
CLndOp | logical and
CLorOp | logical or

Instances

Eq CBinaryOp |
Data CBinaryOp |
Ord CBinaryOp |
Show CBinaryOp |
Pretty CBinaryOp |

isCmpOp :: CBinaryOp -> Bool

isPtrOp :: CBinaryOp -> Bool

isBitOp :: CBinaryOp -> Bool

isLogicOp :: CBinaryOp -> Bool

# Unary operators

data CUnaryOp

C unary operator (K&R A7.3-4)

Constructors

CPreIncOp | prefix increment operator
CPreDecOp | prefix decrement operator
CPostIncOp | postfix increment operator
CPostDecOp | postfix decrement operator
CAdrOp | address operator
CIndOp | indirection operator
CPlusOp | prefix plus
CMinOp | prefix minus
CCompOp | one's complement
CNegOp | logical negation

Instances

Eq CUnaryOp |
Data CUnaryOp |
Ord CUnaryOp |
Show CUnaryOp |
Pretty CUnaryOp |

isEffectfulOp :: CUnaryOp -> Bool