Search in sources :

Example 1 with CommentTokenNode

use of com.google.auto.value.processor.escapevelocity.TokenNode.CommentTokenNode in project auto by google.

the class Reparser method parseTokenNode.

private Node parseTokenNode() {
    TokenNode tokenNode = (TokenNode) currentNode();
    nextNode();
    if (tokenNode instanceof CommentTokenNode) {
        return emptyNode(tokenNode.lineNumber);
    } else if (tokenNode instanceof IfTokenNode) {
        return parseIfOrElseIf((IfTokenNode) tokenNode);
    } else if (tokenNode instanceof ForEachTokenNode) {
        return parseForEach((ForEachTokenNode) tokenNode);
    } else if (tokenNode instanceof MacroDefinitionTokenNode) {
        return parseMacroDefinition((MacroDefinitionTokenNode) tokenNode);
    } else {
        throw new IllegalArgumentException("Unexpected token: " + tokenNode.name() + " on line " + tokenNode.lineNumber);
    }
}
Also used : ForEachTokenNode(com.google.auto.value.processor.escapevelocity.TokenNode.ForEachTokenNode) ElseIfTokenNode(com.google.auto.value.processor.escapevelocity.TokenNode.ElseIfTokenNode) EndTokenNode(com.google.auto.value.processor.escapevelocity.TokenNode.EndTokenNode) CommentTokenNode(com.google.auto.value.processor.escapevelocity.TokenNode.CommentTokenNode) IfTokenNode(com.google.auto.value.processor.escapevelocity.TokenNode.IfTokenNode) ElseTokenNode(com.google.auto.value.processor.escapevelocity.TokenNode.ElseTokenNode) IfOrElseIfTokenNode(com.google.auto.value.processor.escapevelocity.TokenNode.IfOrElseIfTokenNode) MacroDefinitionTokenNode(com.google.auto.value.processor.escapevelocity.TokenNode.MacroDefinitionTokenNode) CommentTokenNode(com.google.auto.value.processor.escapevelocity.TokenNode.CommentTokenNode) ElseIfTokenNode(com.google.auto.value.processor.escapevelocity.TokenNode.ElseIfTokenNode) IfTokenNode(com.google.auto.value.processor.escapevelocity.TokenNode.IfTokenNode) IfOrElseIfTokenNode(com.google.auto.value.processor.escapevelocity.TokenNode.IfOrElseIfTokenNode) MacroDefinitionTokenNode(com.google.auto.value.processor.escapevelocity.TokenNode.MacroDefinitionTokenNode) ForEachTokenNode(com.google.auto.value.processor.escapevelocity.TokenNode.ForEachTokenNode)

Aggregations

CommentTokenNode (com.google.auto.value.processor.escapevelocity.TokenNode.CommentTokenNode)1 ElseIfTokenNode (com.google.auto.value.processor.escapevelocity.TokenNode.ElseIfTokenNode)1 ElseTokenNode (com.google.auto.value.processor.escapevelocity.TokenNode.ElseTokenNode)1 EndTokenNode (com.google.auto.value.processor.escapevelocity.TokenNode.EndTokenNode)1 ForEachTokenNode (com.google.auto.value.processor.escapevelocity.TokenNode.ForEachTokenNode)1 IfOrElseIfTokenNode (com.google.auto.value.processor.escapevelocity.TokenNode.IfOrElseIfTokenNode)1 IfTokenNode (com.google.auto.value.processor.escapevelocity.TokenNode.IfTokenNode)1 MacroDefinitionTokenNode (com.google.auto.value.processor.escapevelocity.TokenNode.MacroDefinitionTokenNode)1