OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 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 """ Lexer for PPAPI IDL | 6 """ Lexer for PPAPI IDL |
7 | 7 |
8 The lexer uses the PLY library to build a tokenizer which understands both | 8 The lexer uses the PLY library to build a tokenizer which understands both |
9 WebIDL and Pepper tokens. | 9 WebIDL and Pepper tokens. |
10 | 10 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 'inherit' : 'INHERIT', | 86 'inherit' : 'INHERIT', |
87 'interface' : 'INTERFACE', | 87 'interface' : 'INTERFACE', |
88 'legacycaller' : 'LEGACYCALLER', | 88 'legacycaller' : 'LEGACYCALLER', |
89 'long' : 'LONG', | 89 'long' : 'LONG', |
90 'Nan' : 'NAN', | 90 'Nan' : 'NAN', |
91 'null' : 'NULL', | 91 'null' : 'NULL', |
92 'object' : 'OBJECT', | 92 'object' : 'OBJECT', |
93 'octet' : 'OCTET', | 93 'octet' : 'OCTET', |
94 'optional' : 'OPTIONAL', | 94 'optional' : 'OPTIONAL', |
95 'or' : 'OR', | 95 'or' : 'OR', |
96 'partial' : 'PARTIAL', | 96 'partial' : 'PARTIAL', |
| 97 'Promise' : 'PROMISE', |
97 'readonly' : 'READONLY', | 98 'readonly' : 'READONLY', |
98 'RegExp' : 'REGEXP', | 99 'RegExp' : 'REGEXP', |
99 'sequence' : 'SEQUENCE', | 100 'sequence' : 'SEQUENCE', |
100 'serializer' : 'SERIALIZER', | 101 'serializer' : 'SERIALIZER', |
101 'setter': 'SETTER', | 102 'setter': 'SETTER', |
102 'short' : 'SHORT', | 103 'short' : 'SHORT', |
103 'static' : 'STATIC', | 104 'static' : 'STATIC', |
104 'stringifier' : 'STRINGIFIER', | 105 'stringifier' : 'STRINGIFIER', |
105 'typedef' : 'TYPEDEF', | 106 'typedef' : 'TYPEDEF', |
106 'true' : 'TRUE', | 107 'true' : 'TRUE', |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 self.tokens = [] | 280 self.tokens = [] |
280 self._AddTokens(IDLLexer.tokens) | 281 self._AddTokens(IDLLexer.tokens) |
281 self._AddKeywords(IDLLexer.keywords) | 282 self._AddKeywords(IDLLexer.keywords) |
282 self._lexobj = None | 283 self._lexobj = None |
283 self.last = None | 284 self.last = None |
284 self.lines = None | 285 self.lines = None |
285 | 286 |
286 # If run by itself, attempt to build the lexer | 287 # If run by itself, attempt to build the lexer |
287 if __name__ == '__main__': | 288 if __name__ == '__main__': |
288 lexer_object = IDLLexer() | 289 lexer_object = IDLLexer() |
OLD | NEW |