Examples of OpenTagToken


Examples of cambridge.parser.tokens.OpenTagToken

         throw new TemplateParsingException("Error parsing expression", e, currentToken.getLineNo(), currentToken.getColumn());
      }
   }

   private TagNode tag() throws IOException, TemplateParsingException {
      OpenTagToken token = (OpenTagToken) currentToken;

      Cambridge bindings = Cambridge.getInstance();

      TagNode node = null;

      if (token.getNameSpace() != null) {
         String namespaceUri = getNamespaceUri(token.getNameSpace());
         if (namespaceUri != null) {
            node = bindings.getDynamicTag(new DynamicAttributeKey(namespaceUri, token.getNameSpace(), token.getTagName()));
         }
      }

      boolean dynamicTag = true;
      if (node == null) {
         node = new TagNode();
         dynamicTag = false;
      }

      node.setBeginLine(token.getLineNo());
      node.setBeginColumn(token.getColumn());
      node.setTagName(token.getTagName());
      node.setNameSpace(token.getNameSpace());
      node.setTagNameString(token.value);

      // Match the open tag
      while (peek(1).getType() != TokenType.EOF) {
         nextToken();
View Full Code Here

Examples of cambridge.parser.tokens.OpenTagToken

               builder.append(nextChar());
               c = peek(1);
            }
            currentTag = builder.substring(0).toLowerCase();
            state = State.TAG;
            return new OpenTagToken(line, col, builder.toString(), getLineNo(), getColumn());
         } else {
            builder.append(c);
            return new StringToken(line, col, builder.toString(), getLineNo(), getColumn());
         }
         // Expression
View Full Code Here

Examples of cambridge.parser.tokens.OpenTagToken

            throw new TemplateParsingException("Error parsing expression", e, currentToken.getLineNo(), currentToken.getColumn());
        }
    }

    private TagNode tag() throws IOException, TemplateParsingException {
        OpenTagToken token = (OpenTagToken) currentToken;

        Cambridge bindings = Cambridge.getInstance();

        TagNode node = null;

        if (token.getNameSpace() != null) {
            String namespaceUri = getNamespaceUri(token.getNameSpace());
            if (namespaceUri != null) {
                node = bindings.getDynamicTag(new DynamicAttributeKey(namespaceUri, token.getNameSpace(), token.getTagName()));
            }
        }

        boolean dynamicTag = true;
        if (node == null) {
            node = new TagNode();
            dynamicTag = false;
        }

        node.setBeginLine(token.getLineNo());
        node.setBeginColumn(token.getColumn());
        node.setTagName(token.getTagName());
        node.setNameSpace(token.getNameSpace());
        node.setTagNameString(token.value);

        // Match the open tag
        while (peek(1).getType() != TokenType.EOF) {
            nextToken();
View Full Code Here

Examples of cambridge.parser.tokens.OpenTagToken

               builder.append(nextChar());
               c = peek(1);
            }
            currentTag = builder.substring(0).toLowerCase();
            state = State.TAG;
            return new OpenTagToken(line, col, builder.toString(), getLineNo(), getColumn());
         } else {
            builder.append(c);
            return new StringToken(line, col, builder.toString(), getLineNo(), getColumn());
         }
         // Expression
View Full Code Here

Examples of info.bliki.wiki.client.filter.tags.OpenTagToken

          tokenLength++;
        }
        try {
          tokenString = StringUtil.str(fSource, tagNameStart, fCurrentPosition - tagNameStart);
         
          OpenTagToken token = (OpenTagToken) WikipediaFilter.OPEN_TAGS.get(tokenString);
          if (token == null) {
            return WikipediaFilter.TokenNotFound;
          }
          copyWhite(fWhiteStart, fWhiteStartPosition, (fCurrentPosition - tagNameStart) + 1);
          if (STOP_TAGS_SET.contains(tokenString)) {
            reduceTokenStack();
          }
          if (token instanceof SpecialTagToken) {
            // for <br> <br/> <br /> <hr> <hr/>

            while (StringUtil.isWhitespace(charAt(fCurrentPosition))) {
              fCurrentPosition++;
            }
            if (charAt(fCurrentPosition) == '/') {
              fCurrentPosition++;
            }
            if (charAt(fCurrentPosition) == '>') {
              fCurrentPosition++;
              fWhiteStartPosition = fCurrentPosition;
              // insert the special tag :
              fResultBuffer.append(token.getOpenTag());
              return WikipediaFilter.TokenIgnore;
            }

          } else if (token instanceof OpenTagToken) {
            fTokenStack.push(token);
            // use these buffer because of possible exceptions
            StringBuffer buffer = new StringBuffer();
            fCurrentPosition = token.scanHTMLAttributes(buffer, fSource, fCurrentPosition);
            fResultBuffer.append("<");
            fResultBuffer.append(token.getTagName());

            fResultBuffer.append(buffer);
            fResultBuffer.append(">");
            return WikipediaFilter.TokenIgnore;
          }
View Full Code Here

Examples of info.bliki.wiki.client.filter.tags.OpenTagToken

          tokenLength++;
        }
        try {
          tokenString = StringUtil.str(fSource, tagNameStart, fCurrentPosition - tagNameStart);
         
          OpenTagToken token = (OpenTagToken) WikipediaFilter.OPEN_TAGS.get(tokenString);
          if (token == null) {
            return WikipediaFilter.TokenNotFound;
          }
          copyWhite(fWhiteStart, fWhiteStartPosition, (fCurrentPosition - tagNameStart) + 1);
          if (STOP_TAGS_SET.contains(tokenString)) {
            reduceTokenStack();
          }
          if (token instanceof SpecialTagToken) {
            // for <br> <br/> <br /> <hr> <hr/>

            while (StringUtil.isWhitespace(charAt(fCurrentPosition))) {
              fCurrentPosition++;
            }
            if (charAt(fCurrentPosition) == '/') {
              fCurrentPosition++;
            }
            if (charAt(fCurrentPosition) == '>') {
              fCurrentPosition++;
              fWhiteStartPosition = fCurrentPosition;
              // insert the special tag :
              fResultBuffer.append(token.getOpenTag());
              return WikipediaFilter.TokenIgnore;
            }

          } else if (token instanceof OpenTagToken) {
            fTokenStack.push(token);
            // use these buffer because of possible exceptions
            StringBuffer buffer = new StringBuffer();
            fCurrentPosition = token.scanHTMLAttributes(buffer, fSource, fCurrentPosition);
            fResultBuffer.append("<");
            fResultBuffer.append(token.getTagName());

            fResultBuffer.append(buffer);
            fResultBuffer.append(">");
            return WikipediaFilter.TokenIgnore;
          }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.