OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Generates a syntax tree from a Mojo IDL file.""" | 5 """Generates a syntax tree from a Mojo IDL file.""" |
6 | 6 |
7 import imp | 7 import imp |
8 import os.path | 8 import os.path |
9 import sys | 9 import sys |
10 | 10 |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 | 415 |
416 def Parse(source, filename): | 416 def Parse(source, filename): |
417 lexer = Lexer(filename) | 417 lexer = Lexer(filename) |
418 parser = Parser(lexer, source, filename) | 418 parser = Parser(lexer, source, filename) |
419 | 419 |
420 lex.lex(object=lexer) | 420 lex.lex(object=lexer) |
421 yacc.yacc(module=parser, debug=0, write_tables=0) | 421 yacc.yacc(module=parser, debug=0, write_tables=0) |
422 | 422 |
423 tree = yacc.parse(source) | 423 tree = yacc.parse(source) |
424 return tree | 424 return tree |
OLD | NEW |