Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
SpecParser Class Reference

Class for main which will parse files given as command line arguments. More...

Static Public Member Functions

static void runAsBatch () throws IOException, RecognitionException
 
static void main (String[] args) throws Exception
 

Detailed Description

Class for main which will parse files given as command line arguments.

Definition at line 54 of file SpecParser.java.

Member Function Documentation

◆ main()

static void SpecParser.main ( String[]  args) throws Exception
inlinestatic

Definition at line 135 of file SpecParser.java.

135 {
136 if (args.length == 0) helpAndExit();
137 ParsingResult result = parseFiles(args);
138
139 if (result.numberOfFileArguments == 0) {
140 helpAndExit();
141 } else if (result.numberOfFileArguments == 1) {
142 if (result.numberOfFailures > 0) {
143 System.err.println("Parsing failed");
144 compileTimeErrorExit();
145 } else {
146 System.out.println("Parsing succeeded.");
147 }
148 } else {
149 if (result.numberOfFailures > 0) {
150 System.err.println(
151 "Parsed " + result.numberOfFileArguments + " files, " +
152 result.numberOfFailures + " failed.");
153 compileTimeErrorExit();
154 } else {
155 System.out.println("Parsed " + result.numberOfFileArguments +
156 " files successfully.");
157 }
158 }
159 }
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
GAsyncResult * result

◆ runAsBatch()

static void SpecParser.runAsBatch ( ) throws IOException, RecognitionException
inlinestatic

Receive command lines from standard input and produce feedback about the outcome on standard output and standard error, as expected by tools/test.py when running with --batch.

Definition at line 73 of file SpecParser.java.

73 {
75 long startTime = System.currentTimeMillis();
76 InputStreamReader input = new InputStreamReader(System.in);
77 BufferedReader bufferedInput = new BufferedReader(input);
78 String cmdLine;
79
80 System.out.println(">>> BATCH START");
81 while ((cmdLine = bufferedInput.readLine()) != null) {
82 if (cmdLine.length() == 0) {
83 System.out.println(
84 ">>> BATCH END (" +
85 (result.numberOfFileArguments - result.numberOfFailures) +
86 "/" + result.numberOfFileArguments + ") " +
87 (System.currentTimeMillis() - startTime) + "ms");
88 if (result.numberOfFailures > 0) compileTimeErrorExit();
89 normalExit();
90 }
91
92 String[] lineArgs = cmdLine.split("\\s+");
93 result = parseFiles(lineArgs);
94 // Write stderr end token and flush.
95 System.err.println(">>> EOF STDERR");
96 String resultPassString =
97 result.numberOfFailures == 0 ? "PASS" : "PARSE_FAIL";
98 System.out.println(">>> TEST " + resultPassString + " " +
99 (System.currentTimeMillis() - startTime) + "ms");
100 startTime = System.currentTimeMillis();
101 }
102 }

The documentation for this class was generated from the following file: