(String fileName)
| 572 | } |
| 573 | |
| 574 | public GrammarRootAST parseGrammar(String fileName) { |
| 575 | try { |
| 576 | File file = new File(fileName); |
| 577 | if (!file.isAbsolute()) { |
| 578 | file = new File(inputDirectory, fileName); |
| 579 | } |
| 580 | |
| 581 | ANTLRFileStream in = new ANTLRFileStream(file.getAbsolutePath(), grammarEncoding); |
| 582 | GrammarRootAST t = parse(fileName, in); |
| 583 | return t; |
| 584 | } |
| 585 | catch (IOException ioe) { |
| 586 | errMgr.toolError(ErrorType.CANNOT_OPEN_FILE, ioe, fileName); |
| 587 | } |
| 588 | return null; |
| 589 | } |
| 590 | |
| 591 | /** Convenience method to load and process an ANTLR grammar. Useful |
| 592 | * when creating interpreters. If you need to access to the lexer |
no test coverage detected