Java Doc for CodeContext.java in  » Scripting » jacl » org » codehaus » janino » 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 » org.codehaus.janino 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.codehaus.janino.CodeContext

CodeContext
public class CodeContext (Code)
The context of the compilation of a function (constructor or method). Manages generation of byte code, the exception table, generation of line number tables, allocation of local variables, determining of stack size and local variable table size and flow analysis.

Inner Class :public class Offset
Inner Class :public class Inserter extends Offset
Inner Class :public class LineNumberOffset extends Offset
Inner Class :public interface FixUp


Constructor Summary
public  CodeContext(ClassFile classFile)
     Create an empty "Code" attribute.

Method Summary
public  voidaddExceptionTableEntry(Offset startPC, Offset endPC, Offset handlerPC, String catchTypeFD)
     Add another entry to the "exception_table" of this code attribute (see JVMS 4.7.3).
public  shortallocateLocalVariable(short size)
     Allocate space for a local variable of the given size (1 or 2) on the local variable array.
public  voidfixUp()
     Fix up all offsets.
public  voidflowAnalysis(String functionName)
     Checks the code for consistency; updates the "maxStack" member.
public  ClassFilegetClassFile()
    
public  InserternewInserter()
     Allocate an Inserter , set it to the current offset, and insert it before the current offset.
public  OffsetnewOffset()
    
public  voidpopInserter()
     Replace the current Inserter with the remembered one (see CodeContext.pushInserter(CodeContext.Inserter) ).
public  voidpushInserter(Inserter ins)
     Remember the current Inserter , then replace it with the new one.
public  voidrelocate()
    
public  voidrestoreLocalVariables()
     Restore the previous size of the local variables array.
public  voidsaveLocalVariables()
     Remember the current size of the local variables array.
protected  voidstoreCodeAttributeBody(DataOutputStream dos, short lineNumberTableAttributeNameIndex)
    
public  voidwrite(short lineNumber, byte[] b)
     Inserts a sequence of bytes at the current insertion position.
public  voidwriteBranch(short lineNumber, int opcode, Offset dst)
    
public  voidwriteOffset(short lineNumber, Offset src, Offset dst)
    
public  voidwriteShort(short lineNumber, int v)
    


Constructor Detail
CodeContext
public CodeContext(ClassFile classFile)(Code)
Create an empty "Code" attribute.




Method Detail
addExceptionTableEntry
public void addExceptionTableEntry(Offset startPC, Offset endPC, Offset handlerPC, String catchTypeFD)(Code)
Add another entry to the "exception_table" of this code attribute (see JVMS 4.7.3).
Parameters:
  startPC -
Parameters:
  endPC -
Parameters:
  handlerPC -
Parameters:
  catchTypeFD -



allocateLocalVariable
public short allocateLocalVariable(short size)(Code)
Allocate space for a local variable of the given size (1 or 2) on the local variable array. As a side effect, the "max_locals" field of the "Code" attribute is updated. The only way to deallocate local variables is to CodeContext.saveLocalVariables() and later CodeContext.restoreLocalVariables() .



fixUp
public void fixUp()(Code)
Fix up all offsets.



flowAnalysis
public void flowAnalysis(String functionName)(Code)
Checks the code for consistency; updates the "maxStack" member. Notice: On inconsistencies, a "RuntimeException" is thrown (KLUDGE).



getClassFile
public ClassFile getClassFile()(Code)



newInserter
public Inserter newInserter()(Code)
Allocate an Inserter , set it to the current offset, and insert it before the current offset. In clear text, this means that you can continue writing to the "Code" attribute, then CodeContext.pushInserter(CodeContext.Inserter) the Inserter , then write again (which inserts bytes into the "Code" attribute at the previously remembered position), and then CodeContext.popInserter() .



newOffset
public Offset newOffset()(Code)



popInserter
public void popInserter()(Code)
Replace the current Inserter with the remembered one (see CodeContext.pushInserter(CodeContext.Inserter) ).



pushInserter
public void pushInserter(Inserter ins)(Code)
Remember the current Inserter , then replace it with the new one.



relocate
public void relocate()(Code)



restoreLocalVariables
public void restoreLocalVariables()(Code)
Restore the previous size of the local variables array.



saveLocalVariables
public void saveLocalVariables()(Code)
Remember the current size of the local variables array.



storeCodeAttributeBody
protected void storeCodeAttributeBody(DataOutputStream dos, short lineNumberTableAttributeNameIndex) throws IOException(Code)

Parameters:
  dos -
Parameters:
  lineNumberTableAttributeNameIndex - 0 == don't generate a "LineNumberTable" attribute
throws:
  IOException -



write
public void write(short lineNumber, byte[] b)(Code)
Inserts a sequence of bytes at the current insertion position. Creates LineNumberOffset s as necessary.
Parameters:
  lineNumber - The line number that corresponds to the byte code, or -1
Parameters:
  b -



writeBranch
public void writeBranch(short lineNumber, int opcode, Offset dst)(Code)



writeOffset
public void writeOffset(short lineNumber, Offset src, Offset dst)(Code)



writeShort
public void writeShort(short lineNumber, int v)(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.