ooRexx  4.2.0-source
About: ooRexx (Open Object Rexx) is a free implementation of Object Rexx. Object Rexx is an enhancement of the classic Rexx interpreter; a full-featured programming language with a human-oriented syntax.
  Fossies Dox: ooRexx-4.2.0-source.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

RexxCode.hpp
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------*/
2 /* */
3 /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */
4 /* Copyright (c) 2005-2009 Rexx Language Association. All rights reserved. */
5 /* */
6 /* This program and the accompanying materials are made available under */
7 /* the terms of the Common Public License v1.0 which accompanies this */
8 /* distribution. A copy is also available at the following address: */
9 /* http://www.oorexx.org/license.html */
10 /* */
11 /* Redistribution and use in source and binary forms, with or */
12 /* without modification, are permitted provided that the following */
13 /* conditions are met: */
14 /* */
15 /* Redistributions of source code must retain the above copyright */
16 /* notice, this list of conditions and the following disclaimer. */
17 /* Redistributions in binary form must reproduce the above copyright */
18 /* notice, this list of conditions and the following disclaimer in */
19 /* the documentation and/or other materials provided with the distribution. */
20 /* */
21 /* Neither the name of Rexx Language Association nor the names */
22 /* of its contributors may be used to endorse or promote products */
23 /* derived from this software without specific prior written permission. */
24 /* */
25 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
26 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
27 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
28 /* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
29 /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
30 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
31 /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
32 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */
33 /* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
34 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
35 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
36 /* */
37 /*----------------------------------------------------------------------------*/
38 /******************************************************************************/
39 /* REXX Kernel RexxCode.hpp */
40 /* */
41 /* Primitive REXX Code Class Definitions */
42 /* */
43 /******************************************************************************/
44 #ifndef Included_RexxCode
45 #define Included_RexxCode
46 
47 #include "SourceFile.hpp"
48 #include "MethodClass.hpp"
49 #include "RoutineClass.hpp"
50 
51  /* various types of call or function */
52  /* calls */
53 #define INTERNAL_ROUTINE 1
54 #define BUILTIN_ROUTINE 2
55 #define EXTERNAL_ROUTINE 3
56 #define DYNAMIC_ROUTINE 4
57 
58 class RexxCode : public BaseCode
59 {
60  public:
61  void *operator new(size_t);
62  inline void *operator new(size_t size, void *ptr) {return ptr;};
63  inline void operator delete(void *) { ; }
64  inline void operator delete(void *, void *) { ; }
65 
66  RexxCode(RexxSource *, RexxInstruction *, RexxDirectory *, size_t, size_t);
67  inline RexxCode(RESTORETYPE restoreType) { ; };
68  void live(size_t);
69  void liveGeneral(int reason);
70  void flatten(RexxEnvelope *);
71  RexxArray * getSource();
74  inline RexxSource *getSourceObject() { return source; }
76  inline RexxDirectory *getLabels() { return labels; }
77  inline size_t getMaxStackSize() { return maxStack; }
78  inline size_t getLocalVariableSize() { return vdictSize; }
83  inline bool isTraceable() { return source->isTraceable(); }
84  inline bool isInterpret() { return source->isInterpret(); }
85  inline RexxString *extract(SourceLocation &l) { return source->extract(l); }
87  inline void install(RexxActivation *activation) { source->install(activation); }
88  inline RexxCode *interpret(RexxString *s, size_t n) { return source->interpret(s, labels, n); }
89  inline RexxDirectory *getMethods() { return source->getMethods(); };
90  inline RexxDirectory *getRoutines() { return source->getRoutines(); };
92  inline RexxString *resolveProgramName(RexxActivity *activity, RexxString *name) { return source->resolveProgramName(activity, name); }
93  inline void mergeRequired(RexxSource *s) { source->mergeRequired(s); }
94  virtual void run(RexxActivity *, RexxMethod *, RexxObject *, RexxString *, RexxObject **, size_t, ProtectedObject &);
95  virtual void call(RexxActivity *, RoutineClass *, RexxString *, RexxObject **, size_t, RexxString *, RexxString *, int, ProtectedObject &);
96  virtual void call(RexxActivity *, RoutineClass *, RexxString *, RexxObject **, size_t, ProtectedObject &);
97 
98 protected:
99 
100  RexxSource * source; // the source this code belongs to.
101  RexxInstruction * start; /* root of parse tree */
102  RexxDirectory * labels; /* root of label list */
103  size_t maxStack; /* maximum stack depth */
104  size_t vdictSize; /* size of variable dictionary */
105 
106 };
107 #endif
RexxSource::getLocalRoutines
RexxDirectory * getLocalRoutines()
Definition: SourceFile.hpp:369
RexxCode::findRoutine
RoutineClass * findRoutine(RexxString *n)
Definition: RexxCode.hpp:91
RexxArray
Definition: ArrayClass.hpp:100
RexxCode::extract
RexxString * extract(SourceLocation &l)
Definition: RexxCode.hpp:85
RexxSource::getPublicRoutines
RexxDirectory * getPublicRoutines()
Definition: SourceFile.hpp:370
RexxCode::vdictSize
size_t vdictSize
Definition: RexxCode.hpp:104
MethodClass.hpp
RexxCode::isTraceable
bool isTraceable()
Definition: RexxCode.hpp:83
RexxCode::install
void install(RexxActivation *activation)
Definition: RexxCode.hpp:87
RexxCode::getFirstInstruction
RexxInstruction * getFirstInstruction()
Definition: RexxCode.hpp:75
RoutineClass.hpp
RexxCode::mergeRequired
void mergeRequired(RexxSource *s)
Definition: RexxCode.hpp:93
RoutineClass
Definition: RoutineClass.hpp:49
RexxCode::labels
RexxDirectory * labels
Definition: RexxCode.hpp:102
RexxCode::resolveProgramName
RexxString * resolveProgramName(RexxActivity *activity, RexxString *name)
Definition: RexxCode.hpp:92
RexxSource::interpret
RexxCode * interpret(RexxString *, RexxDirectory *, size_t)
Definition: SourceFile.cpp:1231
RexxCode
Definition: RexxCode.hpp:58
RexxInstruction
Definition: RexxInstruction.hpp:54
RexxCode::maxStack
size_t maxStack
Definition: RexxCode.hpp:103
SourceLocation
Definition: SourceLocation.hpp:48
RexxCode::flatten
void flatten(RexxEnvelope *)
Definition: RexxCode.cpp:160
RexxCode::getMethods
RexxDirectory * getMethods()
Definition: RexxCode.hpp:89
RexxCode::live
void live(size_t)
Definition: RexxCode.cpp:140
RexxEnvelope
Definition: RexxEnvelope.hpp:53
RexxCode::setPublicRoutines
void setPublicRoutines(RexxDirectory *r)
Definition: RexxCode.hpp:82
RexxCode::liveGeneral
void liveGeneral(int reason)
Definition: RexxCode.cpp:150
RexxSource
Definition: SourceFile.hpp:131
RexxSource::setLocalRoutines
void setLocalRoutines(RexxDirectory *r)
Definition: SourceFile.hpp:371
RexxSource::getRoutines
RexxDirectory * getRoutines()
Definition: SourceFile.hpp:295
RexxCode::start
RexxInstruction * start
Definition: RexxCode.hpp:101
RexxCode::call
virtual void call(RexxActivity *, RoutineClass *, RexxString *, RexxObject **, size_t, RexxString *, RexxString *, int, ProtectedObject &)
Definition: RexxCode.cpp:95
RexxCode::getProgramName
RexxString * getProgramName()
Definition: RexxCode.cpp:201
RexxActivity
Definition: RexxActivity.hpp:127
RexxDirectory
Definition: DirectoryClass.hpp:49
RexxSource::install
void install()
Definition: SourceFile.cpp:1662
RexxCode::getLocalRoutines
RexxDirectory * getLocalRoutines()
Definition: RexxCode.hpp:79
RexxCode::getSource
RexxArray * getSource()
Definition: RexxCode.cpp:174
RexxCode::setLocalRoutines
void setLocalRoutines(RexxDirectory *r)
Definition: RexxCode.hpp:81
RexxSource::findRoutine
RoutineClass * findRoutine(RexxString *)
Definition: SourceFile.cpp:1513
RexxCode::getLocalVariableSize
size_t getLocalVariableSize()
Definition: RexxCode.hpp:78
ProtectedObject
Definition: ProtectedObject.hpp:46
RexxSource::setPublicRoutines
void setPublicRoutines(RexxDirectory *r)
Definition: SourceFile.hpp:372
BaseCode
Definition: MethodClass.hpp:62
RexxCode::RexxCode
RexxCode(RESTORETYPE restoreType)
Definition: RexxCode.hpp:67
RexxCode::getMaxStackSize
size_t getMaxStackSize()
Definition: RexxCode.hpp:77
RexxCode::getSourceObject
RexxSource * getSourceObject()
Definition: RexxCode.hpp:74
RexxSource::isInterpret
bool isInterpret()
Definition: SourceFile.hpp:281
RexxCode::getSecurityManager
SecurityManager * getSecurityManager()
Definition: RexxCode.hpp:86
SecurityManager
Definition: SecurityManager.hpp:52
RexxActivation
Definition: RexxActivation.hpp:156
RexxCode::isInterpret
bool isInterpret()
Definition: RexxCode.hpp:84
RexxCode::RexxCode
RexxCode(RexxSource *, RexxInstruction *, RexxDirectory *, size_t, size_t)
Definition: RexxCode.cpp:59
RexxCode::interpret
RexxCode * interpret(RexxString *s, size_t n)
Definition: RexxCode.hpp:88
RexxCode::run
virtual void run(RexxActivity *, RexxMethod *, RexxObject *, RexxString *, RexxObject **, size_t, ProtectedObject &)
Definition: RexxCode.cpp:119
RexxCode::setSecurityManager
RexxObject * setSecurityManager(RexxObject *)
Definition: RexxCode.cpp:220
RexxSource::getSecurityManager
SecurityManager * getSecurityManager()
Definition: SourceFile.hpp:367
RexxSource::isTraceable
bool isTraceable()
Definition: SourceFile.cpp:780
RexxSource::getMethods
RexxDirectory * getMethods()
Definition: SourceFile.hpp:294
RESTORETYPE
RESTORETYPE
Definition: ObjectClass.hpp:80
RexxCode::getLabels
RexxDirectory * getLabels()
Definition: RexxCode.hpp:76
RexxMethod
Definition: MethodClass.hpp:101
RexxSource::resolveProgramName
RexxString * resolveProgramName(RexxActivity *activity, RexxString *name)
Definition: SourceFile.cpp:1541
RexxSource::mergeRequired
void mergeRequired(RexxSource *)
Definition: SourceFile.cpp:1365
RexxSource::extract
RexxString * extract(SourceLocation &)
Definition: SourceFile.cpp:1017
SourceFile.hpp
RexxObject
Definition: ObjectClass.hpp:311
RexxCode::source
RexxSource * source
Definition: RexxCode.hpp:100
RexxString
Definition: StringClass.hpp:119
RexxCode::getRoutines
RexxDirectory * getRoutines()
Definition: RexxCode.hpp:90
RexxCode::getPublicRoutines
RexxDirectory * getPublicRoutines()
Definition: RexxCode.hpp:80