MCPcopy Create free account
hub / github.com/antlr/codebuff / loadGroupFile

Method loadGroupFile

output/java8/1.4.14/STGroup.java:627–642  ·  view source on GitHub ↗

Load a group file with full path fileName; it's relative to root by prefix.

(String prefix, String fileName)

Source from the content-addressed store, hash-verified

625 /** Load a group file with full path {@code fileName}; it's relative to root by {@code prefix}. */
626
627 public void loadGroupFile(String prefix, String fileName) {
628 if ( verbose ) System.out.println(this.getClass().getSimpleName()+".loadGroupFile(group-file-prefix="+prefix+", fileName="+fileName+")");
629 GroupParser parser;
630 try {
631 URL f = new URL(fileName);
632 ANTLRInputStream fs = new ANTLRInputStream(f.openStream(), encoding);
633 GroupLexer lexer = new GroupLexer(fs);
634 fs.name = fileName;
635 CommonTokenStream tokens = new CommonTokenStream(lexer);
636 parser = new GroupParser(tokens);
637 parser.group(this, prefix);
638 }
639 catch (Exception e) {
640 errMgr.IOError(null, ErrorType.CANT_LOAD_GROUP_FILE, e, fileName);
641 }
642 }
643
644 /** Load template file into this group using absolute {@code fileName}. */
645

Callers 2

loadMethod · 0.45
loadMethod · 0.45

Calls 3

IOErrorMethod · 0.65
getSimpleNameMethod · 0.45
openStreamMethod · 0.45

Tested by

no test coverage detected