本文整理汇总了Java中org.parboiled.annotations.SuppressSubnodes类的典型用法代码示例。如果您正苦于以下问题:Java SuppressSubnodes类的具体用法?Java SuppressSubnodes怎么用?Java SuppressSubnodes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SuppressSubnodes类属于org.parboiled.annotations包,在下文中一共展示了SuppressSubnodes类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: number
import org.parboiled.annotations.SuppressSubnodes; //导入依赖的package包/类
@SuppressSubnodes
public Rule number()
{
return Sequence(
Optional(OP_MINUS),
FirstOf(
// hex number
Sequence(FirstOf("0x", "0X"), OneOrMore(FirstOf("_", hexDigit()))),
// decimal
// fractional
Sequence(fraction(), Optional(exponent())),
Sequence(digit(),
ZeroOrMore(Sequence(ZeroOrMore("_"), digit())),
Optional(fraction()),
Optional(exponent()))),
Optional(nbType()), OPT_SP).label(FantomLexerTokens.TokenName.NUMBER.name());
}
示例2: number
import org.parboiled.annotations.SuppressSubnodes; //导入依赖的package包/类
@SuppressSubnodes
public Rule number() {
return Sequence(
Optional(OP_MINUS),
FirstOf(
// hex number
Sequence(FirstOf("0x", "0X"), OneOrMore(FirstOf("_", hexDigit()))),
// decimal
// fractional
Sequence(fraction(), Optional(exponent())),
Sequence(digit(),
ZeroOrMore(Sequence(ZeroOrMore("_"), digit())),
Optional(fraction()),
Optional(exponent()))),
Optional(nbType()), OPT_SP).label(FantomLexerTokens.TokenName.NUMBER.name());
}
示例3: Literal
import org.parboiled.annotations.SuppressSubnodes; //导入依赖的package包/类
@DontLabel
@SuppressSubnodes
Rule Literal(String string) {
return Sequence(
String(string),
Spacing());
}
示例4: Identifier
import org.parboiled.annotations.SuppressSubnodes; //导入依赖的package包/类
@SuppressSubnodes
@MemoMismatches
Rule Identifier() {
return Sequence(
TestNot(Keyword()),
Sequence(Sequence(IdentifierStartLetter(), ZeroOrMore(LetterOrDigit())), Identifier.of()),
Spacing());
}
示例5: TypeIdentifer
import org.parboiled.annotations.SuppressSubnodes; //导入依赖的package包/类
@SuppressSubnodes
@MemoMismatches
Rule TypeIdentifer() {
return Sequence(TestNot(Keyword()),
Sequence(Sequence(TypeStartLetter(), ZeroOrMore(LetterOrDigit())), TypeIdentifier.of()),
Spacing());
}
示例6: UPPER
import org.parboiled.annotations.SuppressSubnodes; //导入依赖的package包/类
@SuppressSubnodes
protected Rule UPPER() {
return FirstOf(
CharRange('A', 'Z'),
CharRange('\u00C0', '\u00DE')
);
}
示例7: LOWER
import org.parboiled.annotations.SuppressSubnodes; //导入依赖的package包/类
@SuppressSubnodes
protected Rule LOWER() {
return FirstOf(
CharRange('a', 'z'),
CharRange('\u00DF', '\u00FF')
);
}
示例8: PUNCT
import org.parboiled.annotations.SuppressSubnodes; //导入依赖的package包/类
@SuppressSubnodes
protected Rule PUNCT() {
return FirstOf(
CharRange('\u0021', '\u002F'),
CharRange('\u003A', '\u0040'),
CharRange('\u005B', '\u0060'),
CharRange('\u007B', '\u007E'),
CharRange('\u00A0', '\u00BF'),
CharRange('\u2000', '\u206F')
);
}
示例9: W
import org.parboiled.annotations.SuppressSubnodes; //导入依赖的package包/类
@SuppressSubnodes
protected Rule W() {
return FirstOf(
CharRange('\u0000', '\u001F'),
// CharRange('\u0030', '\u0039'),
CharRange('\u0041', '\u005A'),
CharRange('\u0061', '\u007A'),
CharRange('\u007F', '\u009F'),
CharRange('\u00C0', '\u1FFF'),
CharRange('\u2070', '\u2DFF'),
CharRange('\u2E80', '\uFFCF')
);
// return Sequence(TestNot(FirstOf(PUNCT(), S(), Nl())), ANY);
}
示例10: Identifier
import org.parboiled.annotations.SuppressSubnodes; //导入依赖的package包/类
@SuppressSubnodes
public Rule Identifier() {
Var<StringBuilder> id = new Var<>(new StringBuilder());
Var<ArgumentsNode> optional = new Var<>();
return Sequence(
IdentStart(), (id.get().append(match())!=null),
ZeroOrMore(IdentCont(), (id.get().append(match())!=null)),
Optional(Arguments(), optional.set((ArgumentsNode)pop())),
push(new IdentifierNode(id.get().toString(), optional.get(), (Tuple2)pop())),
Spacing()
);
}
示例11: Char
import org.parboiled.annotations.SuppressSubnodes; //导入依赖的package包/类
@SuppressSubnodes
public Rule Char() {
return FirstOf(
Sequence("\\", AnyOf("nrt'\"[]\\")),
Sequence("\\", CharRange('0','2'), CharRange('0','7'), CharRange('0','7')),
Sequence("\\", CharRange('0','7'), Optional(CharRange('0','7'))),
Sequence(TestNot("\\"), ANY)
);
}
示例12: stringLiteralRaw
import org.parboiled.annotations.SuppressSubnodes; //导入依赖的package包/类
@SuppressSubnodes
Rule stringLiteralRaw() {
return Sequence(
Ch('"'),
ZeroOrMore(FirstOf(
stringEscape(),
Sequence(TestNot(CharSet("\"\r\n")), Any()))),
Ch('"'));
}
示例13: DecimalFloat
import org.parboiled.annotations.SuppressSubnodes; //导入依赖的package包/类
@SuppressSubnodes
public Rule DecimalFloat() {
return FirstOf(
Sequence(OneOrMore(Digit()), '.', ZeroOrMore(Digit()), Optional(Exponent()), Optional(CharSet("fFdD"))),
Sequence('.', OneOrMore(Digit()), Optional(Exponent()), Optional(CharSet("fFdD"))),
Sequence(OneOrMore(Digit()), Exponent(), Optional(CharSet("fFdD"))),
Sequence(OneOrMore(Digit()), Optional(Exponent()), CharSet("fFdD"))
);
}
示例14: Clause
import org.parboiled.annotations.SuppressSubnodes; //导入依赖的package包/类
@SuppressSubnodes
public Rule Clause() {
Reference<Integer> a = new Reference<Integer>();
Reference<Character> op = new Reference<Character>();
Reference<Integer> b = new Reference<Integer>();
return Sequence(
Digits(), a.set(pop()),
Operator(), op.set(matchedChar()),
Digits(), b.set(pop()),
EOI,
push(op.get() == '+' ? a.get() + b.get() : a.get() - b.get())
);
}
示例15: Attribute
import org.parboiled.annotations.SuppressSubnodes; //导入依赖的package包/类
@SuppressSubnodes
public Rule Attribute() {
return NodeSequence(
Name(),
"=",
Value(),
push(new AttributeNode((String) pop(1), (String) pop())));
}