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

Method loadGroupFile

output/java/1.4.15/STGroup.java:628–646  ·  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

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

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