A\ß Java 7J7M# EPP .°!7#Öj5L@OKÚº?
Ú;ðöõåQðöP_[ ichisugi@etl.go.jp

õ21

.Ü

(&BÚB.g­ #&>637M
I?S;.;.Ò
%â'K0»*A+2; $Þ&4KA\ß Java 7J7M#*;ÖRÞK("r+d4
EPP ²K2°!7#Öj5L@O+$
I'2K3
4&÷9K3%5L@ORÖ4K(+H#&2
cx¬V2ºêÂ82¦$; 0M'3S2
.H6*åR ÙKA2;/7MI?
1IAb I*)2Ò*;Ö 2 EPP S;
2À.WØRW?&4K3L+HJ2+ÞKW (EPP plug-in) .²'ß+* 1*KS4E+ä«Í©î.MhR2
K3°sÞRýÖ¼ 2+/2 (1) °$7651 7MI?S;.ã+Bä(R¿(
4K$7..K.å2 (2) ¼+H#&°r© &4K31*KS4E./)682/2¼Ø3Kå2 (3) ]S14K6r#ÑS Òt10¯î.­+#¿*ÖMhRç&4
14K.å*) ë63%5L@O/
K3L/1*KS4E.E5¿2 &(46.R&qK('LI.å !C(.WR®KáC
G$L(Rr#¿+ 22 plug-in 7MI>.v RË R # (K3.Üç2WRüKÂ[
9&4K3ºÕ L2r¸8 .52+HJ2W.ÖØ6ºÒØ «L3$Ò+27MI?S;
1 4S(M GS77MI@;.
2ÀRWØ2WR®KE5¿*4S57R¡AK(+HJ2W +'.;Ö.$Þ
6PC.Ö7ØRË6+K(RA&4K3
ê.7MI?S;/2%â*K0».;/'+2 mixin RÖ4&6WØLÑ
&@'2K36+t2Ö¿7MI?S;+ ××17Rj4KèêRª%2A\ß7
9Ü(LK;Ö/â27MI?S; J7M# EPP h'.²IìRG A&4K..Ò/âØ.KèR)#&4K3.(/2 [9, 10]3
)×.H6*åRY ä&4K3%£'/27MI?S; 2À.WØ+Mh.&#7(&È62EPP .
1. ;õ 4;Ö.2RK(R2 °!7#Öj+$4&÷9K3"r+d&4K3
FileS-

ignature

2

EPP

..Ü

*;Ö .27JGS+Ë
EPP /2 Java ;+A\ÖRÞ' KH6&²I+ÖK k9KA+/29Ü*; +K7J7M#'2K3144
EPP plugÖRKJf#2Ö; 2ÀR* in R Java ).'' #epp name(4
L0*I*43 29Ü*;Ö â &A¡K('2 Java .£êRA\24Ö®o'/2L/^A&¯d+*#& &4 RÞK( ' K3 plug-in $7.Z@ ä
K3·.±#(&) G$L&4
plug-in R$g+¯J«@(BK; 2À.KR&*;ÖR '*L02Õ.
K37J7M# õ2K Java 
ÞKèêB2K 2; 2À %â'K0 )/2n.
Java S14IRK3 EPP /q2»*A2LBË6'/*43
7MI@.R¼8+õ2KA2n+
2. 7MI>+(#&2r 7@;Ö 2' K3±4.; 2À+* * ÙÖL*45W+ L9K.'0#RK(
EPP /2 Java ;RA\KA.7J7M#*#&4K3(& '*2;õ+HK4;Ö
2..2A\ Java ..A.5L@O
9&.;Ö/6 2O7.²' 7 2 Java ;.) 6¼$K.
MI>+ª4L*437MI>+/2 A.5L@O(&Ö4K(B' K3
r.ä4ÖRGíKr¸/;(S)*43 EPP .)r©B6 EPP 'A\L
g+/2;È.R?+H#&Ö Gí Java 7' L& J26Common Lisp[18] '
L EPP7'6((I#7LK3S14
L2L 7MI>+¼bILK(+*K3Ò.;õ.íç 2±4.; 2 KL04()/ Java #@*I0)
À+ÙÖLKG /^A&12ÙÖLK 'B#3
1

#epp jp.go.etl.epp.AssociationArrayclass Test {public static void main(String[] args){// Declaring and initializing//an association array variable.
String[String] a = new String[String];a["key1"] = "val1";a["key2"] = "val2";
System.out.println(a["key1"].equals("val1"));//true// Type-safe assignment.
Object[String] a1 = a;a = new String[Object];}}// Because of contra-variant rule,//the following code causes type error.
// Object[Object] a2 = a;#epp jp.go.etl.epp.MultipleInheritanceclass MITest {public static void main(String[] args){
C obj = new C();
System.out.println(obj.m11() == 11); // true
System.out.println(obj.m12() == 12); // true
System.out.println(obj.m21() == 21); // true
System.out.println(obj.m22() == 22); // true}}class C1 {int m11() { return 11; }int m12() { return 12; }}class C2 {int m21() { return 21; }int m22() { return 22; }}class C extends C1, C2 {}¿ 1: cx¬V plug-in .1ÖF¿ 2: ºêÂ8 plug-in .1ÖFEPP ÈE/26Z4þ..A\ *8K
(726Õ.A\ÖR$g+ýÖ' K(*)× composability (6+7.2$'2K3 EPP /2
6).¿Ý7+1½K4A\ìRf!2* $â+4 composability Rf#A\ß&@'2K3
EPP .2 &!C/2 Java ;+/,³
& I2¹.;. 6¼ 2&@5L@O(&B»ÖK( ' K3&(&18*4*).å 2K3% .ºêÂ8+tbKA+/2B62Vd 9Ü'2K3+
4°sÞRýÖ¼ 2+ë6åJava ;/2I­..,³R+&4K3
I­..,³/2 Java ;.S14I.
 ÙR$*L0*I*4å'2K3 2Java ;.o/2;.Ò ¡'2K2j£
K 'I. signature G¡K.'2
å/L¿¡ + ÙK( ' K3
3 EPP plug-in .F
EPP .°!7#Öj5L@O/2 Java 
3.1 Association array plug-in
S14I f$I­.,³. 2ÖjRHJKûØ&2 plug-in 7MI>M. API (&¿ 1/2cx¬VR K plug-in .1ÖF'2 ª4K3.5L@O/2)×+÷9KH6
K3cx¬V/2 perl *).; f$'j *2°sÞRýÖ¼ 2+ë6åR Ù&'2.É//#EJ 27MI> I/2
¬V($4S57'26( ' K3 4K3¿ 1. String[String] /2 (& 9+ String¹.I. signature +°'2KH6*cx¬VRJ°e'2K3. plug-  7MI@.¼
,³K($g+2.¼
I. signain /2 contra-variant rule +ã#°¿+!Q*à
ture
R¼8KB.
(I2).H6*±
q *8K.ÒRÙÖ&4K3'¼R*69 M6 9F802ºêÂ8cx¬V8.2/27J7M#+H#&2
plug-in.o2 delegation KA#)R/#EJ8.2( C(R1#w+¼
ÞKA+/2+B..1I)
LK3.H6*A#)Rf$  I*L0*I*43Kè'2ºêÂ8R*#&4KI/2
3.2 ºêÂ8 plug-indelegation KA#) ÞLKA2 signature ¼ØK3ºêÂ8R*#&4K
¿ 2/2ºêÂ8R K plug-in .1ÖF'2
IRI+¹.IºêÂ8&B2ÓÏ
K3
LKJô¼LK
M6 9ºêÂ8R*#&4KI/27J7M#+H#&225).6+B..1I7
 514K­..,³ 2Ko'B]S1
R4SS¼Õ(&²KI+¼LK3
4K ' K M6 9F80514K Fa >2+B..1I'¡öL&4KA
I A1, A2 Rf!2514K Fb 2I#) 0LI delegate KA#) 2I
B1 , B2 Rf$(K3 A1 .¼ B1 +,³
+ÞLK3
2 B2 .¼ A2 +,³K(K(2.
** 2.H6* 8*'/2 this .&2$.514KRô¼' K M6 9>ô**#J2 C .4SSR C2 °.
2514K Fa .UË fLg2 Fa2

#epp jp.go.etl.epp.Symbol
import jp.go.etl.epp.epp.Symbol;
Fa

Fb

A1

B1

A2

B2

public class TestSymbol {public static void main(String args[]){Symbol x = :foo;
Symbol y = :"+";
System.out.println(x == :foo); // true
System.out.println(y == :foo); // false}}¿ 3: 514K­..,³* Fb Br#¿+ÑS14KLKH6+' K M6 9
 ,³¯©+ Ùaß*K7 µ>L&4Kg2
&@/\K7+°I+2LRðõ'K M6 9F802ºêÂ8 plug-in R1
Ö&4K7MI> 2­B#&I C.1I.1$+I C r©RA¡g2LR8I+' K M6 9 +2
I C .¼ 2%¿+I C .¼Ü
ç+,³&4*4+B©OI20,³(&& LK(/*4 M6 9)h.å/2B!MS24LBðö¿+/ Ùß*å'2K35L@ORÈKh'êÜ*E/@Mh.2Õ'2K3
1. LI.D# 4*åR5L@O¡
225L@O.F*plug-in .+.v R2'BËK3
2. plug-in  DJ4(+a9Ü*èR
Þ8J2ß*JZþ..;A\Rß+K3%£.5L@O LI.ER).¯îüí +$4&2â*KÜ/> *#&4*43LR*6A+/2Õº.27JG
SR&?K9Ü 2K3 2*(B #%'/2.5L@O/6>Ö&4K(;/z8&4K3%5L@O 4 +&h+÷9åRÙ&4K +$4&/2 7R H3 9R'÷9K3
5

EPP.â÷+9Ü* plug-in( EPP plug-in .)/2Lr©
'A\L Java ;'â÷L&4K3
.R'/2 EPP .â÷+9Ü* plug-in '2K2
Symbol plug-in, SystemMixin plug-in, BackQuote
plug-in .Ö+$4&÷9K3
EPP
EPP

5.1

Symbol plug-in

Symbol / lisp *).; f$'°'2J2g+ K identity .L £cVHJB©
+*8K(R6^(K3¿ 4 /2 EPP . \Symbol plug-in" R1# Java 7MI@.F'2K3
3¿ 4: Symbol plug-in R1#7MI@F&ODVV.

&ODVV.

&ODVV.

&ROODERUDWLRQ&&ROODERUDWLRQ&&ROODERUDWLRQ&&ROODERUDWLRQ&¿ 5: class ( collaboration.J&IK/2MS(L+® identi>/£cVJ&IK'JLK3/2 EPP .)?+ 4&/2C`j£D°.¶CRJR8A(&2Ò*Öè+1OL&4K3
Symboler
Symbol5.2

SystemMixin plug-in

5.2.1

collaboration-based designI/ÑýÖ H3sÞ`®. +(&Á '*4(46( 2)M IA»L&4K [20]3.å+¯& [8][15] *). Ùèê ª%L&
4K 2t6+ collaboration-based design[21] .
²IìR®\K£ 4$  L&4K [21][19][16]3collaboration (/2¿ 5+2KH6+2Õ.I
.? I¯c.4 RÝAB.'2K3[19] '/2 C++ . template (I.-(.
ÖRÖ4& collaboration-based design R*6
èêRª%& J2.ÑýÖ. +R mixin layer(S'4K3
SystemMixin plug-in /2 Java ;RA\2
mixin layer (;<$Ö*system mixin (S'4K+R ß+K plug-in '2K3 mixin[2]/2 avors D CLOS *).&@'1Öß*;Ö'2ÑýÖß*I.WR¡öK
A.B.'2K3 system mixin /2Õ.I.
W(*K mixin R4$ 2(>(A+&4
DB.'2K31$. system mixin 1$. collaboration R K3
EPP H3 EPP plug-in .)/2. system mixin .Ö(2 Java ;.n.Ö:double
Mixins which
define thestandard Java
grammar.

A customized
pre-processor
class.







:int

 :double¿ 7: C`j£8.°sÞ.Þ

Mixinsspecified as
EPP plug-ins.

A\ß*°&@
7.1 °!7#1..Ü
7¿ 6: EPP RjíK mixin°!7#1'/2j£ LC`j£.
?.)+2°sÞRÞK3C`j£..)/2 immutable * 67('2J2 TypeChecker
67(+H#&2°sÞb ..)+¼
LK3.H6+2°!7#1/2 67(AM1I 4@'/*2@M¯Õ°7MI?S4K'â÷L&4K3

R1# decorator pattern *)RÁî14&â÷LK3
EPP plug-in /2 system mixin ( Java I.
Ý'2K3 plug-in /2]S14K ß'2
KA2;A\WR2)RG$+
04*J¬hK(Bß'2K3
5.2.2
EPP RjíK mixin
EPP .?/2 Epp (46eM. 1$.
I(&¡öLK3 I¡ö/Õ.
mixin +]L&4K3 EPP Rä#K(2>
E5. Java ;1RjíK mixin (2).''A¡L plug-in RjíK mixinR9&$*O&1$.7J7M#*Epp(46eM.I+Rj42LR3õ('). 2R$8K3

7.2

Type

67(

I Type /2 EPP .U+ 4&°RJ 
KA.'°'2K39&.°/Rf#&
J2..eM+H#&2).¶C.° Rì·' K3
plug-in /2*Rf$I Type .6
IR¡öK(+H#&2*'°R&
qK( ' K3
Type 67(/2°RJ KA+9Ü*sÞRÈfK '26°.4J7/K¡ö*
43°.4J/2°$7.¯©R¡öKI Epp
5.3 BackQuote plug-in.A#)( TypeChecker 67(+H#&¡öLK3
BackQuote plug-in /2 lisp . backquote macro
I°RJ Type 67(/2 :class (($ÖR KB.'2¼ 2Râ÷Kè2 46Rf#&4K3I°+¯KHJ_4
C`j£R)?+¡ +-A«AKH6 sÞR3KA+/2I°RJ Type 67+KB.'2K3 lisp . backquote macro ($Ò ( I2I+ ClassInfo (46'°R¯Jõ
+2 \," D \,@" .âR1#&2Sw.C`j£ 32KI).H6*A#)Rf#&4K 2
.?+u4. Java .w.&R-A«@( '*).sÞ/2 ClassInfo I3K( ' K3
K3
ClassInfo /9Ü+*#g+2 Type 67
(+H#& lazy +÷íLK3.Öj. '2.KKIB6( ' K3I
6 A\ß*Ñ××1
.?©R lazy +÷íH6(&4K2>+.
A\ß*Ñ××1.52+$4&/2' Ò?+I.?© ) I2Lg+/2
+ [10] '÷9&4K 2'/2¡ +!gK3 EPP /%¿+^7 2K0,³'2K(ì 2F+8IRÞK3F8022KI.
EPP f$1/2 Yacc *).167
-L/1O+2Ñ×× [1] +H#& L& 1I+rr©RA¡K(.8I(*K3
514K F RS14K&4Kg+22KI
4K3.1/2ÃÑ×KKBµ@Zþ..£êA\R*6A. \hook" RºÕª4&4K3  C . ClassInfo +A&2K(26F /F80(46"Ïâ+GíQRÞ C ¡öL&4K514K+,³&4K7(4K hook (&2 expressionTop, expressionRight,6sÞ r#¿+âLK3.sÞ/2fL514K+,³&4K514K.r#ÑS14
expressionLeft (46A#) ¡öL&4K3
K.A+1OLK3
Mixin RÞ2LI.A#).~4RÂ8* 2 plug-in / ClassInfo .6IR¡ö
A\K(+H#&2"Ïâ+*GíQ
2A\LI°RK( ' K3
RÞK( ' K3
hook R1#A\+Þ82A#).Ñ¡ö20#
(I#2£U,³ 2*)B*6( ' 2 7.3 TypeChecker 67(^A&Zþ..£êA\ *8K3
Expression

4

class ExpandOperatorOverloadingOfMinus
extends TypeChecker {public Tree call(Tree tree) {Tree[] newArgs = typeCheckArgs(tree);Type t1 = newArgs[0].type();if (t1.tag() == :class){// Return the AST of "e1.minus(e2)" .
return `(invokeExp ,(newArgs[0])(id minus) (argumentList ,(newArgs[1])));} else {return orig.call(tree.modifyArgs(newArgs));}}}¿ 8: Operator overloading RK decorator

boolean isSuperType(Type t1, Type t2){
if (t1.tag() == :assocArray){if (t2.tag() == :assocArray){
AssocArrayType a1 = (AssocArrayType)t1;
AssocArrayType a2 = (AssocArrayType)t2;// Contra-variant rule.
return isSuperType(a1.getKeyType(),a2.getKeyType())&& isSuperType(a2.getValueType(),
a1.getValueType());} else {return false;}} else {return original(t1, t2);}}

¿ 9: isSuperType A#). mixin +HKA\
è5jD¦$; 2°R).H6+6 R¡öKB. 2 TypeChecker 67('2K3
TypeChecker /2 call (46eM.A#)Rf
plug-in /2E5. Java +*447S(I$3L/2°sÞ.$4&4*4 tree R°sÞb R&qKA+2*
TypeNameChecker
tree +¼KA#)'2K*¿ 7+3
R¡ö&2&6K+åK(' K3
TypeChecker /2.).¶C( TypeChecker
R¯cbK/#EJ+åL&4K3°!7# 7.5 °.­.¯©
1'/2.)(+2..).+Ë»
K TypeChecker R3õ&2..).°!7# 2$.°.­.¯©*)2&@QÉ+TK
R*63°+¯K4JR¡öKA.A#) 2 mixin+H#&A\ß*A#)(&¡öL&4K3
TypeChecker /2 tree RYÕ+(#& tree RÁ(464S578G0H2>M plug-in /2 mixin RÞK(+H#&°.­.
Í$*). 2R*#&B >O*43 plug-in /2 ¯©R¼f6A\K( ' K3
¿ 9 /2cx¬V plug-in .).K
£êRA\&è5jD¦$;RÞ2LRn
. Java ;+>MÍ$K TypeChecker R¡ '2K3A#) isSuperType /2ãKYÕ.° 2
ãfYÕ.°. super type )6 Rì KA#öK(';A\R' K3
9&. TypeChecker /2 decorator pattern [5] )'2K3¿ 9 '/2 contra-variant rule +ã#&2+H#&A\K( ' K3¿ 8/2f¦$; cx¬V$7.­.¯©R¡ö&4K3*7MI@?' original (46eM.A#)3õ
\-" . TypeChecker +ÞK decorator .F'2
K3. decorator /2Ã. :IS).° I 2K 2L/2 SystemMixin plug-in &qj£'24J¿+/ super class .A#)3õ
°'2K*I02($'2K3+
e1.minus(e2)7.6*°.&qF(46A#)3õw+>MÍ$&Á3
)h.A\A +@RÖ4K(+H#&2"r.H6+ plug-in /2Ò³.è5jD¦$;.4J +Z4þ..;A\
2 composability .4
RA\K(B' K3
plug-in(&ß+*K3* 2 decorator pattern RÖ4&4KA2$g
ÉF(&2 3R'÷9cx¬V..26+ÁÖL¹. plug-in $ TypeChecker RA (I4S+$4&÷9K3.
plug-in /2210
\(&B2&@/ô#ùK3$>J2 'L&4K3
4 composability RüíK( ' K3 cx¬V°Rj£ ' KH6+£êRA\3
7.4 TypeNameChecker
67( isSupetType *)2°$7.¯©R¡öKA#).A\3
TypeNameChecker 67(/2°!7# cx¬V°RJ K2 Type .6I2
1+ 4&2°e* \String" *)+D247
AssociationArrayType .¡ö3
S(I*\String[]" *)+RJ KC`j£ 2è+).H6*°RJ RÙ¡K
 cx¬V°RJC`j£.4JR¡öK Type67('2K3
NameChecker .¡ö3. TypeNameChecker
TypeNameChecker .1OLè/ TypeChecker (/2cx¬V° U'/ AssociationArrayType$'2A#) call .YÕ(&äL Tree°(&OL2õ2LK)?'/2
R2°sÞb . Tree +¼&Á3
Hashtable +*KH6+LK3
5

#¿+¼f' K(466^ 2K3 2 EPP'/7J7M#ä#g+&@.jí Ù>J?+¼ØK(/*4.'2.6^/aÜ'2K3
  ê. SystemMixin plug-in .'/2
mixin .A#)3õ r. Java I.A#)3õ+9&1Ö¯î24(46å 2
K3. 08#)R!KA2 ê.(M1))'/ mixin /Ö4&4*43* 21
+ 4&/2 decorator pattern R1#è @
M 08#) â *K31/ 100 )hB. mixin IjíL&4K3LR decorator
pattern 'K(21$.A#)3õ.
3+ 100 )h. delegation ä K(+*K3* 2 SystemMixin plug-in .A#)3õ.©î/0íNKÂ¡'2K3I .åÙLL02 decorator pattern /1O+ mixin
R16(+HJ22 &!CRHJS7
K+K($g+A\ìBHJK( ' K
M63¬V.2(2àq£. TypeChecker RA\K decorator .¡ö3. decorator /2
cx¬V8.2R2 Hashtable 8.2w+Í$K3
 cx¬V.A+¡öL TypeNameChecker( TypeChecker .I.4SS ²I+*KH6+2&6K+å3


°!7#1.È2¸
8.1 * visitor pattern R1O*4 98visitor pattern /2A\ì.4S14IRâ
÷KA. design pattern '2K3S14IR
visitor pattern +ã#&& 02C`j£R traverse K 2 22( IÞß+*K3
 2 visitor pattern +/24Ö/ÞD4 24.).Þ/+42(46ØÕ 2K3*O!2;.Ò/'+G¡&4
K 2ÒÁØ*).Ö/®4ÞLKßì 2
KH6*S14I.â÷+/M4&4K 2 EPP.H6+2*j£ ÞL6K&@+/M
4&4*438.2*°.4JR Type 67(.A#)+*4. 9

8.3*2 mixin ( decorator pattern¹ê&4K. 9

]S14K
9.1 Java S14I.#ù
9;.;.Òh.â *6^(&2 forR*&BI­D514K° t1 ° t2 . super type )6 2*)22$ ­'.KK( ' 28# 514KD Makele R *&B2S14I ]S14K6.°.­.¯©/2 67(AM¿+/ +
r#ÑS14K&LKÕ 2K3
43
67(AM7MI?S'/2I­.
67(AM¿+â÷K1$èê(&2 dou*,³¯© %¿+9Ü*o º2 Javable dispatch *2K4/2Bâ÷; =(&4L02>K!A#)+R16èê 2K3. ;..6^/25(682.÷#ìRMhèêR1802 2Ë`.; (source language) . Kh'êÜ*]Rç&4K3
Java S14I/2h.H6+&]S14°.%ujR2â÷; (description language) .
I.%u+ &/AK(+HJ2¡Ú+â÷ KR &4K38# 514K( Make le +
 KsÞ2*O!I. signature (,³¯K( ' K M63
 2.èê/26Z4þ..;A\R ©.sÞ/2 Java S14I ) Ir
=(K7(46 EPP .¿+/O*43* #÷í2 class le .?+ «S'4K3]
*I2â÷;.Â8j+ &/AIL*4° S14K6r#ÑS14K/2 class le + LsÞRÁî<?«@(+H#&*OLK3 class&@R2 aß+&>6 I'2K3
le > ³ê*4o/2Ie I.I" 67(AM¿â÷4K.ØÕ/2 2
 ³êK/.514KRÅ§2.51
1$.¯Õ+Ý?2BEIJ&36A\ì4(+2# 2 mixin R1#â÷+HJ2 4KRj£ K('29Ü*I. signature RG¡K3.å/2Q+ ÙL&4K3
Java
ward declaration

9.2

EPP

.#ù

EPP /2 Java S14I *#&4K#ùR
HJKûØA +@Rf!2 API (& plugin 7MI>+ª4&4K3
EPP .5L@O'/2514K ) I
KLKg+9Ü(*KÒ.sÞR2 FileSignature (6'j'J K3 FileSignature/2514KU+µ>LKIe(2.IR¡öKC`j£.©e?(.Ë»J'2K36
I¡ö.©e?7(/2.I¡ö.C`j£ I2A#)¡ö.%ÉRM4B.'2K3
I._4°sÞ*ClassInfo+/2. FileSignature .sÞRKK(+H#&2j4K

.5L@O'/2A\BEK. composability RKA.A +@(&2 mixin( decorator pattern .!èR1#&4K32$.A+@/"r+`&4K 2LLKpK 2
K3
mixin /2 J*K.I+*A#)RÞK( ' K 2 decorator pattern '/2
2I AÙ>#¶C.A#)RA\K(' *43 #&2 mixin .è A\ì 
4(8K3Kè2 mixin .e?O/I.
¡ög+Ù>K.+Ë2 decorator .e?O/6

M+Õ.°e 2#&B¼bK.'2Ú
B*&H43
 I¡ö.C`j£ I FileSignature 8.¼A#).A\3$Ò.2¸'2/ÚB*&H43
 FileSignature I ClassInfo 8.¼A#).A\3ºêÂ8R*#&4KI.°R2%.
1I(+B..1I. FileSignature IÙ¡K3
 class RJ.). TypeChecker . decorator +HKA\3ºêÂ8R*#&4KI.C`j£R2A#)R+B..1I+ delegate
K2 KÂ8.I+¼K3
.H6+K '2 4R'÷9åR9& ÙKºêÂ8 plug-in  ' K3

Parsing pass
Phase1
Macro-expansion pass
FileSignaturePhase2Type-checking passCode-emitting pass

¿ 10: ¼.2$. phase( ' K3
É¿+/2 EPP +HK¼ 2/2)×.H
6+«@3 EPP .1$.514K+ËK 2/2
phase1 ( phase2 + LK3 phase1 /2j£ 
1(2°sÞ+,³*4>M.Í$1 Ií
K3 phase1 /¹.514K+K,³+*O 10 ¯cõ
LK3&2 phase1 Ï#gÕ'2.514
K. FileSignature G¡2 FileSignature /251 £êD'°RA\' KA\ß;/ãí
4K+È³LK3 phase2 /2°!7#1 H IÕº2K 2 EPP .H6+Zþ.*°&@3)õ21 IíK3 phase2 '/2¹.51 .A\ ' Kh2.K(]S14K.å
4K. FileSignature R9Ü+»&K* I2 R ÙA\ß;&@/¹+*43
; 2À.BEKØ *8KS14I÷
°!7#R*#J2°sÞRýÖ>MÍ$R*#JK3Õ.514KR EPP +H# í&@(&2 Eli[7] 2K3 Eli /2«ì£ê&$g+¼Ko/2>9&.514K. phase1 +Ç%4£ê(4J.¡ö I2; 2ÀRr#R*429&. FileSignature G¡42 ÷íK3Ò³.¡öW IK¶.Â8R*6
(+H#&2*;R¡öK( ' K3K
9&.514K. phase2 +(J K3
plug-in /2*°R&qKA+2Ë»J (FileS- û+«ì£ê+Ç%4&@.o2 ad hoc *2D*â÷.'0#èê*)>'µAK(2ignature) .8S(J+2;r.'jRqLK
( ' K3L+HJ2 parameterized class . Ñ3+/ *J.g­ 9Ü+*K(@OLK3 EPP.H6+5L@O+Ç%;A\±ê'/2
H6*26A\LI7RK( 'K3>2I+I2F80F¡ö.> â÷;+B'3&3.±® °;.; 2ÀM*)2) IKß*2IFKsÞR2 FileS- RÖ4KA2* 2.â÷D'0#+¯&/27MI>. KR.>>÷ ( 'ignature .8S(J+qLK( ' K3
K3>«ì£ê.H6**¿â÷.ýÕ.1$
 2 plug-in .+Ë&2h.H6*ê (&ÑýÖì.
2K 2 EPP '/ collaborationÜ*Ü0 2K:
based design RÖ4K(+HJ2*¿â÷($
69&.°/2 FileSignature .?RÖ4&2G .4ÑýÖìRüí&4K(;/z8&4K3¡K( ' *L0*I*437
S14Kg MOP(Meta Object Protocol)[13] R
.Ü0/2 plug-in ' K(+èRÞ8& ª4K(+H#&;RA\ß+K&@
>63F80 phase2 '.¼R*O*4(°
MPC++[12], OpenC++[4], JTRANS[14],G¡*4H6*;A\/2%5L@O. +2
OpenJava[22]EPP]S14KA +@.=(.þ.)'2K ($Ò+2j£ 2K3LI.&@/2
4.C`j£+Ë&*¼(R4JK3 2 + plug-in /.Ü08  2R*6(R¿(&4K3£êBILG02 EPP .5L@O ª4K] þ..?'A\ß+*#&4K3F80 MPC++
S14K.=(.Ó´+2 K( ' K3 '/24¦$;D£*)RÞ'
KH6+*#&4K3>2
MPC++, OpenC++, OpenJava 
9.3 FileSignature R1# plug-in .
&@'/2AIR¡öK('I.Ö
RA\J2°sÞRýÖ>MÍ$ ßF'2K3 2I(46eR8'°
%5L@ORýÖF(&2ºêÂ8 plug- .Þ*)/*8*43
in ..26(I4SR!gK3. plug-in
CLOS /9&.'°R 67((&/2259'L&4K3
6($g+g MOP[13] Rª4K(+H#&2^A&B2*;A\*6+'°+¯&+ £êA\3Rß+K;'2K3 Kû+g MOP
/2 EPP .1/Ò I extends .6 /LR ¨K runtime system .³êR9Ü(
7

KA2;A\.þ.B. runtime system '' Kþ.U+r(èLK3B!MS EPP +HK;A\.þ.B2õ2;'2K Java ;.
Ö+H#&èLK3  EPP .2 &!CR;<.>>Ö4&2 C ;Rõ2;(K(ISLRùK( ß'2K3.o/ runtime system Dõ2;+HKè/;(S)**J2Q+r¸*;A\ ß*&@+*K3;/ ê.H6*(ISL.R
È3&4K3
EPP ($Ò+2WRÞK('£ê.A\ß*7J7M#(&/2 Camlp4[17] (46 Objective Caml .7J7M# 2K3 °&@RA\KÖ/f#&4*43
11[2] Bracha, G. and Cook, W.: "Mixin-based Inheritance",
In Proc. of ECOOP/OOPSLA'90, pp.303{311, 1990.
[3] Bracha, G., Odersky, M., Stoutamire, D. and Wadler,
P.: GJ,
http://www.cis.unisa.edu.au/~ pizza/gj/[4] Chiba, S.: "A Metaobject Protocol for C++", In Proc.
of OOPSLA'95, pp.285{299, 1995.
http://www.softlab.is.tsukuba.ac.jp/~ chiba/openc++.html[5] Gamma, E., Helm, R., Johnson, R. and Vlissides, J.:"Design Patterns", Addison Welsley, 1995.
[6] Gosling, J., Joy, B. and Steele. G.: "The Java Language Speci cation.", Java Series, Sun Microsystems,
1996.
[7] Gray,R.W., Heuring,V.P., Levi,S.P., Sloane,A.M. and
Waite,W.M.: "Eli: A Complete, Flexible Compiler
Construction System", Communications of the ACM
35 (February 1992), pp.121{131.
[8] Harrison, W. and Ossher, H.: "Subject-Oriented Programming(A Critique of Pure Objects)." In Proc. of
OOPSLA'93, pp.411{428, 1993.
[9] Ichisugi, Y. and Yves Roudier: "The Extensible Java
Preprocessor Kit and a Tiny Data-Parallel Java", In
Proc. of ISCOPE'97, LNCS 1343, pp153{160, California, Dec, 1997.
[10] KÚº?: \4BEIJ&3(A\ìRf$j£ Æ",sÞ 2Q £X77MI?S, Vol.39 No.SIG 1(PRO1), Dec., 1998.
[11] Ichisugi, Y.: EPP,
http://www.etl.go.jp/~ epp/[12] Ishikawa, Y.: "Meta-level Architecture for Extendable
C++ Draft Document", Technical Report TR-94024,
RWCP, 1994.
http://www.rwcp.or.jp/lab/mpslab/mpc++/mpc++.html[13] Kiczales, G., des Rivieres, J. and Bobrow, D. G.: "TheArt of Metaobject Protocol", MIT Press, 1991.
[14] Kumeta, A. and Komuro, M.: "Meta-Programming
Framework for Java", The 12th workshop of object oriented computing WOOC'96, Japan Society of Software
Science and Technology, March, 1997.
[15] Kiczales, G., Lamping, J., Mendhekar, A., Maeda, C.,
Lopes, C. V., Loingtier, J.M. and Irwin, J.: "AspectOriented Programming." Invited Talk. In Proc. of ECOOP'97,
LNCS 1241, pp.220-242, 1997.
[16] Mezini, M. and Lieberherr, K.: "Adaptive Plug-andPlay Components for Evolutionary Software Development", In Proc. of OOPSLA'98, pp.97{116, Oct. 1998.
[17] Rauglaudre, D.: Camlp4,
http://pauillac.inria.fr/camlp4/[18] Steele, G.L.: "Common Lisp the Language 2nd edition.", Digital Press, 1990.
[19] Smaragdakis, Y. and Batory, D.: "Implementing Layered Designs with Mixin Layers", In Proc. of ECOOP'98,
pp.550{570, LNCS 1445, 1998.
[20] Szyperski, C. A.: "Import is not Inheritance { Why
We Need Both: Modules and Classes.", In Proc. of
ECOOP'92, LNCS 615, pp.19{32, 1992.
[21] VanHilst, M. and Notkin, D.: "Using Role Components
to Implement Collaboration-Based Designs", In Proc.
of OOPSLA'96, pp.359{369, Oct. 1996.
[22] "4(Ú: "F+(#&u¨¿*S14Kg MOP"SPA'98 , March, 1998.
http://www.softlab.is.tsukuba.ac.jp/~ mich/openjava[23] %7 JavaMetrics 7M7(
http://www.etl.go.jp/etl/bunsan/metrix/>(A

A\ß Java 7J7M# EPP ²K2°!7#Öj5L@O+$4&÷93.5
L@O/2 FileSignature (46.R&q
K('2°sÞRýÖ¼ 2+ë4÷K
I­6514K­..K.åD]S14
K.åR Ù&4K3
;.A\W'2K EPP plug-in /2 system
mixin ( decorator pattern .2$.ÖjRÖ4&2
collaboration-based design +Ç%4&LK3
L+HJ4 composability üíLK3
FileSignature R1#°!7#.5L@O
/?'2J2%£'÷9 plug-in .F/29&#ù&4K39&.)/2
www +H#&¬h?'2K [11]3%£'÷9]S14K H3r#ÑS1
4K.A +@/> L&4*4 2®4
R«A&Â¡'2K3>2 plug-in . composability è+).¯î4. 2Ú plug-in)6.Z@.5W+*JD4 Rk9K(B®
4.øå'2K3%5L@ORÖ4&ã Ö¿* plugin Rß )6 Rk9K2(&2 ê GJ[3](Q+S1!6K*1IAb I plug-in.R*#&4K3/2Ò+ plug-in .©
e?*700 ¯î+R>;  2-J.Rã+,ïK(46²'*#3 ê.(M)/ 1600 ¯î+*J2 GJ .;(S).Ö. '+Ï#&4K3>2%5L@ORÖ47M7((&2 JavaMetrics 7M7( [23] 2K3.7
M7('/ Java 7MI@.).ìR100)h.Ò*¨Õ IÕ&¿+È§
KA(J#$K(2&(7MI@+HK&(Ï RÈ§K&( 0L$K.R ê*#&4K3 EPP ª4Kj£ 6°!7#6C`j£}ù.ÖRýÖK(+H
J24÷#ìRh&4K3

z£ô

[1] Aho, A.V., Sethi, R. and Ullmann, J.D.: "Compilers:
Principles, Techniques and Tools.", Addison-Wesley Publishing company, 1987.

8