本文整理匯總了Java中org.antlr.runtime.CharStream.substring方法的典型用法代碼示例。如果您正苦於以下問題:Java CharStream.substring方法的具體用法?Java CharStream.substring怎麽用?Java CharStream.substring使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.antlr.runtime.CharStream
的用法示例。
在下文中一共展示了CharStream.substring方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: loadTemplateFile
import org.antlr.runtime.CharStream; //導入方法依賴的package包/類
@Override
public CompiledST loadTemplateFile(String prefix, String unqualifiedFileName, CharStream templateStream) {
String template = templateStream.substring(0, templateStream.size()- 1);
String templateName = Misc.getFileNameNoSuffix(unqualifiedFileName);
String fullyQualifiedTemplateName = prefix+templateName;
CompiledST impl = new Compiler(this).compile(fullyQualifiedTemplateName, template);
CommonToken nameT = new CommonToken(STLexer.SEMI); // Seems like a hack, best I could come up with.
nameT.setInputStream(templateStream);
rawDefineTemplate(fullyQualifiedTemplateName, impl, nameT);
impl.defineImplicitlyDefinedTemplates(this);
return impl;
}
示例2: loadTemplateFile
import org.antlr.runtime.CharStream; //導入方法依賴的package包/類
@Override
public CompiledST loadTemplateFile(String prefix, String unqualifiedFileName,
CharStream templateStream)
{
String template = templateStream.substring(0, templateStream.size() - 1);
String templateName = Misc.getFileNameNoSuffix(unqualifiedFileName);
String fullyQualifiedTemplateName = prefix + templateName;
CompiledST impl = new Compiler(this).compile(fullyQualifiedTemplateName, template);
CommonToken nameT = new CommonToken(STLexer.SEMI); // Seems like a hack, best I could come up with.
nameT.setInputStream(templateStream);
rawDefineTemplate(fullyQualifiedTemplateName, impl, nameT);
impl.defineImplicitlyDefinedTemplates(this);
return impl;
}