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

Method loadGroupFile

output/java8/1.4.15/STGroup.java:628–643  ·  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+", fileName="+fileName+")");
630 GroupParser parser;
631 try {
632 URL f = new URL(fileName);
633 ANTLRInputStream fs = new ANTLRInputStream(f.openStream(), encoding);
634 GroupLexer lexer = new GroupLexer(fs);
635 fs.name = fileName;
636 CommonTokenStream tokens = new CommonTokenStream(lexer);
637 parser = new GroupParser(tokens);
638 parser.group(this, prefix);
639 }
640 catch (Exception e) {
641 errMgr.IOError(null, ErrorType.CANT_LOAD_GROUP_FILE, e, fileName);
642 }
643 }
644
645 /** Load template file into this group using absolute {@code fileName}. */
646

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