osprey/kgccfe/gnu/java/jcf-parse.c File Reference

#include "config.h"
#include "system.h"
#include "tree.h"
#include "obstack.h"
#include "flags.h"
#include "java-except.h"
#include "input.h"
#include "java-tree.h"
#include "toplev.h"
#include "parse.h"
#include "ggc.h"
#include "debug.h"
#include "assert.h"
#include "jcf.h"
#include "jcf-reader.c"

Include dependency graph for jcf-parse.c:

Go to the source code of this file.

Defines

#define JPOOL_UTF(JCF, INDEX)   CPOOL_UTF(&(JCF)->cpool, INDEX)
#define JPOOL_UTF_LENGTH(JCF, INDEX)   IDENTIFIER_LENGTH (JPOOL_UTF (JCF, INDEX))
#define JPOOL_UTF_DATA(JCF, INDEX)   ((const unsigned char *) IDENTIFIER_POINTER (JPOOL_UTF (JCF, INDEX)))
#define HANDLE_CONSTANT_Utf8(JCF, INDEX, LENGTH)
#define current_field   parse_roots[0]
#define current_method   parse_roots[1]
#define current_file_list   parse_roots[2]
#define HANDLE_SOURCEFILE(INDEX)   set_source_filename (jcf, INDEX)
#define HANDLE_CLASS_INFO(ACCESS_FLAGS, THIS, SUPER, INTERFACES_COUNT)
#define HANDLE_CLASS_INTERFACE(INDEX)   add_interface (current_class, get_class_constant (jcf, INDEX))
#define HANDLE_START_FIELD(ACCESS_FLAGS, NAME, SIGNATURE, ATTRIBUTE_COUNT)
#define HANDLE_END_FIELDS()   (current_field = NULL_TREE)
#define HANDLE_CONSTANTVALUE(INDEX)
#define HANDLE_METHOD(ACCESS_FLAGS, NAME, SIGNATURE, ATTRIBUTE_COUNT)
#define HANDLE_END_METHODS()
#define HANDLE_CODE_ATTRIBUTE(MAX_STACK, MAX_LOCALS, CODE_LENGTH)
#define HANDLE_LOCALVARIABLETABLE_ATTRIBUTE(COUNT)
#define HANDLE_LINENUMBERTABLE_ATTRIBUTE(COUNT)
#define HANDLE_EXCEPTIONS_ATTRIBUTE(COUNT)
#define HANDLE_INNERCLASSES_ATTRIBUTE(COUNT)   handle_innerclass_attribute (COUNT, jcf)
#define HANDLE_SYNTHETIC_ATTRIBUTE()
#define HANDLE_GCJCOMPILED_ATTRIBUTE()

Functions/Subroutines

static void
handle_innerclass_attribute 
PARAMS ((int count, JCF *))
static tree give_name_to_class PARAMS ((JCF *jcf, int index))
static void parse_zip_file_entries PARAMS ((void))
static void process_zip_dir PARAMS ((FILE *))
static void parse_source_file_1 PARAMS ((tree, FILE *))
static void set_source_filename PARAMS ((JCF *, int))
static void ggc_mark_jcf PARAMS ((void **))
static void jcf_parse PARAMS ((struct JCF *))
static void load_inner_classes PARAMS ((tree))
static void ggc_mark_jcf (void **elt)
static void set_source_filename (JCF *jcf, int index)
tree parse_signature (JCF *jcf, int sig_index)
void java_set_yydebug (int value)
tree get_constant (JCF *jcf, int index)
tree get_name_constant (JCF *jcf, int index)
static void handle_innerclass_attribute (int count, JCF *jcf)
static tree give_name_to_class (JCF *jcf, int i)
tree get_class_constant (JCF *jcf, int i)
int read_class (tree name)
void load_class (tree class_or_name, int verbose)
void jcf_parse (JCF *jcf)
static void load_inner_classes (tree cur_class)
void init_outgoing_cpool ()
static void parse_class_file ()
static void parse_source_file_1 (tree file, FILE *finput)
static void parse_source_file_2 ()
static void parse_source_file_3 ()
void add_predefined_file (tree name)
int predefined_filename_p (tree node)
int yyparse ()
static void parse_zip_file_entries (void)
static void process_zip_dir (FILE *finput)
void init_jcf_parse ()

Variables

struct obstacksaveable_obstack
struct obstack temporary_obstack
struct obstack permanent_obstack
int always_initialize_class_p
static tree parse_roots [3] = { NULL_TREE, NULL_TREE, NULL_TREE }
static struct JCF main_jcf [1]
static struct ZipFilelocalToFile
static int yydebug


Define Documentation

#define current_field   parse_roots[0]

Definition at line 79 of file jcf-parse.c.

#define current_file_list   parse_roots[2]

Definition at line 85 of file jcf-parse.c.

#define current_method   parse_roots[1]

Definition at line 82 of file jcf-parse.c.

#define HANDLE_CLASS_INFO ( ACCESS_FLAGS,
THIS,
SUPER,
INTERFACES_COUNT   ) 

