ASTDirective jjtn000 = new ASTDirective(this, JJTDIRECTIVE);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);Token t = null;
int argType;
int argPos = 0;
Directive d;
int directiveType;
boolean isVM = false;
boolean doItNow = false;
try {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case WORD:
t = jj_consume_token(WORD);
break;
case BRACKETED_WORD:
t = jj_consume_token(BRACKETED_WORD);
break;
default:
jj_la1[7] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
String directiveName;
if (t.kind == ParserConstants.BRACKETED_WORD)
{
directiveName = t.image.substring(2, t.image.length() - 1);
}
else
{
directiveName = t.image.substring(1);
}
d = getDirective(directiveName);
/*
* Velocimacro support : if the directive is macro directive
* then set the flag so after the block parsing, we add the VM
* right then. (So available if used w/in the current template )
*/
if (directiveName.equals("macro"))
{
doItNow = true;
}
/*
* set the directive name from here. No reason for the thing to know
* about parser tokens
*/
jjtn000.setDirectiveName(directiveName);
if ( d == null)
{
if( directiveName.startsWith("@") )
{
// block macro call of type: #@foobar($arg1 $arg2) astBody #end
directiveType = Directive.BLOCK;
}
else
{
/*
* if null, then not a real directive, but maybe a Velocimacro
*/
isVM = VelocityUtil.getEngine().getRuntimeServices().isVelocimacro(directiveName, currentTemplateName);
/*
* Currently, all VMs are LINE directives
*/
directiveType = Directive.LINE;
}
}
else
{
directiveType = d.getType();
}
/*
* now, switch us out of PRE_DIRECTIVE
*/