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

Side by Side Diff: dart/language/grammar/TestGrammar.java

Issue 10917035: Remove language directory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 months 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 | « dart/language/grammar/PRESUBMIT.py ('k') | dart/language/grammar/antlrworks.jar » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 package com.google.dart.antlr;
6
7 import org.antlr.runtime.ANTLRFileStream;
8 import org.antlr.runtime.CharStream;
9 import org.antlr.runtime.CommonTokenStream;
10
11 /**
12 * Test rig for testing the Dart grammar.
13 */
14 public class TestGrammar {
15 public static void main(String... arguments) throws Exception {
16 boolean hasErrors = false;
17 if (arguments.length == 0) {
18 throw new AssertionError("No files given on command line");
19 }
20 for (String argument : arguments) {
21 CharStream input = new ANTLRFileStream(argument, "UTF8");
22 DartLexer lexer = new DartLexer(input);
23 CommonTokenStream tokens = new CommonTokenStream(lexer);
24 DartParser parser = new DartParser(tokens);
25 if (argument.endsWith(".lib")) {
26 parser.libraryUnit();
27 } else if (argument.endsWith(".dart")) {
28 parser.compilationUnit();
29 } else {
30 throw new AssertionError("Unknown file type: " + argument);
31 }
32 hasErrors |= lexer.hasErrors;
33 hasErrors |= parser.hasErrors;
34 }
35 if (hasErrors) {
36 throw new AssertionError("Parse errors");
37 }
38 }
39 }
OLDNEW
« no previous file with comments | « dart/language/grammar/PRESUBMIT.py ('k') | dart/language/grammar/antlrworks.jar » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698