projects
/
unix-history
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Start development on BSD 2
[unix-history]
/
.ref-BSD-1
/
pxp
/
lval.c
#
/*
* pxp - Pascal execution profiler
*
* Bill Joy UCB
* Version 1.0 August 1977
*/
#include
"whoami"
#include
"0.h"
#include
"tree.h"
/*
* A "variable"
*/
lvalue
(
r
)
int
*
r
;
{
register
*
c
, *
co
;
ppid
(
r
[
2
]);
for
(
c
=
r
[
3
];
c
!=
NIL
;
c
=
c
[
2
]) {
co
=
c
[
1
];
if
(
co
==
NIL
)
continue
;
switch
(
co
[
0
]) {
case
T_PTR
:
ppop
(
"^"
);
continue
;
case
T_ARY
:
arycod
(
co
[
1
]);
continue
;
case
T_FIELD
:
ppop
(
"."
);
ppid
(
co
[
1
]);
continue
;
case
T_ARGL
:
ppid
(
"{unexpected argument list}"
);
break
;
default
:
panic
(
"lval2"
);
}
}
}
/*
* Subscripting
*/
arycod
(
el
)
int
*
el
;
{
ppbra
(
"["
);
if
(
el
!=
NIL
)
for
(;;) {
rvalue
(
el
[
1
],
NIL
);
el
=
el
[
2
];
if
(
el
==
NIL
)
break
;
ppsep
(
", "
);
}
else
rvalue
(
NIL
,
NIL
);
ppket
(
"]"
);
}