当前位置: 首页>>代码示例>>Java>>正文


Java StringBuilderVar类代码示例

本文整理汇总了Java中org.parboiled.support.StringBuilderVar的典型用法代码示例。如果您正苦于以下问题:Java StringBuilderVar类的具体用法?Java StringBuilderVar怎么用?Java StringBuilderVar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


StringBuilderVar类属于org.parboiled.support包,在下文中一共展示了StringBuilderVar类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: BlockRule

import org.parboiled.support.StringBuilderVar; //导入依赖的package包/类
Rule BlockRule() {
  StringBuilderVar style = new StringBuilderVar();
  StringBuilderVar body = new StringBuilderVar();

  return NodeSequence(
      StartMarker(),
      Optional(
          String("style="),
          Sequence(OneOrMore(Letter()), style.append(match()), Spn1())),
      Sequence(Body(), body.append(match())),
      EndMarker(),
      push(
          new ExpImageNode("title",
              createWebsequenceUrl(style.getString(), body.getString()),
              new TextNode("")))
  );
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:18,代码来源:PegdownWebSequencelPlugin.java

示例2: BlockRule

import org.parboiled.support.StringBuilderVar; //导入依赖的package包/类
Rule BlockRule() {
  ParamVar<String, String> params = new ParamVar<String, String>();
  StringBuilderVar name = new StringBuilderVar();
  StringBuilderVar value = new StringBuilderVar();
  StringBuilderVar body = new StringBuilderVar();

  return NodeSequence(
      StartMarker(),
      ZeroOrMore(
          Sequence(
              ParameterName(), name.append(match()),
              String("="),
              OneOrMore(Alphanumeric()), value.append(match())),
          Sp(),
          params.put(name.getString(), value.getString()),
          name.clear(), value.clear()),
      Body(),
      body.append(match()),
      EndMarker(),
      push(
          new ExpImageNode(
              "title", createYumlUrl(params.get(), body.getString()), new TextNode("")))
  );
}
 
开发者ID:apache,项目名称:zeppelin,代码行数:25,代码来源:PegdownYumlPlugin.java

示例3: Box

import org.parboiled.support.StringBuilderVar; //导入依赖的package包/类
public Rule Box() {
    StringBuilderVar inner = new StringBuilderVar();
    return NodeSequence(
            OneOrMore(
                    xcrossedOut(Sequence('G', '>', Optional(' ')), inner),
                    Line(inner)
            ),
            // trigger a recursive parsing run on the inner source we just built
            // and attach the root of the inner parses AST
            push(new GenericBoxNode(
                    xwithIndicesShifted(
                            delegate.get().parseInternal(inner),
                            (Integer) peek()
                    ).getChildren()))
    );
}
 
开发者ID:Arnauld,项目名称:gutenberg,代码行数:17,代码来源:GenericBoxPlugin.java

示例4: parseInternal

import org.parboiled.support.StringBuilderVar; //导入依赖的package包/类
public DocumentNode parseInternal(StringBuilderVar block) {
	char[] chars = block.getChars();
	int[] ixMap = new int[chars.length + 1]; // map of cleaned indices to
												// original indices

	// strip out CROSSED_OUT characters and build index map
	StringBuilder clean = new StringBuilder();
	// for (int i = 0; i < chars.length; i++) {
	// char c = chars[i];
	// if (c != CROSSED_OUT) {
	// ixMap[clean.length()] = i;
	// clean.append(c);
	// }
	// }
	ixMap[clean.length()] = chars.length;

	// run inner parse
	char[] cleaned = new char[clean.length()];
	clean.getChars(0, cleaned.length, cleaned, 0);
	DocumentNode rootNode = parseInternal(cleaned);

	// correct AST indices with index map
	fixIndices(rootNode, ixMap);

	return rootNode;
}
 
开发者ID:asciidocj,项目名称:asciidocj,代码行数:27,代码来源:AsciiDocParser.java

示例5: attributesRules

import org.parboiled.support.StringBuilderVar; //导入依赖的package包/类
public Rule attributesRules() {
    StringBuilderVar text = new StringBuilderVar();
    return NodeSequence(
            Sp(),
            "{",
            OneOrMore(TestNot("}"), TestNot(Newline()), BaseParser.ANY, text.append(matchedChar())),
            "}",
            Sp(),
            Newline(),
            push(new AttributesNode(text.getString()))
    );
}
 
开发者ID:Arnauld,项目名称:gutenberg,代码行数:13,代码来源:AttributesPlugin.java

示例6: FootnoteContent

import org.parboiled.support.StringBuilderVar; //导入依赖的package包/类
public Rule FootnoteContent() {
    StringBuilderVar ref = new StringBuilderVar();
    StringBuilderVar txt = new StringBuilderVar();
    return NodeSequence(
            '[',
            OneOrMore(TestNot(']'), ANY, ref.append(matchedChar())),
            ']', ':', Sp(),
            ZeroOrMore(TestNot(BlankLine()), ANY, txt.append(matchedChar())),
            FirstOf(BlankLine(), EOI),
            push(new LinkContentNode(ref.getString(), txt.getString())));
}
 
开发者ID:Arnauld,项目名称:gutenberg,代码行数:12,代码来源:LinkContentPlugin.java

示例7: Name

import org.parboiled.support.StringBuilderVar; //导入依赖的package包/类
@SuppressSubnodes
public Rule Name() {
    StringBuilderVar text = new StringBuilderVar();
    return Sequence(FirstOf(
                    Sequence(Ch('"'), OneOrMore(TestNot('"'), BaseParser.ANY, text.append(matchedChar())), Ch('"')),
                    OneOrMore(TestNot("="), TestNot(Newline()), BaseParser.ANY, text.append(matchedChar()))),
            push(text.getString())
    );
}
 
开发者ID:Arnauld,项目名称:gutenberg,代码行数:10,代码来源:AttributesParser.java

示例8: Value

import org.parboiled.support.StringBuilderVar; //导入依赖的package包/类
@SuppressSubnodes
public Rule Value() {
    StringBuilderVar text = new StringBuilderVar();
    return Sequence(FirstOf(
                    Sequence(Ch('"'), OneOrMore(TestNot('"'), BaseParser.ANY, text.append(matchedChar())), Ch('"')),
                    OneOrMore(TestNot("}"), TestNot(","), TestNot(Newline()), BaseParser.ANY, text.append(matchedChar()))),
            push(text.getString())
    );
}
 
开发者ID:Arnauld,项目名称:gutenberg,代码行数:10,代码来源:AttributesParser.java

示例9: asciiFenceRule

import org.parboiled.support.StringBuilderVar; //导入依赖的package包/类
public Rule asciiFenceRule() {
    StringBuilderVar text = new StringBuilderVar();
    return NodeSequence(
            BlockBeginMarker(),
            OneOrMore(TestNot(Newline(), BlockEndMarker()), BaseParser.ANY, text.append(matchedChar())),
            Newline(),
            ((NamedBlockNode) peek()).appendBody(text.getString()),
            BlockEndMarker()
    );
}
 
开发者ID:Arnauld,项目名称:cucumber-contrib,代码行数:11,代码来源:NamedBlockCurlyBracePlugin.java

示例10: BlockBeginMarker

import org.parboiled.support.StringBuilderVar; //导入依赖的package包/类
public Rule BlockBeginMarker() {
    StringBuilderVar text = new StringBuilderVar();
    return NodeSequence(
            Sp(),
            "{%",
            OneOrMore(TestNot("%}"), BaseParser.ANY, text.append(matchedChar())),
            Sp(),
            "%}",
            push(new NamedBlockNode(text.getString())),
            Newline());
}
 
开发者ID:Arnauld,项目名称:cucumber-contrib,代码行数:12,代码来源:NamedBlockCurlyBracePlugin.java

示例11: BlockEndMarker

import org.parboiled.support.StringBuilderVar; //导入依赖的package包/类
public Rule BlockEndMarker() {
    StringBuilderVar text = new StringBuilderVar();
    //((NamedBlockNode)peek()).getHeaderTag(),
    return Sequence(
            Sp(),
            "{%",
            OneOrMore(TestNot("%}"), BaseParser.ANY, text.append(matchedChar())),
            "%}",
            Sp(),
            ((NamedBlockNode) peek()).endTag(text.getString()),
            Newline());
}
 
开发者ID:Arnauld,项目名称:cucumber-contrib,代码行数:13,代码来源:NamedBlockCurlyBracePlugin.java

示例12: BlockBeginMarker

import org.parboiled.support.StringBuilderVar; //导入依赖的package包/类
public Rule BlockBeginMarker() {
    StringBuilderVar text = new StringBuilderVar();
    return NodeSequence(
            Sp(),
            "[",
            OneOrMore(TestNot("]"), BaseParser.ANY, text.append(matchedChar())),
            "]",
            Newline(),
            Sp(),
            NOrMore('-', 4),
            push(new NamedBlockNode(text.getString())),
            Newline());
}
 
开发者ID:Arnauld,项目名称:cucumber-contrib,代码行数:14,代码来源:NamedBlockSquareBracketAndDashPlugin.java

示例13: DoubleQuoteString

import org.parboiled.support.StringBuilderVar; //导入依赖的package包/类
Rule DoubleQuoteString() {
    StringBuilderVar str = new StringBuilderVar();
    return Sequence('"', ZeroOrMore(FirstOf(Escape(str),
            Sequence(TestNot(AnyOf("\r\n\"\\")), ANY, str.append(match())))).suppressSubnodes(), '"',
            push(str.getString()));
}
 
开发者ID:edmocosta,项目名称:queryfy,代码行数:7,代码来源:QueryParser.java

示例14: SingleQuoteString

import org.parboiled.support.StringBuilderVar; //导入依赖的package包/类
Rule SingleQuoteString() {
    StringBuilderVar str = new StringBuilderVar();
    return Sequence('\'', ZeroOrMore(FirstOf(Escape(str),
            Sequence(TestNot(AnyOf("\r\n'\\")), ANY, str.append(match())))).suppressSubnodes(), '\'',
            push(str.getString()));
}
 
开发者ID:edmocosta,项目名称:queryfy,代码行数:7,代码来源:QueryParser.java

示例15: Escape

import org.parboiled.support.StringBuilderVar; //导入依赖的package包/类
Rule Escape(StringBuilderVar str) {
    return Sequence('\\', FirstOf(AnyOf("btnfr\"\'\\"), OctalEscape(), UnicodeEscape()), str.append(match()));
}
 
开发者ID:edmocosta,项目名称:queryfy,代码行数:4,代码来源:QueryParser.java


注:本文中的org.parboiled.support.StringBuilderVar类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。