Paraiso-0.3.1.0: a code generator for partial differential equations solvers.

Safe HaskellSafe-Infered

Language.Paraiso.Generator.Claris

Description

CLARIS
C++-Like Abstract Representation of Intermediate Syntax.

Claris connects the higher-level concepts to native languages with capability to describe C++ syntax such as classes and containers. Claris also have support for extension made by C++-like languages such as CUDA qualifier and kernel call.

The design goal of Claris is to cover the necessity of the code generation and to make it simple. Claris is not designed for syntatic correctness, and it's possible to describe a Claris code that will cause a compile error in C++.

In Claris, variables, functions and classes are described in a unified manner that supports both the declaration and definition. From that information, the declarations and definitions are generated at appropriate places.

Synopsis

Documentation

data Program Source

A Claris program.

Constructors

Program 

Fields

progName :: Name

the name of the program

topLevel :: [Statement]

the top-level elements of the program.

data FileType Source

C++ class descriptions are separated to two files

Constructors

HeaderFile 
SourceFile 

Instances

data Statement Source

C++ top-level statements

Constructors

StmtPrpr Preprocessing

Preprosessor directive

UsingNamespace Name

Name space declaration

ClassDef Class

Class definition

FuncDef Function

Function definition

VarDef Var

variable definition as an expression

VarDefCon Var [Expr]

define a variable and call a constructor

VarDefSub Var Expr

define a variable and substitute a value

StmtExpr Expr

Expression

StmtWhile Expr [Statement]

While loop

StmtFor Statement Expr Expr [Statement]

For loop

StmtReturn Expr

return

Exclusive FileType Statement

A statement that is included exclusively in either of the file type

RawStatement Text

text directly embedded into source code

Comment Text

a comment

data Preprocessing Source

Preprocessor directive

Constructors

PrprInclude Parenthesis Text 
PrprPragma Text 

data TypeRep Source

description C++ type

Constructors

UnitType TypeRep

Types for simple objects

PtrOf TypeRep

Pointer type

RefOf TypeRep

Reference type

Const TypeRep

Constant type

TemplateType Text [TypeRep]

A template type

QualifiedType [Qualifier] TypeRep

Qualified type

ConstructorType

the type of mu which is returned from constructor / destructor

UnknownType

the type of kuu that is detached from reincarnation

typeOf :: Typeable a => a -> TypeRepSource

make C++ type from Haskell objects

toDyn :: Typeable a => a -> ExprSource

make a C++ expression from Haskell objects

data Class Source

C++ class

Constructors

Class 

data MemberDef Source

C++ class member definition

Constructors

MemberFunc

A member function

MemberVar

A member variable

data AccessModifier Source

C++ class member access modifier

Constructors

Private 
Protected 
Public 

data Function Source

C++ syntax for variable definition

C++ function definition

function :: TypeRep -> Name -> FunctionSource

A default function maker

data Qualifier Source

CUDA extension
qualifiers to use accelerator

data Var Source

C++ Variable definition

Constructors

Var TypeRep Name 

data Expr Source

C++ Expression

Constructors

Imm Dynamic

an immediate

VarExpr Var

an expression made of a variable

FuncCallUsr Name [Expr]

user function call

FuncCallStd Text [Expr]

builtin function call

CudaFuncCallUsr Name Expr Expr [Expr]

cuda function call with Grid topology

MemberAccess Expr Expr

access a member of an object

Op1Prefix Text Expr

prefix unary operator

Op1Postfix Text Expr

postfix unary operator

Op2Infix Text Expr Expr

infix binary operator

Op3Infix Text Text Expr Expr Expr

sandwiched trinity operator

ArrayAccess Expr Expr

access a component of an array

CommentExpr Text Expr

commented expr

data Parenthesis Source

parentheses used in C++

Constructors

Paren

expression coupling, function call

Bracket

array access

Brace

create a code block

Chevron

tepmplate type

Chevron2

not used

Chevron3

CUDA kernel call

Quotation

character

Quotation2

string

SlashStar

comment