KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > persistence > antlr > CSharpNameSpace


1 package persistence.antlr;
2
3 /**
4  * ANTLR Translator Generator
5  * Project led by Terence Parr at http://www.jGuru.com
6  * Software rights: http://www.antlr.org/license.html
7  *
8  * Container for a C++ namespace specification. Namespaces can be
9  * nested, so this contains a vector of all the nested names.
10  *
11  * @author David Wagner (JPL/Caltech) 8-12-00
12  *
13  */

14
15
16 //
17
// ANTLR C# Code Generator by Micheal Jordan
18
// Kunle Odutola : kunle UNDERSCORE odutola AT hotmail DOT com
19
// Anthony Oguntimehin
20
//
21
// With many thanks to Eric V. Smith from the ANTLR list.
22
//
23

24 // HISTORY:
25
//
26
// 17-May-2002 kunle Original version
27
//
28

29 import java.util.Vector JavaDoc;
30 import java.util.Enumeration JavaDoc;
31 import java.io.PrintWriter JavaDoc;
32 import java.util.StringTokenizer JavaDoc;
33
34 public class CSharpNameSpace extends NameSpace
35 {
36     public CSharpNameSpace(String JavaDoc name)
37     {
38         super(name);
39     }
40
41     /**
42      * Method to generate the required CSharp namespace declarations
43      */

44     void emitDeclarations(PrintWriter JavaDoc out) {
45           out.println("namespace " + getName() );
46           out.println("{");
47     }
48
49     /**
50      * Method to generate the required CSharp namespace closures
51      */

52     void emitClosures(PrintWriter JavaDoc out) {
53           out.println("}");
54     }
55 }
56
Popular Tags