Search in sources :

Example 1 with BeMacroFunction

use of com.developmentontheedge.sql.model.BeMacroFunction in project be5 by DevelopmentOnTheEdge.

the class MacroExpander method expandMacros.

public void expandMacros(SimpleNode node) {
    for (int i = 0; i < node.jjtGetNumChildren(); i++) {
        SimpleNode child = node.child(i);
        expandMacros(child);
        if ((child instanceof AstFunNode) && ((AstFunNode) child).getFunction() instanceof BeMacroFunction) {
            transformMacroFunction((AstFunNode) child);
        }
    }
}
Also used : AstFunNode(com.developmentontheedge.sql.model.AstFunNode) BeMacroFunction(com.developmentontheedge.sql.model.BeMacroFunction) SimpleNode(com.developmentontheedge.sql.model.SimpleNode)

Example 2 with BeMacroFunction

use of com.developmentontheedge.sql.model.BeMacroFunction in project be5 by DevelopmentOnTheEdge.

the class MacroExpander method transformMacroFunction.

private void transformMacroFunction(AstFunNode node) {
    BeMacroFunction function = (BeMacroFunction) node.getFunction();
    SimpleNode replacement = function.getReplacement(node);
    expandMacros(replacement);
    node.replaceWith(replacement);
}
Also used : BeMacroFunction(com.developmentontheedge.sql.model.BeMacroFunction) SimpleNode(com.developmentontheedge.sql.model.SimpleNode)

Aggregations

BeMacroFunction (com.developmentontheedge.sql.model.BeMacroFunction)2 SimpleNode (com.developmentontheedge.sql.model.SimpleNode)2 AstFunNode (com.developmentontheedge.sql.model.AstFunNode)1