Zen
A cross-platform functional programming language

Compiler::Impl Class Reference

Zen compiler class implementation. More...

List of all members.

Public Member Functions

 Impl (const Build::Config &cfg, Compiler &compiler)
 Default constructor.
 ~Impl ()
 Destructor.
void importHeader (zbl::ParseContext &pctx, const z::stringlist &idList, const Ast::ImportStatement::Type &type)
 Import a header file.
void compile (const Build::Project &project)
 Compile a project.
void readProject (Ast::Unit &unit, const z::string &file)
 Read a project file.

Private Member Functions

void pumpLexer (zbl::Scanner &scanner, zbl::Lexer &lexer, zbl::Parser &parser)
 Read tokens from lexer and push into parser.
void pumpParser (z::stream &stream, zbl::ParseContext &pctx)
 Initialize scanner,lexer and parser and process inputs.
z::string getImportFilename (const z::stringlist &idList)
 Get the import header file name, given an id list.
void importHeaderStream (z::stream &os, const z::string &fname, zbl::ParseContext &pctx, const Ast::TypeDefTypeSpec::NativeType &ntype)
 Import a header, given an input stream.
void importHeaderString (zbl::ParseContext &pctx, const char *name, const char *hdrstr, const Ast::TypeDefTypeSpec::NativeType &ntype)
 Import a header, given an input string.
void importNativeHeader (zbl::ParseContext &pctx)
 Import all native headers.
int doParse (Ast::Unit &unit, z::stream &stream, const z::string &filename)
 Import a header, given an input string.

Private Attributes

const Build::Config_cfg
 Configuration to build against.
Compiler_compiler
 Outer Compiler instance.

Detailed Description

Zen compiler class implementation.

Holds the parser, lexer, parsecontext.


Constructor & Destructor Documentation

Impl ( const Build::Config cfg,
Compiler compiler 
) [inline]

Default constructor.

Parameters:
cfgConfiguration to build against
compilerOuter Compiler instance

Member Function Documentation

void compile ( const Build::Project project) [inline]

Compile a project.

Parameters:
projectThe project definition
int doParse ( Ast::Unit unit,
z::stream stream,
const z::string filename 
) [inline, private]

Import a header, given an input string.

Parameters:
unitThe AST Unit to read into
streamThe input stream
filenameThe name of the file to read
Returns:
0 on success, else error code.
z::string getImportFilename ( const z::stringlist idList) [inline, private]

Get the import header file name, given an id list.

Checks that the file exists

Parameters:
idListThe id list
Returns:
The filename
void importHeader ( zbl::ParseContext pctx,
const z::stringlist idList,
const Ast::ImportStatement::Type type 
) [inline]

Import a header file.

Parameters:
pctxThe parser context
idListThe header name, as a list of strings
typeThe header type
Todo:
Remove import type
void importHeaderStream ( z::stream os,
const z::string fname,
zbl::ParseContext pctx,
const Ast::TypeDefTypeSpec::NativeType ntype 
) [inline, private]

Import a header, given an input stream.

Parameters:
osThe input stream
fnameThe import filename
pctxThe parser context
ntypeThe native type of the import header
void importHeaderString ( zbl::ParseContext pctx,
const char *  name,
const char *  hdrstr,
const Ast::TypeDefTypeSpec::NativeType ntype 
) [inline, private]

Import a header, given an input string.

Parameters:
pctxThe parser context
nameThe import name
hdrstrThe header string
ntypeThe native type of the import header
void importNativeHeader ( zbl::ParseContext pctx) [inline, private]

Import all native headers.

Parameters:
pctxThe parser context
void pumpLexer ( zbl::Scanner scanner,
zbl::Lexer lexer,
zbl::Parser parser 
) [inline, private]

Read tokens from lexer and push into parser.

Parameters:
scannerThe scanner
lexerThe lexer
parserThe parser
void pumpParser ( z::stream stream,
zbl::ParseContext pctx 
) [inline, private]

Initialize scanner,lexer and parser and process inputs.

Parameters:
streamThe input stream
pctxThe parser context
void readProject ( Ast::Unit unit,
const z::string file 
) [inline]

Read a project file.

Parameters:
unitThe AST to read the project into
fileThe name of the file to read

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines