/* Generated By:JJTree: Do not edit this line. ASTText.java */

package org.apache.velocity.runtime.parser.node;

import java.io.Writer;
import java.io.IOException;

import org.apache.velocity.Context;
import org.apache.velocity.runtime.parser.*;

public class ASTText extends SimpleNode
{
    private String text;

    public ASTText(int id)
    {
        super(id);
    }

    public ASTText(Parser p, int id)
    {
        super(p, id);
    }

    /** Accept the visitor. **/
    public Object jjtAccept(ParserVisitor visitor, Object data)
    {
        return visitor.visit(this, data);
    }

    public Object init(Context context, Object data) throws Exception
    {
        // text = NodeUtils.specialText(getFirstToken()) +
        //    getFirstToken().image;
       
        /*
         *  there is only one special case we care about now : if the specialToken leads with a $
         *  Everything else seems to be working right now 
         */
 
        text =  getFirstToken().image;
       
        if (NodeUtils.specialText(getFirstToken()).startsWith("$") )
            text = "$" + text;
        
        return data;
    }

    public boolean render(Context context, Writer writer)
        throws IOException
    {
        writer.write(text);
        return true;
    }    
}

/* Generated By:JJTree: Do not edit this line. ASTText.java */

package org.apache.velocity.runtime.parser.node;

import java.io.Writer;
import java.io.IOException;

import org.apache.velocity.Context;
import org.apache.velocity.runtime.parser.*;

public class ASTText extends SimpleNode
{
    private String text;

    public ASTText(int id)
    {
        super(id);
    }

    public ASTText(Parser p, int id)
    {
        super(p, id);
    }

    /** Accept the visitor. **/
    public Object jjtAccept(ParserVisitor visitor, Object data)
    {
        return visitor.visit(this, data);
    }

    public Object init(Context context, Object data) throws Exception
    {
        // text = NodeUtils.specialText(getFirstToken()) +
        //    getFirstToken().image;
       
        /*
         *  there is only one special case we care about now : if the specialToken leads with a $
         *  Everything else seems to be working right now 
         */
 
        text =  getFirstToken().image;
       
        if (NodeUtils.specialText(getFirstToken()).startsWith("$")) 
            text = "$" + text;
        else if ( NodeUtils.specialText(getFirstToken()).startsWith("#") )
            text = "#" + text;
        
        return data;
    }

    public boolean render(Context context, Writer writer)
        throws IOException
    {
        writer.write(text);
        return true;
    }    
}

Support for symmetrization of DIRECTIVE and REFERENCE. See the 1.20 Parser.jjt