Source Code Cross Referenced for UplevelCmd.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:         * UplevelCmd.java --
003:         *
004:         *	Implements the "uplevel" command.
005:         *
006:         * Copyright (c) 1997 Cornell University.
007:         * Copyright (c) 1997 Sun Microsystems, Inc.
008:         *
009:         * See the file "license.terms" for information on usage and
010:         * redistribution of this file, and for a DISCLAIMER OF ALL
011:         * WARRANTIES.
012:         * 
013:         * RCS: @(#) $Id: UplevelCmd.java,v 1.5 2005/11/16 21:08:11 mdejong Exp $
014:         *
015:         */
016:
017:        package tcl.lang;
018:
019:        /*
020:         * This class implements the built-in "uplevel" command in Tcl.
021:         */
022:
023:        class UplevelCmd implements  Command {
024:
025:            /*
026:             *----------------------------------------------------------------------
027:             *
028:             * Tcl_UplevelObjCmd -> UplevelCmd.cmdProc
029:             *
030:             *	This procedure is invoked as part of the Command interface to
031:             *	process the "uplevel" Tcl command.  See the user documentation
032:             *	for details on what it does.
033:             *
034:             * Results:
035:             *	None.
036:             *
037:             * Side effects:
038:             *	See the user documentation.
039:             *
040:             *----------------------------------------------------------------------
041:             */
042:
043:            public void cmdProc(Interp interp, // Current interpreter.
044:                    TclObject[] objv) // Argument list.
045:                    throws TclException // A standard Tcl exception.
046:            {
047:                String optLevel;
048:                int result;
049:                CallFrame savedVarFrame, frame;
050:                int objc = objv.length;
051:                int objv_index;
052:                TclObject cmd;
053:
054:                if (objv.length < 2) {
055:                    throw new TclNumArgsException(interp, 1, objv,
056:                            "?level? command ?arg ...?");
057:                }
058:
059:                // Find the level to use for executing the command.
060:
061:                optLevel = objv[1].toString();
062:                // Java does not support passing a reference by refernece so use an array
063:                CallFrame[] frameArr = new CallFrame[1];
064:                result = CallFrame.getFrame(interp, optLevel, frameArr);
065:                frame = frameArr[0];
066:
067:                objc -= (result + 1);
068:                if (objc == 0) {
069:                    throw new TclNumArgsException(interp, 1, objv,
070:                            "?level? command ?arg ...?");
071:                }
072:                objv_index = (result + 1);
073:
074:                // Modify the interpreter state to execute in the given frame.
075:
076:                savedVarFrame = interp.varFrame;
077:                interp.varFrame = frame;
078:
079:                // Execute the residual arguments as a command.
080:
081:                if (objc == 1) {
082:                    cmd = objv[objv_index];
083:                } else {
084:                    cmd = Util.concat(objv_index, objv.length - 1, objv);
085:                }
086:
087:                try {
088:                    interp.eval(cmd, 0);
089:                } catch (TclException e) {
090:                    if (e.getCompletionCode() == TCL.ERROR) {
091:                        interp.addErrorInfo("\n    (\"uplevel\" body line "
092:                                + interp.errorLine + ")");
093:                    }
094:                    throw e;
095:                } finally {
096:                    interp.varFrame = savedVarFrame;
097:                }
098:            }
099:
100:        } // end UplevelCmd
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.