| author | wenzelm |
| Sun, 02 Oct 2016 19:36:57 +0200 | |
| changeset 63996 | 3f47fec9edfc |
| parent 62042 | 6c6ccf573479 |
| child 67443 | 3abf6a722518 |
| permissions | -rw-r--r-- |
| 8011 | 1 |
(* Title: HOL/MicroJava/J/Term.thy |
| 41589 | 2 |
Author: David von Oheimb, Technische Universitaet Muenchen |
| 11070 | 3 |
*) |
| 8011 | 4 |
|
| 61361 | 5 |
section \<open>Expressions and Statements\<close> |
| 8011 | 6 |
|
| 16417 | 7 |
theory Term imports Value begin |
| 8011 | 8 |
|
| 62042 | 9 |
datatype binop = Eq | Add \<comment> "function codes for binary operation" |
| 9240 | 10 |
|
| 58310 | 11 |
datatype expr |
| 62042 | 12 |
= NewC cname \<comment> "class instance creation" |
13 |
| Cast cname expr \<comment> "type cast" |
|
14 |
| Lit val \<comment> "literal value, also references" |
|
15 |
| BinOp binop expr expr \<comment> "binary operation" |
|
16 |
| LAcc vname \<comment> "local (incl. parameter) access" |
|
17 |
| LAss vname expr ("_::=_" [90,90]90) \<comment> "local assign"
|
|
18 |
| FAcc cname expr vname ("{_}_.._" [10,90,99]90) \<comment> "field access"
|
|
| 10069 | 19 |
| FAss cname expr vname |
| 62042 | 20 |
expr ("{_}_.._:=_" [10,90,99,90]90) \<comment> "field ass."
|
| 10763 | 21 |
| Call cname expr mname |
| 62042 | 22 |
"ty list" "expr list" ("{_}_.._'( {_}_')" [10,90,99,10,10] 90) \<comment> "method call"
|
| 58263 | 23 |
|
24 |
datatype_compat expr |
|
|
10061
fe82134773dc
added HTML syntax; added spaces in normal syntax for better documents
kleing
parents:
10042
diff
changeset
|
25 |
|
| 58310 | 26 |
datatype stmt |
| 62042 | 27 |
= Skip \<comment> "empty statement" |
28 |
| Expr expr \<comment> "expression statement" |
|
|
10061
fe82134773dc
added HTML syntax; added spaces in normal syntax for better documents
kleing
parents:
10042
diff
changeset
|
29 |
| Comp stmt stmt ("_;; _" [61,60]60)
|
|
fe82134773dc
added HTML syntax; added spaces in normal syntax for better documents
kleing
parents:
10042
diff
changeset
|
30 |
| Cond expr stmt stmt ("If '(_') _ Else _" [80,79,79]70)
|
|
fe82134773dc
added HTML syntax; added spaces in normal syntax for better documents
kleing
parents:
10042
diff
changeset
|
31 |
| Loop expr stmt ("While '(_') _" [80,79]70)
|
|
fe82134773dc
added HTML syntax; added spaces in normal syntax for better documents
kleing
parents:
10042
diff
changeset
|
32 |
|
| 8011 | 33 |
end |
|
11026
a50365d21144
converted to Isar, simplifying recursion on class hierarchy
oheimb
parents:
10763
diff
changeset
|
34 |