private static Object peek() { return relativePathStack.get().peek(); }
if (!BlankLiteral.INSTANCE.equals(stk.peek())) { return OP_TERMINATE;
private File getFile(TemplateRuntime runtime, String fileName) { return new File(String.valueOf(runtime.getRelPath().peek()) + "/" + fileName); }
if (!BlankLiteral.INSTANCE.equals(stk.peek())) { return -1;
private File getFile(TemplateRuntime runtime, String fileName) { return new File(String.valueOf(runtime.getRelPath().peek()) + "/" + fileName); }
if (!BlankLiteral.INSTANCE.equals(stk.peek())) { return OP_TERMINATE;
private static Object peek() { return relativePathStack.get().peek(); }
private String readFile(TemplateRuntime runtime, String fileName, Object ctx, VariableResolverFactory factory) { File file = new File(String.valueOf(runtime.getRelPath().peek()) + "/" + fileName); if (fileDateStamp == 0 || fileDateStamp != file.lastModified()) { fileDateStamp = file.lastModified(); cFileCache = TemplateCompiler.compileTemplate(readInFile(runtime, file), context); } return String.valueOf(TemplateRuntime.execute(cFileCache, ctx, factory)); }
private String readFile(TemplateRuntime runtime, String fileName, Object ctx, VariableResolverFactory factory) { File file = new File(String.valueOf(runtime.getRelPath().peek()) + "/" + fileName); if (fileDateStamp == 0 || fileDateStamp != file.lastModified()) { fileDateStamp = file.lastModified(); cFileCache = TemplateCompiler.compileTemplate(readInFile(runtime, file), context); } return String.valueOf(TemplateRuntime.execute(cFileCache, ctx, factory)); }
public static String readInFile(TemplateRuntime runtime, String fileName) { File file = new File(String.valueOf(runtime.getRelPath().peek()) + "/" + fileName);
public static String readInFile(TemplateRuntime runtime, String fileName) { File file = new File(String.valueOf(runtime.getRelPath().peek()) + "/" + fileName);
@Override public Object getReducedValueAccelerated(Object ctx, Object thisValue, VariableResolverFactory factory) { ExecutionStack stk = new ExecutionStack(); stk.push(getReducedValue(stk, thisValue, factory)); if (stk.isReduceable()) { while (true) { stk.op(); if (stk.isReduceable()) { stk.xswap(); } else { break; } } } return stk.peek(); }
@Override public Object getReducedValueAccelerated(Object ctx, Object thisValue, VariableResolverFactory factory) { ExecutionStack stk = new ExecutionStack(); stk.push(getReducedValue(stk, thisValue, factory)); if (stk.isReduceable()) { while (true) { stk.op(); if (stk.isReduceable()) { stk.xswap(); } else { break; } } } return stk.peek(); }
if ((tk.fields & ASTNode.STACKLANG) != 0) { stk.push(tk.getReducedValue(stk, ctx, variableFactory)); Object o = stk.peek(); if (o instanceof Integer) { arithmeticFunctionReduction((Integer) o); return stk.peek(); else continue; return stk.pop(); case OP_TERMINATE: return stk.peek(); case OP_RESET_FRAME: continue; case OP_OVERFLOW: if (!tk.isOperator()) { if (!(stk.peek() instanceof Class)) { throw new CompileException("unexpected token or unknown identifier:" + tk.getName(), expr, st); variableFactory.createVariable(tk.getName(), null, (Class) stk.peek()); return stk.peek(); case OP_RESET_FRAME: continue; if (procBooleanOperator(operator) == OP_TERMINATE) return stk.peek(); return stk.peek();
return stk.peek(); else continue; return stk.peek(); case OP_RESET_FRAME: continue; case OP_OVERFLOW: if (!tk.isOperator()) { if (!(stk.peek() instanceof Class)) { throw new CompileException("unexpected token: " + tk.getName()); variableFactory.createVariable(tk.getName(), null, (Class) stk.peek()); return stk.peek(); case OP_RESET_FRAME: continue; if (procBooleanOperator(operator) == -1) return stk.peek(); return stk.peek();
if ((tk.fields & ASTNode.STACKLANG) != 0) { stk.push(tk.getReducedValue(stk, ctx, variableFactory)); Object o = stk.peek(); if (o instanceof Integer) { arithmeticFunctionReduction((Integer) o); return stk.peek(); else continue; return stk.pop(); case OP_TERMINATE: return stk.peek(); case OP_RESET_FRAME: continue; case OP_OVERFLOW: if (!tk.isOperator()) { if (!(stk.peek() instanceof Class)) { throw new CompileException("unexpected token or unknown identifier:" + tk.getName(), expr, st); variableFactory.createVariable(tk.getName(), null, (Class) stk.peek()); return stk.peek(); case OP_RESET_FRAME: continue; if (procBooleanOperator(operator) == OP_TERMINATE) return stk.peek(); return stk.peek();
if (!stack.isEmpty() && stack.peek() instanceof IfNode) { markTextNode(n).next = (last = (IfNode) stack.pop()).getTerminus(); CompileException ce = new CompileException("unclosed @" + ((Node) stack.peek()).getName() + "{} block. expected @end{}", template, cursor); ce.setColumn(cursor - colStart); ce.setLineNumber(line);