Value:

{ tree super_class = SUPER==0 ? NULL_TREE : get_class_constant (jcf, SUPER); \
  current_class = give_name_to_class (jcf, THIS); \
  set_super_info (ACCESS_FLAGS, current_class, super_class, INTERFACES_COUNT);}

Definition at line 157 of file jcf-parse.c.

#define HANDLE_CLASS_INTERFACE ( INDEX   )     add_interface (current_class, get_class_constant (jcf, INDEX))

Definition at line 162 of file jcf-parse.c.

#define HANDLE_CODE_ATTRIBUTE ( MAX_STACK,
MAX_LOCALS,
CODE_LENGTH   ) 

Value:

{ DECL_MAX_STACK (current_method) = (MAX_STACK); \
  DECL_MAX_LOCALS (current_method) = (MAX_LOCALS); \
  DECL_CODE_LENGTH (current_method) = (CODE_LENGTH); \
  DECL_CODE_OFFSET (current_method) = JCF_TELL (jcf); }

Definition at line 199 of file jcf-parse.c.

#define HANDLE_CONSTANT_Utf8 ( JCF,
INDEX,
LENGTH   ) 

Value:

do { \
    unsigned char save;  unsigned char *text; \
    JCF_FILL (JCF, (LENGTH)+1); /* Make sure we read 1 byte beyond string. */ \
    text = (JCF)->read_ptr; \
    save = text[LENGTH]; \
    text[LENGTH] = 0; \
    (JCF)->cpool.data[INDEX] = (jword) get_identifier (text); \
    text[LENGTH] = save; \
    JCF_SKIP (JCF, LENGTH); } while (0)

Definition at line 55 of file jcf-parse.c.

Referenced by DEFUN().

#define HANDLE_CONSTANTVALUE ( INDEX   ) 

Value:

{ tree constant;  int index = INDEX; \
  if (! flag_emit_class_files && JPOOL_TAG (jcf, index) == CONSTANT_String) { \
    tree name = get_name_constant (jcf, JPOOL_USHORT1 (jcf, index)); \
    constant = build_utf8_ref (name); \
  } \
  else \
    constant = get_constant (jcf, index); \
  set_constant_value (current_field, constant); }

Definition at line 177 of file jcf-parse.c.

 
#define HANDLE_END_FIELDS (  )     (current_field = NULL_TREE)

Definition at line 174 of file jcf-parse.c.

Referenced by DEFUN().

 
#define HANDLE_END_METHODS (  ) 

Value:

{ tree handle_type = CLASS_TO_HANDLE_TYPE (current_class); \
  if (handle_type != current_class) layout_type (handle_type); \
  current_method = NULL_TREE; }

Definition at line 194 of file jcf-parse.c.

#define HANDLE_EXCEPTIONS_ATTRIBUTE ( COUNT   ) 

Value:

{ \
  int n = COUNT; \
  tree list = DECL_FUNCTION_THROWS (current_method); \
  while (--n >= 0) \
    { \
      tree thrown_class = get_class_constant (jcf, JCF_readu2 (jcf)); \
      list = tree_cons (NULL_TREE, thrown_class, list); \
    } \
  DECL_FUNCTION_THROWS (current_method) = nreverse (list); \
}

Definition at line 215 of file jcf-parse.c.

 
#define HANDLE_GCJCOMPILED_ATTRIBUTE (  ) 

Value:

{             \
  if (current_class == object_type_node)  \
    jcf->right_zip = 1;       \
}

Definition at line 239 of file jcf-parse.c.

Referenced by DEFUN().

#define HANDLE_INNERCLASSES_ATTRIBUTE ( COUNT   )     handle_innerclass_attribute (COUNT, jcf)

Definition at line 229 of file jcf-parse.c.

#define HANDLE_LINENUMBERTABLE_ATTRIBUTE ( COUNT   ) 

Value:

{ int n = (COUNT); \
  DECL_LINENUMBERS_OFFSET (current_method) = JCF_TELL (jcf) - 2; \
  JCF_SKIP (jcf, n * 4); }

Definition at line 210 of file jcf-parse.c.

#define HANDLE_LOCALVARIABLETABLE_ATTRIBUTE ( COUNT   ) 

Value:

{ int n = (COUNT); \
  DECL_LOCALVARIABLES_OFFSET (current_method) = JCF_TELL (jcf) - 2; \
  JCF_SKIP (jcf, n * 10); }

Definition at line 205 of file jcf-parse.c.

#define HANDLE_METHOD ( ACCESS_FLAGS,
NAME,
SIGNATURE,
ATTRIBUTE_COUNT   ) 

Value:

Definition at line 187 of file jcf-parse.c.

#define HANDLE_SOURCEFILE ( INDEX   )     set_source_filename (jcf, INDEX)

Definition at line 155 of file jcf-parse.c.

#define HANDLE_START_FIELD ( ACCESS_FLAGS,
NAME,
SIGNATURE,
ATTRIBUTE_COUNT   ) 

Value:

