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

kjs

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

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
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kjs by doxygen 1.8.1.2
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |