CBMC
Loading...
Searching...
No Matches
Classes | Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
java_bytecode_parsert Class Referencefinal
+ Inheritance diagram for java_bytecode_parsert:
+ Collaboration diagram for java_bytecode_parsert:

Classes

struct   pool_entryt
 

Public Member Functions

 
 
- Public Member Functions inherited from parsert
  parsert (message_handlert &message_handler)
 
 
 
bool  eof ()
 
void  parse_error (const std::string &message, const std::string &before)
 
 
 
 
 
 
 
 
 
 
 
 
 

Public Attributes

 
- Public Attributes inherited from parsert
std::istream *  in
 
std::string  this_line
 
std::string  last_line
 
std::vector< exprtstack
 

Private Types

 
 
 
 
 
 
 
using  constant_poolt = std::vector< pool_entryt >
 

Private Member Functions

 
exprtconstant (u2 index)
 
 
 
 
 
 
 
 
  Corresponds to the element_value structure Described in Java 8 specification 4.7.6 https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.6 Parses the InnerClasses attribute for the current parsed class, which contains an array of information about its inner classes.
 
std::vector< irep_idtrexceptions_attribute ()
  Corresponds to the element_value structure Described in Java 8 specification 4.7.5 https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.5 Parses the Exceptions attribute for the current method, and returns a vector of exceptions.
 
 
 
 
 
  Corresponds to the element_value structure Described in Java 8 specification 4.7.16.1 https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.16.1.
 
 
 
 
 
void  rbytecode (std::vector< instructiont > &)
 
  Get the class references for the benefit of a dependency analysis.
 
 
void  get_annotation_class_refs (const std::vector< annotationt > &annotations)
  For each of the given annotations, get a reference to its class and recursively get class references of the values it stores.
 
 
  Parses the local variable type table of a method.
 
  Read method handle pointed to from constant pool entry at index, return type of method handle and name if lambda function is found.
 
  Read all entries of the BootstrapMethods attribute of a class file.
 
void  skip_bytes (std::size_t bytes)
 
template<typename T >
read ()
 
  Creates an unknown method handle and puts it into the parsed_class.
 

Private Attributes

 
 

Additional Inherited Members

- Protected Attributes inherited from parsert
 
 
 
 
 

Detailed Description

Definition at line 27 of file java_bytecode_parser.cpp.

Member Typedef Documentation

◆  annotationt

Definition at line 56 of file java_bytecode_parser.cpp.

◆  classt

Definition at line 52 of file java_bytecode_parser.cpp.

◆  constant_poolt

Definition at line 61 of file java_bytecode_parser.cpp.

◆  fieldt

Definition at line 54 of file java_bytecode_parser.cpp.

◆  instructiont

Definition at line 55 of file java_bytecode_parser.cpp.

◆  lambda_method_handlet

Definition at line 58 of file java_bytecode_parser.cpp.

◆  method_handle_typet

Definition at line 57 of file java_bytecode_parser.cpp.

◆  methodt

Definition at line 53 of file java_bytecode_parser.cpp.

Constructor & Destructor Documentation

◆  java_bytecode_parsert()

java_bytecode_parsert::java_bytecode_parsert ( bool  skip_instructions,
message_handlertmessage_handler 
)
inline

Definition at line 30 of file java_bytecode_parser.cpp.

Member Function Documentation

◆  constant()

exprt & java_bytecode_parsert::constant ( u2  index )
inlineprivate

Definition at line 81 of file java_bytecode_parser.cpp.

◆  get_annotation_class_refs()

void java_bytecode_parsert::get_annotation_class_refs ( const std::vector< annotationt > &  annotations )
private

For each of the given annotations, get a reference to its class and recursively get class references of the values it stores.

Definition at line 621 of file java_bytecode_parser.cpp.

◆  get_annotation_value_class_refs()

void java_bytecode_parsert::get_annotation_value_class_refs ( const exprtvalue )
private

See java_bytecode_parsert::get_annotation_class_refs.

For the different cases of exprt, see java_bytecode_parsert::get_relement_value.

Definition at line 635 of file java_bytecode_parser.cpp.

◆  get_class_refs()

void java_bytecode_parsert::get_class_refs ( )
private

Get the class references for the benefit of a dependency analysis.

Definition at line 506 of file java_bytecode_parser.cpp.

◆  get_class_refs_rec()

void java_bytecode_parsert::get_class_refs_rec ( const typetsrc )
private

Definition at line 591 of file java_bytecode_parser.cpp.

◆  get_relement_value()

exprt java_bytecode_parsert::get_relement_value ( )
private

Corresponds to the element_value structure Described in Java 8 specification 4.7.16.1 https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.16.1.

Returns
An exprt that represents the particular value of annotations field. This is usually one of: a byte, number of some sort, string, character, enum, Class type, array or another annotation.

Definition at line 1535 of file java_bytecode_parser.cpp.

◆  parse()

bool java_bytecode_parsert::parse ( )
overridevirtual

Implements parsert.

Definition at line 392 of file java_bytecode_parser.cpp.

◆  parse_local_variable_type_table()

void java_bytecode_parsert::parse_local_variable_type_table ( methodtmethod )
private

Parses the local variable type table of a method.

The LVTT holds generic type information for variables in the local variable table (LVT). At most as many variables as present in the LVT can be in the LVTT.

Definition at line 1860 of file java_bytecode_parser.cpp.

◆  parse_method_handle()

std::optional< java_bytecode_parsert::lambda_method_handlet > java_bytecode_parsert::parse_method_handle ( const class method_handle_infotentry )
private

Read method handle pointed to from constant pool entry at index, return type of method handle and name if lambda function is found.

