01:/*
02:@license.text@
03: */
04:package com.pavelvlasov.jsel.antlr;
05:
06:import java.io.File;
07:import java.io.FileReader;
08:
09:import com.pavelvlasov.jsel.${javaHelper.formatClassName("${element.name}")};
10:import com.pavelvlasov.jsel.LanguageElementFactory;
11:
12:
13:/**
14: * Generated by Pamda (http://www.pavelvlasov.com/pv/content/menu.show@id=menu.1.3)
15: * @author Pavel Vlasov
16: * @version $Revision$
17: */
18:class ${javaHelper.formatClassName("${element.name}")}Impl
19: extends LanguageElementImpl
20: implements com.pavelvlasov.jsel.${javaHelper.formatClassName("${element.name}")} {
21: // TODO Change extends if needed.
22:
23: // TODO Remove implements if com.pavelvlasov.jsel.${javaHelper.formatClassName("${element.name}")} is removed
24: // but consider keeping this class and delegating from parent.
25:
26: // TODO [Phase1] Once work on ${javaHelper.formatClassName("${element.name}")}Impl is done
27: // move it from 'generated' to 'src'
28:
29: /**
30: * @param ast
31: * @param factory
32: * @param parent
33: */
34: public ${javaHelper.formatClassName("${element.name}")}Impl (
35: AST ast,
36: LanguageElementFactoryImpl factory,
37: com.pavelvlasov.jsel.LanguageElement parent) {
38: super (ast, factory, parent);
39: // TODO Construct object from AST.
40: }
41:
42: public void accept(com.pavelvlasov.jsel.Visitor visitor) {
43: super .accept(visitor);
44: // TODO Iterate through subojbects and invoke their accept() method
45: }
46:
47: // TODO Implement methods declared by ${javaHelper.formatClassName("${element.name}")}
48:
49: public void dump(java.io.PrintWriter out, int level) {
50: super .dump(out, level);
51: // TODO Iterate through subojbects and invoke their dump() method
52: }
53:
54: /**
55: * Reads language element from test case file and dumps it to System.out
56: */
57: public static void main(String[] args) throws Exception {
58: File testCase=new File("testCases"+File.separator+"${javaHelper.formatClassName("${element.name}")}TestCase.java");
59: LanguageElementImpl.setDebug(true);
60: LanguageElementFactory factory=new LanguageElementFactoryImpl();
61: ${javaHelper.formatClassName("${element.name}")}Impl ${javaHelper.formatMethodName("${element.name}")}Impl=(${javaHelper.formatClassName("${element.name}")}Impl) factory.parse(new FileReader(testCase), ${javaHelper.formatClassName("${element.name}")}.class);
62: ${javaHelper.formatMethodName("${element.name}")}Impl.dump();
63: }
64:}
|