1%The grammar files are saved in grammars.pl
    2
    3statement_with_semicolon(Data,Type,println(Expr,Type)) -->
    4        println_(Data,[
    5			expr(Data,Type,Expr),
    6			Type
    7		]).
    8
    9statement_with_semicolon(Data,Return_type,return(To_return)) -->
   10	return_(Data,[
   11		expr(Data,Return_type,To_return)
   12	]).
   13	
   14statement_with_semicolon(Data,_,plus_plus(Name)) --> 
   15        plus_plus_(Data,[
   16			var_name_(Data,int,Name)
   17        ]),!.
   18
   19statement_with_semicolon(Data,_,minus_minus(Name)) --> 
   20	minus_minus_(Data,[var_name_(Data,int,Name)]),!.
   21
   22statement_with_semicolon(Data,_,initialize_constant(Type,Name,Expr)) -->
   23	initialize_constant_(Data,[
   24		var_name_(Data,Type,Name),
   25		type(Data,Type),
   26		expr(Data,Type,Expr)
   27	]).
   28
   29
   30statement_with_semicolon(Data,_,set_array_size(Name,Size,Type)) -->
   31	set_array_size_(Data,[
   32		var_name_(Data,Name,[array,Type]),
   33		expr(Data,int,Size),
   34		type(Data,Type)
   35	]).
   36
   37statement_with_semicolon(Data,_,set_dict(Name,Index,Expr,Type)) -->
   38	set_dict_(Data,[
   39		var_name_(Data,[dict,Type],Name),
   40		parentheses_expr(Data,string,Index),
   41		expr(Data,Type,Expr)
   42	]).
   43statement_with_semicolon(Data,_,set_array_index(Name,Index,Expr,Type)) -->
   44	set_array_index_(Data,[
   45		var_name_(Data,[array,Type],Name),
   46		parentheses_expr(Data,int,Index),
   47		parentheses_expr(Data,Type,Expr)
   48	]).
   49
   50
   51statement_with_semicolon(Data,_,set_var(Name,Expr,Type)) -->
   52	set_var_(Data,[
   53		var_name_(Data,Type,Name),
   54		expr(Data,Type,Expr)
   55	]).
   56	
   57statement_with_semicolon(Data,_,set_instance_var(Name,Expr,Type)) -->
   58	set_var_(Data,[
   59		expr(Data,Type,this(Name)),
   60		expr(Data,Type,Expr)
   61	]).	
   62
   63statement_with_semicolon(Data,_,initialize_empty_var(Type,Name)) -->
   64	initialize_empty_var_(Data,[
   65		var_name_(Data,Type,Name),
   66		type(Data,Type)
   67	]).
   68
   69statement_with_semicolon(Data,_,throw(Expr)) -->
   70	throw_(Data,expr(Data,string,Expr)).
   71
   72statement_with_semicolon(Data,_,initialize_var(Name,Expr,Type)) -->
   73	initialize_var_(Data,[
   74		var_name_(Data,Type,Name),
   75		expr(Data,Type,Expr),
   76		type(Data,Type)
   77	]).
   78
   79statement_with_semicolon(Data,_,append_to_array(Name,Expr,Type)) -->
   80        append_to_array_(Data,[
   81			var_name_(Data,[array,Type],Name),
   82            expr(Data,Type,Expr)
   83        ]).
   84
   85statement_with_semicolon(Data,_,reverse_list_in_place(List,Type)) -->
   86	reverse_list_in_place_(Data,[
   87		parentheses_expr(Data,[array,Type],List)
   88	]).
   89
   90
   91statement_with_semicolon(Data,_,plus_equals(Name,Expr)) -->
   92		plus_equals_(Data,[
   93			var_name_(Data,int,Name),
   94            expr(Data,int,Expr)
   95		]).
   96
   97statement_with_semicolon(Data,_,divide_equals(Name,Expr)) -->
   98		divide_equals_(Data,[
   99			var_name_(Data,int,Name),
  100            expr(Data,int,Expr)
  101		]).
  102
  103
  104statement_with_semicolon(Data,_,modulo_equals(Name,Expr)) -->
  105		modulo_equals_(Data,[
  106			var_name_(Data,int,Name),
  107            expr(Data,int,Expr)
  108		]).
  109
  110statement_with_semicolon(Data,_,array_plus_equals(Name,Expr,Type)) -->
  111		array_plus_equals_(Data,[
  112			var_name_(Data,[array,Type],Name),
  113            expr(Data,[array,Type],Expr)
  114		]).
  115
  116statement_with_semicolon(Data,_,string_plus_equals(Name,Expr)) -->
  117		string_plus_equals_(Data,[
  118			var_name_(Data,string,Name),
  119            expr(Data,string,Expr)
  120		]).
  121
  122statement_with_semicolon(Data,_,minus_equals(Name,Expr)) -->
  123	minus_equals_(Data,[
  124		var_name_(Data,int,Name),
  125		expr(Data,int,Expr)
  126	]).
  127statement_with_semicolon(Data,_,append_to_string(Name,Expr)) -->
  128	append_to_string_(Data,[
  129		var_name_(Data,string,Name),
  130		expr(Data,string,Expr)
  131	]).
  132
  133
  134statement_with_semicolon(Data,_,times_equals(Name,Expr)) -->
  135	times_equals_(Data,[
  136		var_name_(Data,int,Name),
  137		expr(Data,int,Expr)
  138	]).
  139
  140statement_with_semicolon(Data,_,assert(Expr)) -->
  141        assert_(Data,[expr(Data,bool,Expr)]).
  142
  143statement_with_semicolon(Data,Type, function_call(Name,Params1,Params2)) -->
  144    function_call_(Data,[
  145		function_name(Data,Type,Name,Params2),
  146		function_call_parameters(Data,Params1,Params2)
  147	])