Source Code Cross Referenced for CFGIntermediateRep.java in  » Code-Analyzer » soot » soot » util » cfgcmd » 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 » Code Analyzer » soot » soot.util.cfgcmd 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* Soot - a J*va Optimization Framework
002:         * Copyright (C) 2003 John Jorgensen
003:         *
004:         * This library is free software; you can redistribute it and/or
005:         * modify it under the terms of the GNU Lesser General Public
006:         * License as published by the Free Software Foundation; either
007:         * version 2.1 of the License, or (at your option) any later version.
008:         *
009:         * This library is distributed in the hope that it will be useful,
010:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
011:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
012:         * Lesser General Public License for more details.
013:         *
014:         * You should have received a copy of the GNU Lesser General Public
015:         * License along with this library; if not, write to the
016:         * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
017:         * Boston, MA 02111-1307, USA.
018:         */
019:
020:        package soot.util.cfgcmd;
021:
022:        import soot.Body;
023:        import soot.jimple.JimpleBody;
024:        import soot.baf.Baf;
025:        import soot.grimp.Grimp;
026:        import soot.shimple.Shimple;
027:
028:        /**
029:         * An enumeration type for representing the varieties of intermediate
030:         * representation available, for use in tools that compare or display
031:         * control flow graphs.
032:         *
033:         * 
034:         */
035:        public abstract class CFGIntermediateRep extends
036:                CFGOptionMatcher.CFGOption {
037:
038:            private CFGIntermediateRep(String name) {
039:                super (name);
040:            }
041:
042:            /**
043:             * Converts a <code>JimpleBody</code> into the
044:             * corresponding <code>Body</code> in this intermediate
045:             * representation.
046:             *
047:             * @param b The Jimple body to be represented.
048:             *
049:             * @return a {@link Body} in this intermediate representation which
050:             * represents the same method as <code>b</code>.
051:             */
052:            public abstract Body getBody(JimpleBody b);
053:
054:            public static final CFGIntermediateRep JIMPLE_IR = new CFGIntermediateRep(
055:                    "jimple") {
056:                public Body getBody(JimpleBody b) {
057:                    return b;
058:                }
059:            };
060:
061:            public static final CFGIntermediateRep BAF_IR = new CFGIntermediateRep(
062:                    "baf") {
063:                public Body getBody(JimpleBody b) {
064:                    return Baf.v().newBody(b);
065:                }
066:            };
067:
068:            public static final CFGIntermediateRep GRIMP_IR = new CFGIntermediateRep(
069:                    "grimp") {
070:                public Body getBody(JimpleBody b) {
071:                    return Grimp.v().newBody(b, "gb");
072:                }
073:            };
074:
075:            public static final CFGIntermediateRep SHIMPLE_IR = new CFGIntermediateRep(
076:                    "shimple") {
077:                public Body getBody(JimpleBody b) {
078:                    return Shimple.v().newBody(b);
079:                }
080:            };
081:
082:            public static final CFGIntermediateRep VIA_SHIMPLE_JIMPLE_IR = new CFGIntermediateRep(
083:                    "viaShimpleJimple") {
084:                public Body getBody(JimpleBody b) {
085:                    return Shimple.v().newJimpleBody(Shimple.v().newBody(b));
086:                }
087:            };
088:
089:            private final static CFGOptionMatcher irOptions = new CFGOptionMatcher(
090:                    new CFGIntermediateRep[] { JIMPLE_IR, BAF_IR, GRIMP_IR,
091:                            SHIMPLE_IR, VIA_SHIMPLE_JIMPLE_IR, });
092:
093:            /**
094:             * Returns the <code>CFGIntermediateRep</code> identified by the
095:             * passed name.
096:             *
097:             * @param name A {@link String} identifying the intermediate
098:             * representation.
099:             *
100:             * @return A <code>CFGIntermediateRep</code> object whose
101:             * {@link #getBody(JimpleBody)} method will create the desired intermediate
102:             * representation.
103:             */
104:            public static CFGIntermediateRep getIR(String name) {
105:                return (CFGIntermediateRep) irOptions.match(name);
106:            }
107:
108:            /**
109:             * Returns a string containing the names of all the
110:             * available <code>CFGIntermediateRep</code>s, separated by
111:             * '|' characters. 
112:             *
113:             * @param initialIndent The number of blank spaces to insert at the 
114:             *	                  beginning of the returned string. Ignored if 
115:             *                      negative.
116:             *
117:             * @param rightMargin   If positive, newlines will be inserted to try
118:             *                      to keep the length of each line in the
119:             *                      returned string less than or equal to
120:             *                      *<code>rightMargin</code>.
121:             *         
122:             * @param hangingIndent  If positive, this number of spaces will be
123:             *                       inserted immediately after each newline 
124:             *                       inserted to respect the <code>rightMargin</code>.
125:             */
126:            public static String help(int initialIndent, int rightMargin,
127:                    int hangingIndent) {
128:                return irOptions
129:                        .help(initialIndent, rightMargin, hangingIndent);
130:            }
131:
132:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.