本文整理汇总了Java中org.antlr.stringtemplate.StringTemplateGroup.loadGroup方法的典型用法代码示例。如果您正苦于以下问题:Java StringTemplateGroup.loadGroup方法的具体用法?Java StringTemplateGroup.loadGroup怎么用?Java StringTemplateGroup.loadGroup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.antlr.stringtemplate.StringTemplateGroup
的用法示例。
在下文中一共展示了StringTemplateGroup.loadGroup方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TemplateTypeBuilder
import org.antlr.stringtemplate.StringTemplateGroup; //导入方法依赖的package包/类
public TemplateTypeBuilder(TypeSpecification spec) {
CommonGroupLoader loader = new CommonGroupLoader("org/lemurproject/galago/tupleflow/templates", null);
StringTemplateGroup.registerGroupLoader(loader);
StringTemplateGroup.registerDefaultLexer(AngleBracketTemplateLexer.class);
this.template = StringTemplateGroup.loadGroup("GalagoType");
this.typeName = spec.getTypeName();
this.typePackage = spec.getPackageName();
this.typeFields = new ArrayList<Field>();
this.typeOrders = new ArrayList<OrderSpec>();
for (FieldSpecification fieldSpec : spec.getFields()) {
Field field = new Field(fieldSpec.getType(), fieldSpec.getName());
typeFields.add(field);
}
for (OrderSpecification orderSpec : spec.getOrders()) {
OrderSpec order = new OrderSpec(orderSpec, typeFields);
typeOrders.add(order);
}
}
示例2: TemplateTypeBuilder
import org.antlr.stringtemplate.StringTemplateGroup; //导入方法依赖的package包/类
public TemplateTypeBuilder(TypeSpecification spec) {
CommonGroupLoader loader = new CommonGroupLoader("org/galagosearch/tupleflow/templates", null);
StringTemplateGroup.registerGroupLoader(loader);
StringTemplateGroup.registerDefaultLexer(AngleBracketTemplateLexer.class);
this.template = StringTemplateGroup.loadGroup("GalagoType");
this.typeName = spec.getTypeName();
this.typePackage = spec.getPackageName();
this.typeFields = new ArrayList<Field>();
this.typeOrders = new ArrayList<OrderSpec>();
for (FieldSpecification fieldSpec : spec.getFields()) {
Field field = new Field(fieldSpec.getType(), fieldSpec.getName());
typeFields.add(field);
}
for (OrderSpecification orderSpec : spec.getOrders()) {
OrderSpec order = new OrderSpec(orderSpec, typeFields);
typeOrders.add(order);
}
}
示例3: compileToBuffer
import org.antlr.stringtemplate.StringTemplateGroup; //导入方法依赖的package包/类
public StringBuffer compileToBuffer(String className, String lexerName,
String parserName) {
StringTemplateGroup group = StringTemplateGroup.loadGroup("junit");
StringBuffer buf = new StringBuffer();
buf.append(genClassHeader(group, className));
buf.append(genTestRuleMethods(group));
buf.append(genSupportingMethods(group, lexerName, parserName));
buf.append(group.getInstanceOf("examineParserExecResult").toString());
buf.append("\n\n}");
return buf;
}
示例4: getTemplateGroup
import org.antlr.stringtemplate.StringTemplateGroup; //导入方法依赖的package包/类
private StringTemplateGroup getTemplateGroup() {
StringTemplateGroupLoader loader = new CommonGroupLoader("org/antlr/gunit", null);
StringTemplateGroup.registerGroupLoader(loader);
StringTemplateGroup.registerDefaultLexer(AngleBracketTemplateLexer.class);
StringTemplateGroup group = StringTemplateGroup.loadGroup("gUnitTestResult");
return group;
}