<commit_before>/*
(* Joust: a Java lexer, parser, and pretty-printer written in OCaml
 * Copyright (C) 2001  <NAME> <<EMAIL>>
 * Released under the GNU General Public License
 *
 * LALR(1) (ocamlyacc) grammar for Java
 *
 * Attempts to conform to:
 * The Java Language Specification, Second Edition
 * - <NAME>, <NAME>, <NAME>, <NAME>
 * 
 * Some modifications by <NAME>.
 * 
 * TODO: support for generics!
 *)
*/
%{
open Common
open Ast_java

(*****************************************************************************)
(* Wrappers *)
(*****************************************************************************)
let myfst = fst  

(*****************************************************************************)
(* Helpers *)
(*****************************************************************************)

let synth_id (s,ii) = (s,[ii])

let this_ident ii = synth_id ("this", ii)
let super_ident ii = synth_id ("super", ii)

let named_type (str, ii) = TypeName [synth_id (str,ii)], noii

let void_type ii = named_type ("void", ii)


type var_decl_id = var_decl_idbis wrap
  and var_decl_idbis = 
  | IdentDecl of ident
  | ArrayDecl of var_decl_id
(* and mdeclarator = var_decl_id * vars *)
(* and var_decls = (var_decl_id * init option) list *)<commit_msg>* lang_java/parsing/parser_java.mly: todos<commit_after>/*
(* Joust: a Java lexer, parser, and pretty-printer written in OCaml
 * Copyright (C) 2001  <NAME> <<EMAIL>>
 * Released under the GNU General Public License
 *
 * LALR(1) (ocamlyacc) grammar for Java
 *
 * Attempts to conform to:
 * The Java Language Specification, Second Edition
 * - <NAME>, <NAME>, <NAME>, <NAME>
 * 
 * Some modifications by <NAME>.
 * 
 * TODO: 
 *  - support for generics
 *  - support annotations
 *  - support enums
 *  - etc.
 *)
*/
%{
open Common
open Ast_java

(*****************************************************************************)
(* Wrappers *)
(*****************************************************************************)
let myfst = fst  

(*****************************************************************************)
(* Helpers *)
(*****************************************************************************)

let synth_id (s,ii) = (s,[ii])

let this_ident ii = synth_id ("this", ii)
let super_ident ii = synth_id ("super", ii)

let named_type (str, ii) = TypeName [synth_id (str,ii)], noii

let void_type ii = named_type ("void", ii)


type var_decl_id = var_decl_idbis wrap
  and var_decl_idbis = 
  | IdentDecl of ident
  | ArrayDecl of var_decl_id
(* and mdeclarator = var_decl_id * vars *)
(* and var_decls = (var_decl_id * init option) list *)
{'fraction_non_alphanumeric': 0.34083969465648856, 'fraction_numerical': 0.003816793893129771, 'mean_word_length': 5.31566265060241, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3608102', 'n_tokens_mistral': 808, 'n_tokens_neox': 745, 'n_words': 229}