Unicorn XML Toolkit
Version 1.00.00

Namespace EcmaScript
Class CInterpreter

class CInterpreter: public CInterface {
public:
    CInterpreter();
    ~CInterpreter();
public:      
    XGlobalObject GetGlobalObject();
    void SetErrorHandler(CErrorHandler *pErrorHandler);
    void SetProgramName(const CString &strProgramName);
    void SetLineNumber(int nLineNumber);
    CCompletion Evaluate(IUnicodeStream *pStream);
    CCompletion Evaluate(const CString &strSource);      
    };

The ECMAScript interpreter.

Since:
1.00.00
Version:
1.00.00
Author:
Alexey Gokhberg
See Also:
CCompletion, CGlobalObject, CErrorHandler
Constructor/Destructor Summary
CInterpreter ();
����������Constructs the interpreter.
~CInterpreter ();
����������Destroys the interpreter.

Function Summary
XGlobalObject GetGlobalObject ();
����������Returns the global object associated with this interpreter.
void SetErrorHandler (CErrorHandler *pErrorHandler);
����������Sets an error handler to be used by this interpreter.
void SetProgramName (const CString &strProgramName);
����������Sets a name of the program.
void SetLineNumber (int nLineNumber);
����������Sets a number of the starting line of the program.
CCompletion Evaluate (IUnicodeStream *pStream);
����������Evaluates a program obtained from the given source stream.
CCompletion Evaluate (const CString &strSource);
����������Evaluates a program obtained from the given source string.

Constructor/Destructor Detail

CInterpreter

CInterpreter();

Constructs the interpreter.

~CInterpreter

~CInterpreter();

Destroys the interpreter.

Function Detail

GetGlobalObject

XGlobalObject GetGlobalObject();

Returns the global object associated with this interpreter.

Returns:
the global object associated with this interpreter

SetErrorHandler

void SetErrorHandler(CErrorHandler *pErrorHandler);

Sets an error handler to be used by this interpreter.

Parameters:
pErrorHandler - the error handler

SetProgramName

void SetProgramName(const CString &strProgramName);

Sets a name of the program.

The name of the program is used for diagnostic purposes.

Parameters:
strProgramName - the name of the program

SetLineNumber

void SetLineNumber(int nLineNumber);

Sets a number of the starting line of the program.

The number of the starting line of the program is used for diagnostic purposes.

Parameters:
nLineNumber - the number of the starting line of the program

Evaluate

CCompletion Evaluate(IUnicodeStream *pStream);

Evaluates a program obtained from the given source stream.

Parameters:
pStream - the source stream for the program
Returns:
the completion value obtained as the result of evaluation

Evaluate

CCompletion Evaluate(const CString &strSource);

Evaluates a program obtained from the given source string.

Parameters:
strSource - the string containing the source text for the program
Returns:
the completion value obtained as the result of evaluation

Unicorn XML Toolkit
Version 1.00.00


This document was created using Unicorn DOC++.

Copyright 1999-2001 Unicorn Enterprises SA.
All Rights Reserved.