blob: cdef7d4b22576ccb5d954b1a0ea237b7ac8ce2b4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
comment(<!-- from http://www.php.net/manual/en/keyword.class.php -->)
inline_delimiter(<?php)
reserved(class) class(Cart) operator({)
reserved(var) local_variable($items)operator(;) comment(// Items in our shopping cart)
comment(// Add $num articles of $artnr to the cart)
reserved(function) function(add_item)operator(()local_variable($artnr)operator(,) local_variable($num)operator(\)) operator({)
local_variable($this)operator(->)ident(items)operator([)local_variable($artnr)operator(]) operator(+=) local_variable($num)operator(;)
operator(})
comment(// Take $num articles of $artnr out of the cart)
reserved(function) function(remove_item)operator(()local_variable($artnr)operator(,) local_variable($num)operator(\)) operator({)
reserved(if) operator(()local_variable($this)operator(->)ident(items)operator([)local_variable($artnr)operator(]) operator(>) local_variable($num)operator(\)) operator({)
local_variable($this)operator(->)ident(items)operator([)local_variable($artnr)operator(]) operator(-=) local_variable($num)operator(;)
reserved(return) pre_constant(true)operator(;)
operator(}) reserved(elseif) operator(()local_variable($this)operator(->)ident(items)operator([)local_variable($artnr)operator(]) operator(==) local_variable($num)operator(\)) operator({)
predefined(unset)operator(()local_variable($this)operator(->)ident(items)operator([)local_variable($artnr)operator(])operator(\))operator(;)
reserved(return) pre_constant(true)operator(;)
operator(}) reserved(else) operator({)
reserved(return) pre_constant(false)operator(;)
operator(})
operator(})
operator(})
inline_delimiter(?>)
inline_delimiter(<?php)
reserved(class) class(Cart) operator({)
comment(/* None of these will work in PHP 4. */)
reserved(var) local_variable($todays_date) operator(=) predefined(date)operator(()string<delimiter(")content(Y-m-d)delimiter(")>operator(\))operator(;)
reserved(var) local_variable($name) operator(=) local_variable($firstname)operator(;)
reserved(var) local_variable($owner) operator(=) string<delimiter(')content(Fred )delimiter(')> operator(.) string<delimiter(')content(Jones)delimiter(')>operator(;)
comment(/* Arrays containing constant values will, though. */)
reserved(var) local_variable($items) operator(=) predefined(array)operator(()string<delimiter(")content(VCR)delimiter(")>operator(,) string<delimiter(")content(TV)delimiter(")>operator(\))operator(;)
operator(})
comment(/* This is how it should be done. */)
reserved(class) class(Cart) operator({)
reserved(var) local_variable($todays_date)operator(;)
reserved(var) local_variable($name)operator(;)
reserved(var) local_variable($owner)operator(;)
reserved(var) local_variable($items) operator(=) predefined(array)operator(()string<delimiter(")content(VCR)delimiter(")>operator(,) string<delimiter(")content(TV)delimiter(")>operator(\))operator(;)
reserved(function) function(Cart)operator(()operator(\)) operator({)
local_variable($this)operator(->)ident(todays_date) operator(=) predefined(date)operator(()string<delimiter(")content(Y-m-d)delimiter(")>operator(\))operator(;)
local_variable($this)operator(->)ident(name) operator(=) predefined($GLOBALS)operator([)string<delimiter(')content(firstname)delimiter(')>operator(])operator(;)
comment(/* etc. . . */)
operator(})
operator(})
inline_delimiter(?>)
inline_delimiter(<?php)
reserved(class) class(A)
operator({)
reserved(function) function(foo)operator(()operator(\))
operator({)
reserved(if) operator(()predefined(isset)operator(()local_variable($this)operator(\))operator(\)) operator({)
predefined(echo) string<delimiter(')content($this is defined ()delimiter(')>operator(;)
predefined(echo) predefined(get_class)operator(()local_variable($this)operator(\))operator(;)
predefined(echo) string<delimiter(")content(\))char(\\n)delimiter(")>operator(;)
operator(}) reserved(else) operator({)
predefined(echo) string<delimiter(")char(\\$)content(this is not defined.)char(\\n)delimiter(")>operator(;)
operator(})
operator(})
operator(})
reserved(class) class(B)
operator({)
reserved(function) function(bar)operator(()operator(\))
operator({)
constant(A)operator(::)ident(foo)operator(()operator(\))operator(;)
operator(})
operator(})
local_variable($a) operator(=) reserved(new) constant(A)operator(()operator(\))operator(;)
local_variable($a)operator(->)ident(foo)operator(()operator(\))operator(;)
constant(A)operator(::)ident(foo)operator(()operator(\))operator(;)
local_variable($b) operator(=) reserved(new) constant(B)operator(()operator(\))operator(;)
local_variable($b)operator(->)ident(bar)operator(()operator(\))operator(;)
constant(B)operator(::)ident(bar)operator(()operator(\))operator(;)
inline_delimiter(?>)
|