01: /*
02: * Copyright 1996-2003 Sun Microsystems, Inc. All Rights Reserved.
03: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
04: *
05: * This code is free software; you can redistribute it and/or modify it
06: * under the terms of the GNU General Public License version 2 only, as
07: * published by the Free Software Foundation. Sun designates this
08: * particular file as subject to the "Classpath" exception as provided
09: * by Sun in the LICENSE file that accompanied this code.
10: *
11: * This code is distributed in the hope that it will be useful, but WITHOUT
12: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14: * version 2 for more details (a copy is included in the LICENSE file that
15: * accompanied this code).
16: *
17: * You should have received a copy of the GNU General Public License version
18: * 2 along with this work; if not, write to the Free Software Foundation,
19: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20: *
21: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22: * CA 95054 USA or visit www.sun.com if you need additional information or
23: * have any questions.
24: */
25:
26: package sun.tools.java;
27:
28: import sun.tools.tree.*;
29:
30: /**
31: * This is the protocol by which a Parser makes callbacks
32: * to the later phases of the compiler.
33: * <p>
34: * (As a backwards compatibility trick, Parser implements
35: * this protocol, so that an instance of a Parser subclass
36: * can handle its own actions. The preferred way to use a
37: * Parser, however, is to instantiate it directly with a
38: * reference to your own ParserActions implementation.)
39: *
40: * WARNING: The contents of this source file are not part of any
41: * supported API. Code that depends on them does so at its own risk:
42: * they are subject to change or removal without notice.
43: *
44: * @author John R. Rose
45: * @version 1.21, 05/05/07
46: */
47: public interface ParserActions {
48: /**
49: * package declaration
50: */
51: void packageDeclaration(long off, IdentifierToken nm);
52:
53: /**
54: * import class
55: */
56: void importClass(long off, IdentifierToken nm);
57:
58: /**
59: * import package
60: */
61: void importPackage(long off, IdentifierToken nm);
62:
63: /**
64: * Define class
65: * @return a cookie for the class
66: * This cookie is used by the parser when calling defineField
67: * and endClass, and is not examined otherwise.
68: */
69: ClassDefinition beginClass(long off, String doc, int mod,
70: IdentifierToken nm, IdentifierToken sup,
71: IdentifierToken impl[]);
72:
73: /**
74: * End class
75: * @param c a cookie returned by the corresponding beginClass call
76: */
77: void endClass(long off, ClassDefinition c);
78:
79: /**
80: * Define a field
81: * @param c a cookie returned by the corresponding beginClass call
82: */
83: void defineField(long where, ClassDefinition c, String doc,
84: int mod, Type t, IdentifierToken nm,
85: IdentifierToken args[], IdentifierToken exp[], Node val);
86: }
|