{ int sig_index = SIGNATURE; \
  current_field = add_field (current_class, get_name_constant (jcf, NAME), \
           parse_signature (jcf, sig_index), ACCESS_FLAGS); \
 set_java_signature (TREE_TYPE (current_field), JPOOL_UTF (jcf, sig_index)); \
 if ((ACCESS_FLAGS) & ACC_FINAL) \
   MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC (current_field); \
}

Definition at line 165 of file jcf-parse.c.

 
#define HANDLE_SYNTHETIC_ATTRIBUTE (  ) 

Value:

{                 \
  /* Irrelevant decls should have been nullified by the END macros. \
     We only handle the `Synthetic' attribute on method DECLs.    \
     DECL_ARTIFICIAL on fields is used for something else (See    \
     PUSH_FIELD in java-tree.h) */          \
  if (current_method)             \
    DECL_ARTIFICIAL (current_method) = 1;       \
}

Definition at line 232 of file jcf-parse.c.

Referenced by DEFUN().

#define JPOOL_UTF ( JCF,
INDEX   )     CPOOL_UTF(&(JCF)->cpool, INDEX)

Definition at line 51 of file jcf-parse.c.

#define JPOOL_UTF_DATA ( JCF,
INDEX   )     ((const unsigned char *) IDENTIFIER_POINTER (JPOOL_UTF (JCF, INDEX)))

#define JPOOL_UTF_LENGTH ( JCF,
INDEX   )     IDENTIFIER_LENGTH (JPOOL_UTF (JCF, INDEX))


Function Documentation

void add_predefined_file ( tree  name  ) 

Definition at line 914 of file jcf-parse.c.

Referenced by java_init_decl_processing().

tree get_class_constant ( JCF jcf,
int  i 
)

tree get_constant ( JCF jcf,
int  index 
)

tree get_name_constant ( JCF jcf,
int  index 
)

static void ggc_mark_jcf ( void **  elt  )  [static]

static tree give_name_to_class ( JCF jcf,
int  i 
) [static]

Definition at line 451 of file jcf-parse.c.

static void handle_innerclass_attribute ( int  count,
JCF jcf 
) [static]

void init_jcf_parse (  ) 

Definition at line 1290 of file jcf-parse.c.

References current_jcf, ggc_add_root(), ggc_mark_jcf(), and parse_roots.

Referenced by java_init_decl_processing().

void init_outgoing_cpool (  ) 

Definition at line 743 of file jcf-parse.c.

void java_set_yydebug ( int  value  ) 

Definition at line 263 of file jcf-parse.c.

void jcf_parse ( JCF jcf  ) 

void load_class ( tree  class_or_name,
int  verbose 
)

static void load_inner_classes ( tree  cur_class  )  [static]

static void load_inner_classes PARAMS ( (tree  )  [static]

static void jcf_parse PARAMS ( (struct JCF *)   )  [static]

static void ggc_mark_jcf PARAMS ( (void **)   )  [static]

static void set_source_filename PARAMS ( (JCF *, int)   )  [static]

static void parse_source_file_1 PARAMS ( (tree, FILE *)   )  [static]

static void process_zip_dir PARAMS ( (FILE *)   )  [static]

static void parse_zip_file_entries PARAMS ( (void  )  [static, read]

Definition at line 77 of file cplus-dem.c.

static tree give_name_to_class PARAMS ( (JCF *jcf, int index)   )  [static]

static void handle_innerclass_attribute PARAMS ( (int count, JCF *)   )  [static]

static void parse_class_file (  )  [static]

Definition at line 751 of file jcf-parse.c.

Referenced by parse_zip_file_entries().

tree parse_signature ( JCF jcf,
int  sig_index 
)

static void parse_source_file_1 ( tree  file,
FILE finput 
) [static]

static void parse_source_file_2 (  )  [static]

Definition at line 895 of file jcf-parse.c.

References java_error_count, and java_parse_abort_on_error.

Referenced by read_class().

static void parse_source_file_3 (  )  [static]

Definition at line 903 of file jcf-parse.c.

Referenced by read_class().

static void parse_zip_file_entries ( void   )  [static]

int predefined_filename_p ( tree  node  ) 

Definition at line 921 of file jcf-parse.c.

static void process_zip_dir ( FILE finput  )  [static]

int read_class ( tree  name  ) 

static void set_source_filename ( JCF jcf,
int  index 
) [static]

int yyparse ( void   ) 


Variable Documentation

Definition at line 97 of file expr.c.

Definition at line 90 of file jcf-parse.c.

struct JCF main_jcf[1] [static]

Definition at line 88 of file jcf-parse.c.

tree parse_roots[3] = { NULL_TREE, NULL_TREE, NULL_TREE } [static]

Definition at line 76 of file jcf-parse.c.

Referenced by init_jcf_parse().

Definition at line 237 of file collect2.c.

int yydebug [static]

Definition at line 247 of file jcf-parse.c.


Generated on Wed Apr 8 15:50:46 2009 for Open64 by  doxygen 1.5.6