24 #ifndef _KJS_INTERPRETER_H_
25 #define _KJS_INTERPRETER_H_
93 Object variableObject()
const;
120 const Context callingContext()
const;
126 CodeType codeType()
const;
132 int sourceId()
const;
137 int curStmtFirstLine()
const;
142 int curStmtLastLine()
const;
202 Object &globalObject()
const;
204 void initGlobalObject();
207 static void unlock();
230 bool checkSyntax(
const UString &code,
int *errLine,
UString *errMsg);
238 bool checkSyntax(
const UString &code);
263 InterpreterImp *imp();
273 Object builtinObject()
const;
278 Object builtinFunction()
const;
283 Object builtinArray()
const;
288 Object builtinBoolean()
const;
293 Object builtinString()
const;
298 Object builtinNumber()
const;
303 Object builtinDate()
const;
308 Object builtinRegExp()
const;
313 Object builtinError()
const;
318 Object builtinObjectPrototype()
const;
323 Object builtinFunctionPrototype()
const;
328 Object builtinArrayPrototype()
const;
333 Object builtinBooleanPrototype()
const;
338 Object builtinStringPrototype()
const;
343 Object builtinNumberPrototype()
const;
348 Object builtinDatePrototype()
const;
353 Object builtinRegExpPrototype()
const;
358 Object builtinErrorPrototype()
const;
363 Object builtinEvalError()
const;
364 Object builtinRangeError()
const;
365 Object builtinReferenceError()
const;
366 Object builtinSyntaxError()
const;
367 Object builtinTypeError()
const;
368 Object builtinURIError()
const;
370 Object builtinEvalErrorPrototype()
const;
371 Object builtinRangeErrorPrototype()
const;
372 Object builtinReferenceErrorPrototype()
const;
373 Object builtinSyntaxErrorPrototype()
const;
374 Object builtinTypeErrorPrototype()
const;
375 Object builtinURIErrorPrototype()
const;
377 enum CompatMode { NativeMode, IECompat, NetscapeCompat };
384 void setCompatMode(CompatMode mode);
385 CompatMode compatMode()
const;
391 static bool collect();
405 virtual int rtti() {
return 0; }
411 static void finalCheck();
430 virtual void virtual_hook(
int id,
void* data );
439 friend class InterpreterImp;
441 friend class GlobalFuncImp;
442 friend class TryNode;
443 friend class VarDeclNode;
444 friend class FuncDeclNode;
455 Interpreter *interpreter()
const {
return dynamicInterpreter(); }
463 Interpreter *lexicalInterpreter()
const;
472 void setException(
const Value &e);
473 void clearException();
474 Value exception()
const {
return _exception; }
481 static void requestTerminate() { terminate_request =
true; }
485 static bool (*confirmTerminate)();
487 ExecState(Interpreter *interp, ContextImp *con)
488 : _interpreter(interp), _context(con) { }
489 Interpreter *_interpreter;
490 ContextImp *_context;
492 static bool terminate_request;
Completion objects are used to convey the return status and value from functions.
Represents an execution context, as specified by section 10 of the ECMA spec.
Represents the current state of script execution.
Context context() const
Returns the execution context associated with this execution state.
Interpreter * dynamicInterpreter() const
Returns the interpreter associated with this execution state.
Implementation class for functions implemented in JS.
Represents an Identifier for a Javascript object.
Interpreter objects can be used to evaluate ECMAScript code.
virtual int rtti()
Provides a way to distinguish derived classes.
virtual void mark()
Called by InterpreterImp during the mark phase of the garbage collector Default implementation does n...
Value objects are act as wrappers ("smart pointers") around ValueImp objects and their descendents.