Package net.asfun.jangod.tree

Examples of net.asfun.jangod.tree.Node


    String templateFile = rebuilder.resolveString(helper[0]);
    try {
      String fullName = ResourceManager.getFullName(templateFile,
          rebuilder.getWorkspace(), rebuilder.getConfiguration().getWorkspace());
      //TODO STOP LOOP EXTENDS
      Node extendsRoot = TreeParser.parser( new TokenParser( ResourceManager.getResource(
          fullName, rebuilder.getConfiguration().getEncoding())));
      extendsRoot = rebuilder.derive().refactor(extendsRoot);
     
      rebuilder.parent = extendsRoot;
      rebuilder.nodeRemove(current);
View Full Code Here


    }
    String templateFile = interpreter.resolveString(helper[0]);
    try {
      String fullName = ResourceManager.getFullName(templateFile,
          interpreter.getWorkspace(), interpreter.getConfiguration().getWorkspace());
      Node node = interpreter.getContext().getApplication().getParseResult(
          fullName, interpreter.getConfiguration().getEncoding() );
     
     
      ListOrderedMap blockList = new ListOrderedMap();
      interpreter.assignRuntimeScope(JangodInterpreter.BLOCK_LIST, blockList, 1);
View Full Code Here

    }
    String templateFile = interpreter.resolveString(helper[0]);
    try {
      String fullName = ResourceManager.getFullName(templateFile,
          interpreter.getWorkspace(), interpreter.getConfiguration().getWorkspace());
      Node node = interpreter.getApplication().getParseResult(
          fullName, interpreter.getConfiguration().getEncoding() );
      JangodInterpreter child = interpreter.clone();
      child.assignRuntimeScope(JangodInterpreter.INSERT_FLAG, true, 1);
      return child.render(node);
    } catch (IOException e) {
View Full Code Here

    String templateFile = rebuilder.resolveString(helper[0]);
    try {
      String fullName = ResourceManager.getFullName(templateFile,
          rebuilder.getWorkspace(), rebuilder.getConfiguration().getWorkspace());
      //TODO STOP LOOP INCLUDE
      Node includeRoot = TreeParser.parser( new TokenParser( ResourceManager.getResource(
          fullName, rebuilder.getConfiguration().getEncoding())));
     
//      includeRoot.replaceWithChildren(current);
      rebuilder.nodeReplace(current, includeRoot.children());
    } catch (IOException e) {
      throw new ParseException(e.getMessage());
    }
  }
View Full Code Here

  @Override
  public void refactor(Node current, String helpers, TreeRebuilder rebuilder)
      throws ParseException {
    //helpers like  name  arg2=val2,arg3=var3
    String name = "";// TODO get from helpers;
    Node defineNode = rebuilder.fetchNode(MacroMacro.MACRO_NAME_PREFIX + name);
    if ( defineNode == null ) {
      throw new ParseException("Call a macro didn't define yet >>> " + name);
    }
    String[] args = new String[]{};// TODO resolve from macro's helpers
    String[] vals = new String[]{};// TODO resolve from helpers and macro's helpers
    for (int i=0; i<args.length; i++ ) {
      TagNode tn = new TagNode(new TagToken("{%set "+args[i] + " " + vals[i] + " just %}"));
      rebuilder.nodeInsertBefore(current, tn);
    }
    rebuilder.nodeReplace(current, defineNode.clone().children());
  }
View Full Code Here

    String blockName = rebuilder.resolveString(helper[0]);
    //if is parent
    if ( rebuilder.parent == null ) {
      rebuilder.assignNode(BLK_NAME_PREFIX + blockName, current);
    } else {
      Node parentBlock = rebuilder.fetchNode(BLK_NAME_PREFIX + blockName);
      if ( parentBlock == null ) {
        throw new ParseException("Dosen't define block in extends parent with name >>> " + blockName);
      }
//      current.replaceWithChildren(parentBlock);
      rebuilder.nodeReplace(parentBlock, current.children());
View Full Code Here

TOP

Related Classes of net.asfun.jangod.tree.Node

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.