01: package kawa.lang;
02:
03: import java.io.*;
04:
05: /** A rule in an R5RS <code>syntax-template</code>. A combination of
06: * a <code>SyntaxPattern</code> and a <code>SyntaxTemplate</code>. */
07:
08: public class SyntaxRule extends SyntaxTemplate implements
09: Externalizable {
10: SyntaxPattern pattern;
11:
12: public SyntaxRule() {
13: }
14:
15: public SyntaxRule(SyntaxPattern pattern, String pattern_nesting,
16: String template_program, Object[] literal_values,
17: int max_nesting) {
18: super (pattern_nesting, template_program, literal_values,
19: max_nesting);
20: this .pattern = pattern;
21: }
22:
23: public SyntaxRule(SyntaxPattern pattern, Object template,
24: SyntaxForm template_syntax, Translator tr) {
25: super (template, template_syntax, tr);
26: this .pattern = pattern;
27: }
28:
29: public void writeExternal(ObjectOutput out) throws IOException {
30: out.writeObject(pattern);
31: super .writeExternal(out);
32: }
33:
34: public void readExternal(ObjectInput in) throws IOException,
35: ClassNotFoundException {
36: pattern = (SyntaxPattern) in.readObject();
37: super.readExternal(in);
38: }
39: }
|