• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kjs
 

kjs

  • kjs
context.h
1 /*
2  * This file is part of the KDE libraries
3  * Copyright (C) 1999-2001 Harri Porten (porten@kde.org)
4  * Copyright (C) 2001 Peter Kelly (pmk@post.com)
5  * Copyright (C) 2003 Apple Computer, Inc.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public License
18  * along with this library; see the file COPYING.LIB. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  *
22  */
23 
24 #ifndef KJS_CONTEXT_H
25 #define KJS_CONTEXT_H
26 
27 #include "function.h"
28 
29 namespace KJS {
30 
34  class ContextImp {
35  friend class Context;
36  friend class StatementNode;
37  public:
38  // TODO: remove glob parameter. deducable from exec.
39  ContextImp(Object &glob, InterpreterImp *interpreter, Object &thisV, int _sourceId, CodeType type = GlobalCode,
40  ContextImp *callingContext = 0L, FunctionImp *func = 0L, const List *args = 0);
41  virtual ~ContextImp();
42 
43  const ScopeChain &scopeChain() const { return scope; }
44  CodeType codeType() const { return m_codeType; }
45  Object variableObject() const { return variable; }
46  void setVariableObject(const Object &v) { variable = v; }
47  Object thisValue() const { return thisVal; }
48  ContextImp *callingContext() { return _callingContext; }
49  ObjectImp *activationObject() { return activation.imp(); }
50  FunctionImp *function() const { return _function; }
51  const List *arguments() const { return _arguments; }
52 
53  void pushScope(const Object &s) { scope.push(s.imp()); }
54  void popScope() { scope.pop(); }
55  LabelStack *seenLabels() { return &ls; }
56 
57  void mark();
58 
59  void pushTryCatch() { tryCatch++; };
60  void popTryCatch() { tryCatch--; };
61  bool inTryCatch() const;
62 
63  void setLines(int l0, int l1) { line0 = l0; line1 = l1; }
64 
65  private:
66  InterpreterImp *_interpreter;
67  ContextImp *_callingContext;
68  FunctionImp *_function;
69  const List *_arguments;
70  Object activation;
71 
72  ScopeChain scope;
73  Object variable;
74  Object thisVal;
75 
76  LabelStack ls;
77  CodeType m_codeType;
78 
79  int tryCatch;
80  int sourceId;
81  int line0;
82  int line1;
83  Identifier functionName;
84  List args;
85  };
86 
87 } // namespace KJS
88 
89 #endif
KJS::ScopeChain
A scope chain object.
Definition: scope_chain.h:47
KJS::ContextImp
Execution context.
Definition: context.h:34
KJS::Object
Represents an Object.
Definition: object.h:81
KJS::Context
Represents an execution context, as specified by section 10 of the ECMA spec.
Definition: interpreter.h:72
KJS::FunctionImp
Implementation class for functions implemented in JS.
Definition: internal.h:389
KJS
Definition: array_instance.h:27
KJS::List
Native list type.
Definition: list.h:48
KJS::LabelStack
The "label set" in Ecma-262 spec.
Definition: internal.h:161
KJS::Identifier
Represents an Identifier for a Javascript object.
Definition: identifier.h:32

kjs

Skip menu "kjs"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kjs

Skip menu "kjs"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for kjs by doxygen 1.8.8
This website is maintained by Timothy Pearson.