| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Generates a syntax tree from a Mojo IDL file.""" | 6 """Generates a syntax tree from a Mojo IDL file.""" |
| 7 | 7 |
| 8 | 8 |
| 9 import sys | 9 import sys |
| 10 import os.path | 10 import os.path |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 | specializedhandle""" | 187 | specializedhandle""" |
| 188 p[0] = p[1] | 188 p[0] = p[1] |
| 189 | 189 |
| 190 def p_specializedhandle(self, p): | 190 def p_specializedhandle(self, p): |
| 191 """specializedhandle : HANDLE LANGLE specializedhandlename RANGLE""" | 191 """specializedhandle : HANDLE LANGLE specializedhandlename RANGLE""" |
| 192 p[0] = "handle<" + p[3] + ">" | 192 p[0] = "handle<" + p[3] + ">" |
| 193 | 193 |
| 194 def p_specializedhandlename(self, p): | 194 def p_specializedhandlename(self, p): |
| 195 """specializedhandlename : DATA_PIPE_CONSUMER | 195 """specializedhandlename : DATA_PIPE_CONSUMER |
| 196 | DATA_PIPE_PRODUCER | 196 | DATA_PIPE_PRODUCER |
| 197 | MESSAGE_PIPE""" | 197 | MESSAGE_PIPE |
| 198 | SHARED_BUFFER""" |
| 198 p[0] = p[1] | 199 p[0] = p[1] |
| 199 | 200 |
| 200 def p_array(self, p): | 201 def p_array(self, p): |
| 201 """array : basictypename LBRACKET RBRACKET""" | 202 """array : basictypename LBRACKET RBRACKET""" |
| 202 p[0] = p[1] + "[]" | 203 p[0] = p[1] + "[]" |
| 203 | 204 |
| 204 def p_ordinal(self, p): | 205 def p_ordinal(self, p): |
| 205 """ordinal : ORDINAL | 206 """ordinal : ORDINAL |
| 206 | """ | 207 | """ |
| 207 if len(p) > 1: | 208 if len(p) > 1: |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 print Parse(f.read(), filename) | 359 print Parse(f.read(), filename) |
| 359 except ParseError, e: | 360 except ParseError, e: |
| 360 print e | 361 print e |
| 361 return 1 | 362 return 1 |
| 362 | 363 |
| 363 return 0 | 364 return 0 |
| 364 | 365 |
| 365 | 366 |
| 366 if __name__ == '__main__': | 367 if __name__ == '__main__': |
| 367 sys.exit(main(sys.argv)) | 368 sys.exit(main(sys.argv)) |
| OLD | NEW |