本文整理汇总了Java中org.sonar.sslr.grammar.GrammarRuleKey类的典型用法代码示例。如果您正苦于以下问题:Java GrammarRuleKey类的具体用法?Java GrammarRuleKey怎么用?Java GrammarRuleKey使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GrammarRuleKey类属于org.sonar.sslr.grammar包,在下文中一共展示了GrammarRuleKey类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createNonTerminal
import org.sonar.sslr.grammar.GrammarRuleKey; //导入依赖的package包/类
@Override
public Object createNonTerminal(GrammarRuleKey ruleKey, Rule rule, List<Object> children, int startIndex, int endIndex) {
for (Object child : children) {
if (child instanceof InternalSyntaxToken) {
return child;
}
}
return new InternalSyntaxSpacing(startIndex, endIndex);
}
示例2: assertThat
import org.sonar.sslr.grammar.GrammarRuleKey; //导入依赖的package包/类
public static ParserAssert assertThat(LexerlessGrammarBuilder b, GrammarRuleKey rule) {
return new ParserAssert(new ActionParser<Tree>(
Charsets.UTF_8,
b,
OneCGrammar.class,
new TreeFactory(),
new OneCNodeBuilder(),
rule));
}
示例3: createParser
import org.sonar.sslr.grammar.GrammarRuleKey; //导入依赖的package包/类
private static ActionParser<Tree> createParser(Charset charset, GrammarRuleKey rootRule) {
return new CssParser(
charset,
LexicalGrammar.createCssGrammar(),
CssGrammar.class,
new TreeFactory(),
new CssNodeBuilder(),
rootRule);
}
示例4: createParser
import org.sonar.sslr.grammar.GrammarRuleKey; //导入依赖的package包/类
private static ActionParser<Tree> createParser(Charset charset, GrammarRuleKey rootRule) {
return new EmbeddedCssParser(
charset,
LexicalGrammar.createEmbeddedCssGrammar(),
EmbeddedCssGrammar.class,
new TreeFactory(),
new EmbeddedCssNodeBuilder(),
rootRule);
}
示例5: createParser
import org.sonar.sslr.grammar.GrammarRuleKey; //导入依赖的package包/类
private static ActionParser<Tree> createParser(Charset charset, GrammarRuleKey rootRule) {
return new LessParser(
charset,
LexicalGrammar.createLessGrammar(),
LessGrammar.class,
new TreeFactory(),
new LessNodeBuilder(),
rootRule);
}
示例6: createNonTerminal
import org.sonar.sslr.grammar.GrammarRuleKey; //导入依赖的package包/类
@Override
public Object createNonTerminal(GrammarRuleKey ruleKey, Rule rule, List<Object> children, int startIndex, int endIndex) {
for (Object child : children) {
if (child instanceof InternalSyntaxToken) {
return child;
}
}
return new InternalSyntaxSpacing(startIndex, endIndex);
}
示例7: createParser
import org.sonar.sslr.grammar.GrammarRuleKey; //导入依赖的package包/类
private static ActionParser<Tree> createParser(Charset charset, GrammarRuleKey rootRule) {
return new ScssParser(
charset,
LexicalGrammar.createScssGrammar(),
ScssGrammar.class,
new TreeFactory(),
new ScssNodeBuilder(),
rootRule);
}
示例8: createParser
import org.sonar.sslr.grammar.GrammarRuleKey; //导入依赖的package包/类
private static GherkinParser createParser(Charset charset, GrammarRuleKey rootRule, String language) {
return new GherkinParser(
charset,
GherkinLexicalGrammar.createGrammar(language),
GherkinGrammar.class,
new TreeFactory(),
new GherkinNodeBuilder(),
rootRule);
}
示例9: createParser
import org.sonar.sslr.grammar.GrammarRuleKey; //导入依赖的package包/类
private static ActionParser<Tree> createParser(Charset charset, GrammarRuleKey rootRule) {
return new ActionParser<>(
charset,
JavaPropertiesLexicalGrammar.createGrammar(),
JavaPropertiesGrammar.class,
new TreeFactory(),
new JavaPropertiesNodeBuilder(),
rootRule);
}
示例10: createParser
import org.sonar.sslr.grammar.GrammarRuleKey; //导入依赖的package包/类
private static ActionParser<Tree> createParser(Charset charset, GrammarRuleKey rootRule) {
return new ActionParser<>(
charset,
JSONLexicalGrammar.createGrammar(),
JSONGrammar.class,
new TreeFactory(),
new JSONNodeBuilder(),
rootRule);
}
示例11: KindMaps
import org.sonar.sslr.grammar.GrammarRuleKey; //导入依赖的package包/类
public KindMaps() {
ImmutableMap.Builder<GrammarRuleKey, Tree.Kind> literalsBuilder = ImmutableMap.builder();
this.literals = literalsBuilder.build();
}
示例12: AbstractParser
import org.sonar.sslr.grammar.GrammarRuleKey; //导入依赖的package包/类
public AbstractParser(Charset charset, LexerlessGrammarBuilder grammarBuilder, Class<? extends CssGrammar> grammarClass,
TreeFactory treeFactory, AbstractNodeBuilder nodeBuilder, GrammarRuleKey rootRule) {
super(charset, grammarBuilder, grammarClass, treeFactory, nodeBuilder, rootRule);
}
示例13: CssParser
import org.sonar.sslr.grammar.GrammarRuleKey; //导入依赖的package包/类
private CssParser(Charset charset, LexerlessGrammarBuilder grammarBuilder, Class<CssGrammar> cssGrammarClass,
TreeFactory treeFactory, CssNodeBuilder cssNodeBuilder, GrammarRuleKey rootRule) {
super(charset, grammarBuilder, cssGrammarClass, treeFactory, cssNodeBuilder, rootRule);
}
示例14: createTestParser
import org.sonar.sslr.grammar.GrammarRuleKey; //导入依赖的package包/类
@VisibleForTesting
public static ActionParser<Tree> createTestParser(Charset charset, GrammarRuleKey rootRule) {
return createParser(charset, rootRule);
}
示例15: EmbeddedCssParser
import org.sonar.sslr.grammar.GrammarRuleKey; //导入依赖的package包/类
private EmbeddedCssParser(Charset charset, LexerlessGrammarBuilder grammarBuilder, Class<EmbeddedCssGrammar> embeddedCssGrammarClass,
TreeFactory treeFactory, EmbeddedCssNodeBuilder embeddedCssNodeBuilder, GrammarRuleKey rootRule) {
super(charset, grammarBuilder, embeddedCssGrammarClass, treeFactory, embeddedCssNodeBuilder, rootRule);
}