KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ppg > atoms > SemanticAction


1 package ppg.atoms;
2
3 import ppg.parse.*;
4 import ppg.util.*;
5 public class SemanticAction extends GrammarPart
6 {
7     private String JavaDoc action;
8     
9     public SemanticAction (String JavaDoc actionCode) {
10         action = actionCode;
11     }
12
13     public Object JavaDoc clone() {
14         return new SemanticAction(action.toString());
15     }
16     
17     public void unparse(CodeWriter cw) {
18         cw.begin(0);
19         cw.write("{:");
20         cw.allowBreak(-1);
21         cw.write(action);
22         cw.allowBreak(0);
23         cw.write(":}");
24         cw.end();
25     }
26     
27     public String JavaDoc toString () {
28         return "{:" + action + ":}\n";
29     }
30 }
31
Popular Tags