Source Code Cross Referenced for ItclAccess.java in  » Scripting » jacl » tcl » lang » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Scripting » jacl » tcl.lang 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * ------------------------------------------------------------------------
003:         *      PACKAGE:  [incr Tcl]
004:         *  DESCRIPTION:  Object-Oriented Extensions to Tcl
005:         *
006:         *  This file is part of Itcl, it provides access to Jacl fields
007:         *  and methods that would otherwise only be available to classes
008:         *  in the tcl.lang package. It also provides some utility
009:         *  methods that needs access to Jacl internals.
010:         *  
011:         * ========================================================================
012:         *  AUTHOR:  Michael J. McLennan
013:         *           Bell Labs Innovations for Lucent Technologies
014:         *           mmclennan@lucent.com
015:         *           http://www.tcltk.com/itcl
016:         *
017:         *     RCS:  $Id: ItclAccess.java,v 1.3 2006/01/26 19:49:18 mdejong Exp $
018:         * ========================================================================
019:         *           Copyright (c) 1993-1998  Lucent Technologies, Inc.
020:         * ------------------------------------------------------------------------
021:         * See the file "license.itcl" for information on usage and redistribution
022:         * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
023:         */
024:
025:        package tcl.lang;
026:
027:        import java.util.HashMap;
028:
029:        public class ItclAccess {
030:            public static boolean isProcCallFrame(CallFrame frame) {
031:                return frame.isProcCallFrame;
032:            }
033:
034:            public static void setProcCallFrameFalse(CallFrame frame) {
035:                frame.isProcCallFrame = false;
036:            }
037:
038:            public static TclObject[] getCallFrameObjv(CallFrame frame) {
039:                return frame.objv;
040:            }
041:
042:            public static Namespace getCallFrameNamespace(CallFrame frame) {
043:                return frame.ns;
044:            }
045:
046:            public static void setCallFrameObjv(CallFrame frame,
047:                    TclObject[] objv) {
048:                frame.objv = objv;
049:            }
050:
051:            public static CallFrame getCallFrame(Interp interp, int level) {
052:                CallFrame frame;
053:
054:                frame = interp.varFrame;
055:                while (frame != null && level > 0) {
056:                    frame = frame.callerVar;
057:                    level--;
058:                }
059:                return frame;
060:            }
061:
062:            public static CallFrame activateCallFrame(Interp interp,
063:                    CallFrame frame) {
064:                CallFrame oldFrame;
065:
066:                oldFrame = interp.varFrame;
067:                interp.varFrame = frame;
068:
069:                return oldFrame;
070:            }
071:
072:            public static CallFrame newCallFrame(Interp i) {
073:                return new CallFrame(i);
074:            }
075:
076:            public static CallFrame getVarFrame(Interp i) {
077:                return i.varFrame;
078:            }
079:
080:            public static HashMap getVarTable(CallFrame frame) {
081:                return frame.varTable;
082:            }
083:
084:            public static void setVarTable(CallFrame frame, HashMap table) {
085:                frame.varTable = table;
086:            }
087:
088:            public static Var newVar() {
089:                return new Var();
090:            }
091:
092:            public static void deleteVars(Interp interp, HashMap varTable) {
093:                Var.deleteVars(interp, varTable);
094:            }
095:
096:            public static int decrVarRefCount(Var var) {
097:                var.refCount -= 1;
098:                return var.refCount;
099:            }
100:
101:            public static Procedure newProcedure(Interp interp, Namespace ns,
102:                    String name, TclObject args, TclObject b, String sFileName,
103:                    int sLineNumber) throws TclException {
104:                return new Procedure(interp, ns, name, args, b, sFileName,
105:                        sLineNumber);
106:            }
107:
108:            public static TclObject[][] getArgList(Procedure proc) {
109:                return proc.argList;
110:            }
111:
112:            public static void setWrappedCommand(Procedure proc,
113:                    WrappedCommand wcmd) {
114:                proc.wcmd = wcmd;
115:            }
116:
117:            public static void assignLocalVar(Interp interp, String name,
118:                    TclObject val, CallFrame frame) throws TclException {
119:                if (frame.varTable == null) {
120:                    frame.varTable = new HashMap();
121:                }
122:                Var var = new Var();
123:                var.clearVarInHashtable(); // Needed to avoid "dangling namespace var" error
124:                var.table = frame.varTable;
125:                frame.varTable.put(name, var);
126:                interp.setVar(name, null, val, 0);
127:            }
128:
129:            public static void createObjVar(Var var, String key, Namespace ns,
130:                    HashMap table) {
131:                var.hashKey = key;
132:                var.ns = ns;
133:
134:                //  NOTE:  Tcl reports a "dangling upvar" error for variables
135:                //         with a null "hPtr" field.  Put something non-zero
136:                //         in here to keep Tcl_SetVar2() happy.  The only time
137:                //         this field is really used is it remove a variable
138:                //         from the hash table that contains it in CleanupVar,
139:                //         but since these variables are protected by their
140:                //         higher refCount, they will not be deleted by CleanupVar
141:                //         anyway.  These variables are unset and removed in
142:                //         ItclFreeObject().
143:
144:                var.table = table;
145:                var.refCount = 1; // protect from being deleted
146:            }
147:
148:            public static void createCommonVar(Var var, String key,
149:                    Namespace ns, HashMap table) {
150:                var.table = table;
151:                var.hashKey = key;
152:                var.ns = ns;
153:
154:                var.setVarNamespace();
155:                var.refCount++; // one use by namespace
156:                var.refCount++; // another use by class
157:            }
158:
159:            public static Object FirstHashEntry(HashMap table) {
160:                return Namespace.FirstHashEntry(table);
161:            }
162:
163:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.