Package org.apache.velocity.runtime.parser

Examples of org.apache.velocity.runtime.parser.Token


     * within the template and not just relative to the error position within
     * the string literal.
     */
    public void adjTokenLineNums(Node node)
    {
        Token tok = node.getFirstToken();
        // Test against null is probably not neccessary, but just being safe
        while(tok != null && tok != node.getLastToken())
        {
            // If tok is on the first line, then the actual column is
            // offset by the template column.
View Full Code Here


    {
    try {//我加上的
    DEBUG.P(this,"init(2)");
    //DEBUG.P("data="+data); //org.apache.velocity.runtime.RuntimeInstance

        Token t = getFirstToken();

    DEBUG.P("t.image="+t.image);

        int loc1 = t.image.indexOf("##");
        int loc2 = t.image.indexOf("#*");
 
View Full Code Here

    private String getRoot()
    {
    try {//我加上的
    DEBUG.P(this,"getRoot()");

        Token t = getFirstToken();

    DEBUG.P("t="+t);
    DEBUG.P("t.image="+t.image);

        /*
 
View Full Code Here

        /*
         *  this assumes that we are passed in the root
         *  node of the code block
         */

        Token t = rootNode.getFirstToken();
        Token tLast = rootNode.getLastToken();

        /*
         *  now, run down the part of the tree bounded by
         *  our first and last tokens
         */
 
View Full Code Here

        return true;
    }

    private String getRoot()
    {
        Token t = getFirstToken();

        /*
         *  we have a special case where something like
         *  $(\\)*!, where the user want's to see something
         *  like $!blargh in the output, but the ! prevents it from showing.
View Full Code Here

        if (first == last)
        {
            return NodeUtils.tokenLiteral(first);
        }

        Token t = first;
        StrBuilder sb = new StrBuilder(NodeUtils.tokenLiteral(t));
        while (t != last)
        {
            t = t.next;
            sb.append(NodeUtils.tokenLiteral(t));
View Full Code Here

            expected.append(eol).append("    ");
        }

        StringBuffer retval = new StringBuffer("Encountered \"");
        Token tok = currentToken.next;

        for (int i = 0; i < maxSize; i++)
        {
            if (i != 0)
            {
View Full Code Here

     * reduce memory usage a bit.
     */
    private void makeLiteral()
    {
        StrBuilder buffer = new StrBuilder();
        Token t = node.getFirstToken();
       
        while (t != null && t != node.getLastToken())
        {
            buffer.append(t.image);
            t = t.next;
View Full Code Here

        return true;
    }

    private String getRoot()
    {
        Token t = getFirstToken();

        /*
         *  we have a special case where something like
         *  $(\\)*!, where the user want's to see something
         *  like $!blargh in the output, but the ! prevents it from showing.
View Full Code Here

        int firstType = node.jjtGetChild(0).getType();

        if(firstType != ParserTreeConstants.JJTWORD)
        {
            Token t = node.jjtGetChild(0).getFirstToken();

            throw new MacroParseException("First argument to #macro() must be a"
                    + " token without surrounding \' or \", which specifies"
                    + " the macro name.  Currently it is a "
                    + ParserTreeConstants.jjtNodeName[firstType]);
View Full Code Here

TOP

Related Classes of org.apache.velocity.runtime.parser.Token

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.