| Conditions | 2 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | """ |
||
| 37 | def process(self, infile, outfile): |
||
| 38 | """ |
||
| 39 | Processes a SDoc1 document. |
||
| 40 | |||
| 41 | :param str infile: The input filename with the SDoc1 document. |
||
| 42 | :param str outfile: The output filename with the SDoc2 document. |
||
| 43 | """ |
||
| 44 | in_stream = antlr4.FileStream(infile) |
||
| 45 | |||
| 46 | with open(outfile, 'wt') as out_stream: |
||
| 47 | lexer = sdoc1Lexer(in_stream) |
||
| 48 | tokens = antlr4.CommonTokenStream(lexer) |
||
| 49 | parser = sdoc1Parser(tokens) |
||
| 50 | tree = parser.sdoc() |
||
| 51 | |||
| 52 | visitor = SDoc1Visitor(self._styled_output, root_dir=os.path.dirname(os.path.realpath(infile))) |
||
| 53 | |||
| 54 | visitor.output = out_stream |
||
| 55 | visitor.visit(tree) |
||
| 56 | |||
| 57 | return visitor.errors |
||
| 58 | |||
| 60 |