KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > genimen > djeneric > tools > generator > core > nodes > BodyNode


1 package com.genimen.djeneric.tools.generator.core.nodes;
2
3 import com.genimen.djeneric.tools.generator.core.DjentelParserEngine;
4 import com.genimen.djeneric.tools.generator.core.ParseException;
5 import com.genimen.djeneric.tools.generator.core.SimpleNode;
6 import com.genimen.djeneric.tools.generator.core.util.ParseContext;
7
8 public class BodyNode extends SimpleNode
9 {
10
11   public BodyNode(int i)
12   {
13     super(i);
14   }
15
16   public BodyNode(DjentelParserEngine p, int i)
17   {
18     super(p, i);
19   }
20
21   public String JavaDoc getName()
22   {
23     return "body";
24   }
25
26   public String JavaDoc toString()
27   {
28     return "";
29   }
30
31   public String JavaDoc evaluate(ParseContext context) throws ParseException
32   {
33     context.mark();
34     StringBuffer JavaDoc result = new StringBuffer JavaDoc(2000);
35     for (int i = 0; i < getChildCount(); i++)
36     {
37       result.append(getChild(i).evaluate(context));
38     }
39
40     context.releaseToMark();
41     return result.toString();
42   }
43
44 }
45
Popular Tags