Parameters
entry the constant pool entry of the methodhandle_info structure
Returns
the method_handle type of the methodhandle_structure, either for a recognized bootstrap method or for a lambda function

Definition at line 1930 of file java_bytecode_parser.cpp.

◆  pool_entry()

pool_entryt & java_bytecode_parsert::pool_entry ( u2  index )
inlineprivate

Definition at line 67 of file java_bytecode_parser.cpp.

◆  rbytecode()

void java_bytecode_parsert::rbytecode ( std::vector< instructiont > &  instructions )
private

Definition at line 894 of file java_bytecode_parser.cpp.

◆  rclass_attribute()

void java_bytecode_parsert::rclass_attribute ( )
private

Definition at line 1692 of file java_bytecode_parser.cpp.

◆  rClassFile()

void java_bytecode_parsert::rClassFile ( )
private

Definition at line 442 of file java_bytecode_parser.cpp.

◆  rcode_attribute()

void java_bytecode_parsert::rcode_attribute ( methodtmethod )
private

Definition at line 1296 of file java_bytecode_parser.cpp.

◆  rconstant_pool()

void java_bytecode_parsert::rconstant_pool ( )
private

Definition at line 653 of file java_bytecode_parser.cpp.

◆  read()

template<typename T >
T java_bytecode_parsert::read ( )
inlineprivate

Definition at line 132 of file java_bytecode_parser.cpp.

◆  read_bootstrapmethods_entry()

void java_bytecode_parsert::read_bootstrapmethods_entry ( )
private

Read all entries of the BootstrapMethods attribute of a class file.

Definition at line 1983 of file java_bytecode_parser.cpp.

◆  read_verification_type_info()

void java_bytecode_parsert::read_verification_type_info ( methodt::verification_type_infotv )
private

Definition at line 1454 of file java_bytecode_parser.cpp.

◆  relement_value_pairs()

void java_bytecode_parsert::relement_value_pairs ( annotationt::element_value_pairstelement_value_pairs )
private

Definition at line 1515 of file java_bytecode_parser.cpp.

◆  rexceptions_attribute()

std::vector< irep_idt > java_bytecode_parsert::rexceptions_attribute ( )
private

Corresponds to the element_value structure Described in Java 8 specification 4.7.5 https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.5 Parses the Exceptions attribute for the current method, and returns a vector of exceptions.

Definition at line 1677 of file java_bytecode_parser.cpp.

◆  rfield_attribute()

void java_bytecode_parsert::rfield_attribute ( fieldtfield )
private

Definition at line 1275 of file java_bytecode_parser.cpp.

◆  rfields()

void java_bytecode_parsert::rfields ( )
private

Definition at line 853 of file java_bytecode_parser.cpp.

◆  rinner_classes_attribute()

void java_bytecode_parsert::rinner_classes_attribute ( const u4attribute_length )
private

Corresponds to the element_value structure Described in Java 8 specification 4.7.6 https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.6 Parses the InnerClasses attribute for the current parsed class, which contains an array of information about its inner classes.

We are interested in getting information only for inner classes, which is determined by checking if the parsed class matches any of the inner classes in its inner class array. If the parsed class is not an inner class, then it is ignored. When a parsed class is an inner class, the accessibility information for the parsed class is overwritten, and the parsed class is marked as an inner class.

Definition at line 1601 of file java_bytecode_parser.cpp.

◆  rinterfaces()

void java_bytecode_parsert::rinterfaces ( )
private

Definition at line 844 of file java_bytecode_parser.cpp.

◆  rmethod()

void java_bytecode_parsert::rmethod ( )
private

Definition at line 1785 of file java_bytecode_parser.cpp.

◆  rmethod_attribute()

void java_bytecode_parsert::rmethod_attribute ( methodtmethod )
private

Definition at line 1162 of file java_bytecode_parser.cpp.

◆  rmethods()

void java_bytecode_parsert::rmethods ( )
private

Definition at line 1762 of file java_bytecode_parser.cpp.

◆  rRuntimeAnnotation()

void java_bytecode_parsert::rRuntimeAnnotation ( annotationtannotation )
private

Definition at line 1507 of file java_bytecode_parser.cpp.

◆  rRuntimeAnnotation_attribute()

void java_bytecode_parsert::rRuntimeAnnotation_attribute ( std::vector< annotationt > &  annotations )
private

Definition at line 1494 of file java_bytecode_parser.cpp.

◆  skip_bytes()

void java_bytecode_parsert::skip_bytes ( std::size_t  bytes )
inlineprivate

Definition at line 118 of file java_bytecode_parser.cpp.

◆  store_unknown_method_handle()

void java_bytecode_parsert::store_unknown_method_handle ( size_t  bootstrap_method_index )
private

Creates an unknown method handle and puts it into the parsed_class.

Parameters
bootstrap_method_index The current index in the bootstrap entry table

Definition at line 2117 of file java_bytecode_parser.cpp.

◆  type_entry()

const typet java_bytecode_parsert::type_entry ( u2  index )
inlineprivate

Definition at line 86 of file java_bytecode_parser.cpp.

Member Data Documentation

◆  constant_pool

constant_poolt java_bytecode_parsert::constant_pool
private

Definition at line 63 of file java_bytecode_parser.cpp.

◆  parse_tree

java_bytecode_parse_treet java_bytecode_parsert::parse_tree

Definition at line 49 of file java_bytecode_parser.cpp.

◆  skip_instructions

const bool java_bytecode_parsert::skip_instructions = false
private

Definition at line 65 of file java_bytecode_parser.cpp.


The documentation for this class was generated from the following file:

AltStyle によって変換されたページ (->オリジナル) /