Package net.asfun.jangod.parse

Examples of net.asfun.jangod.parse.TagToken


    return root;
  }
 
  static void tree(Node node, TokenParser parser, String endName) {
    Token token;
    TagToken tag;
    MacroToken macro;
    while( parser.hasNext() ) {
      token = parser.next();
      switch(token.getType()) {
        case TOKEN_FIXED :
          TextNode tn = new TextNode((FixedToken)token);
          node.add(tn);
          break;
        case TOKEN_NOTE :
          break;
        case TOKEN_MACRO :
          macro = (MacroToken) token;
          if ( macro.getMacroName().equalsIgnoreCase(endName) ) {
            return;
          }
          try {
            MacroNode mn = new MacroNode((MacroToken) token);
            node.add(mn);
            if ( mn.endName != null ) {
              tree(mn, parser, mn.endName);
            }
          } catch (ParseException e) {
            JangodLogger.log(Level.WARNING, "can't create node with token >>> " + token, e.getCause());
         
          break;
        case TOKEN_ECHO :
          VariableNode vn = new VariableNode((EchoToken) token);
          node.add(vn);
          break;
        case TOKEN_TAG :
          tag = (TagToken) token;
          if ( tag.getTagName().equalsIgnoreCase(endName) ) {
            return;
          }
          try {
            TagNode tg = new TagNode((TagToken) token);
            node.add(tg);
View Full Code Here


      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

TOP

Related Classes of net.asfun.jangod.parse.TagToken

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.