src/HOL/Bali/Term.thy
changeset 35431 8758fe1fc9f8
parent 35416 d8d7d1b785af
child 37956 ee939247b2fb
equal deleted inserted replaced
35430:df2862dc23a8 35431:8758fe1fc9f8
    86 we save the local variables of the caller in the term Callee to restore them 
    86 we save the local variables of the caller in the term Callee to restore them 
    87 after method return. Also an exception must be restored after the finally
    87 after method return. Also an exception must be restored after the finally
    88 statement *}
    88 statement *}
    89 
    89 
    90 translations
    90 translations
    91  "locals" <= (type) "(lname, val) table"
    91  (type) "locals" <= (type) "(lname, val) table"
    92 
    92 
    93 datatype inv_mode                  --{* invocation mode for method calls *}
    93 datatype inv_mode                  --{* invocation mode for method calls *}
    94         = Static                   --{* static *}
    94         = Static                   --{* static *}
    95         | SuperM                   --{* super  *}
    95         | SuperM                   --{* super  *}
    96         | IntVir                   --{* interface or virtual *}
    96         | IntVir                   --{* interface or virtual *}
    98 record  sig =              --{* signature of a method, cf. 8.4.2  *}
    98 record  sig =              --{* signature of a method, cf. 8.4.2  *}
    99           name ::"mname"   --{* acutally belongs to Decl.thy *}
    99           name ::"mname"   --{* acutally belongs to Decl.thy *}
   100           parTs::"ty list"        
   100           parTs::"ty list"        
   101 
   101 
   102 translations
   102 translations
   103   "sig" <= (type) "\<lparr>name::mname,parTs::ty list\<rparr>"
   103   (type) "sig" <= (type) "\<lparr>name::mname,parTs::ty list\<rparr>"
   104   "sig" <= (type) "\<lparr>name::mname,parTs::ty list,\<dots>::'a\<rparr>"
   104   (type) "sig" <= (type) "\<lparr>name::mname,parTs::ty list,\<dots>::'a\<rparr>"
   105 
   105 
   106 --{* function codes for unary operations *}
   106 --{* function codes for unary operations *}
   107 datatype unop =  UPlus    -- {*{\tt +} unary plus*} 
   107 datatype unop =  UPlus    -- {*{\tt +} unary plus*} 
   108                | UMinus   -- {*{\tt -} unary minus*}
   108                | UMinus   -- {*{\tt -} unary minus*}
   109                | UBitNot  -- {*{\tt ~} bitwise NOT*}
   109                | UBitNot  -- {*{\tt ~} bitwise NOT*}
   235 intermediate steps of class-initialisation.
   235 intermediate steps of class-initialisation.
   236 *}
   236 *}
   237  
   237  
   238 types "term" = "(expr+stmt,var,expr list) sum3"
   238 types "term" = "(expr+stmt,var,expr list) sum3"
   239 translations
   239 translations
   240   "sig"   <= (type) "mname \<times> ty list"
   240   (type) "sig"   <= (type) "mname \<times> ty list"
   241   "var"   <= (type) "Term.var"
   241   (type) "term"  <= (type) "(expr+stmt,var,expr list) sum3"
   242   "expr"  <= (type) "Term.expr"
       
   243   "stmt"  <= (type) "Term.stmt"
       
   244   "term"  <= (type) "(expr+stmt,var,expr list) sum3"
       
   245 
   242 
   246 abbreviation this :: expr
   243 abbreviation this :: expr
   247   where "this == Acc (LVar This)"
   244   where "this == Acc (LVar This)"
   248 
   245 
   249 abbreviation LAcc :: "vname \<Rightarrow> expr" ("!!")
   246 abbreviation LAcc :: "vname \<Rightarrow> expr" ("!!")