Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: client/dom/scripts/idlparser.dart

Issue 8384029: Work-arounds for missing and broken Frog functionality. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | client/dom/scripts/idlrenderer.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // IDL grammar variants. 5 // IDL grammar variants.
6 final int WEBIDL_SYNTAX = 0; 6 final int WEBIDL_SYNTAX = 0;
7 final int WEBKIT_SYNTAX = 1; 7 final int WEBKIT_SYNTAX = 1;
8 final int FREMONTCUT_SYNTAX = 2; 8 final int FREMONTCUT_SYNTAX = 2;
9 9
10 /** 10 /**
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 class IDLParser { 247 class IDLParser {
248 final int syntax; 248 final int syntax;
249 Grammar grammar; 249 Grammar grammar;
250 var axiom; 250 var axiom;
251 251
252 IDLParser([syntax=WEBIDL_SYNTAX]) : syntax = syntax { 252 IDLParser([syntax=WEBIDL_SYNTAX]) : syntax = syntax {
253 grammar = new Grammar(); 253 grammar = new Grammar();
254 axiom = _makeParser(); 254 axiom = _makeParser();
255 } 255 }
256 256
257 syntax_switch([WebIDL, WebKit, FremontCut]) {
258 assert(WebIDL != null && WebKit != null); // Not options, just want names.
259 if (syntax == WEBIDL_SYNTAX)
260 return WebIDL;
261 if (syntax == WEBKIT_SYNTAX)
262 return WebKit;
263 if (syntax == FREMONTCUT_SYNTAX)
264 return FremontCut == null ? WebIDL : FremontCut;
265 throw new Exception('unsupported IDL syntax $syntax');
266 }
267
257 _makeParser() { 268 _makeParser() {
258 Grammar g = grammar; 269 Grammar g = grammar;
259 270
260 syntax_switch([WebIDL, WebKit, FremontCut]) { 271 // TODO: move syntax_switch back to here.
261 assert(WebIDL != null && WebKit != null); // Not options, just want names .
262 if (syntax == WEBIDL_SYNTAX)
263 return WebIDL;
264 if (syntax == WEBKIT_SYNTAX)
265 return WebKit;
266 if (syntax == FREMONTCUT_SYNTAX)
267 return FremontCut == null ? WebIDL : FremontCut;
268 throw new Exception('unsupported IDL syntax $syntax');
269 }
270 272
271 var idStartCharSet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_' ; 273 var idStartCharSet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_' ;
272 var idNextCharSet = idStartCharSet + '0123456789'; 274 var idNextCharSet = idStartCharSet + '0123456789';
273 var hexCharSet = '0123456789ABCDEFabcdef'; 275 var hexCharSet = '0123456789ABCDEFabcdef';
274 276
275 var idStartChar = CHAR(idStartCharSet); 277 var idStartChar = CHAR(idStartCharSet);
276 var idNextChar = CHAR(idNextCharSet); 278 var idNextChar = CHAR(idNextCharSet);
277 279
278 var digit = CHAR('0123456789'); 280 var digit = CHAR('0123456789');
279 281
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 OR([MANY(CHAR(' \t\r\n')), 540 OR([MANY(CHAR(' \t\r\n')),
539 ['//', MANY0([NOT(CHAR('\r\n')), CHAR()])], 541 ['//', MANY0([NOT(CHAR('\r\n')), CHAR()])],
540 ['#', MANY0([NOT(CHAR('\r\n')), CHAR()])], 542 ['#', MANY0([NOT(CHAR('\r\n')), CHAR()])],
541 ['/*', MANY0([NOT('*/'), CHAR()]), '*/']]); 543 ['/*', MANY0([NOT('*/'), CHAR()]), '*/']]);
542 544
543 // Top level - at least one definition. 545 // Top level - at least one definition.
544 return MANY(Definition); 546 return MANY(Definition);
545 547
546 } 548 }
547 } 549 }
OLDNEW
« no previous file with comments | « no previous file | client/dom/scripts/idlrenderer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698