Skip to content

Commit c726668

Browse files
committed
Merge branch 'rhu1-research' of https://github.com/rhu1/scribble-java into rhu1-research
2 parents 0dbd7c7 + 783635a commit c726668

5 files changed

Lines changed: 50 additions & 46 deletions

File tree

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
<module>scribble-runtime</module>
7878
<module>scribble-test</module>
7979
<module>scribble-dist</module>
80+
<module>scribble-demos</module>
8081
</modules>
8182

8283
<dependencyManagement>

scribble-cli/src/main/java/org/scribble/cli/CLArgParser.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ public class CLArgParser
9999
}
100100

101101
protected final String[] args;
102-
protected final Map<CLArgFlag, String[]> parsed = new HashMap<>();
102+
103+
private final Map<CLArgFlag, String[]> parsed = new HashMap<>();
103104

104105
public CLArgParser(String[] args)
105106
{

scribble-cli/src/main/java/org/scribble/cli/CommandLine.java

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ public class CommandLine
4646
{
4747
protected //final
4848
Map<CLArgFlag, String[]> args; // Maps each flag to list of associated argument values
49-
49+
5050
protected CommandLine()
5151
{
52-
52+
5353
}
54-
54+
5555
public CommandLine(String... args) throws CommandLineException
5656
{
5757
this.args = new CLArgParser(args).getArgs();
@@ -60,11 +60,11 @@ public CommandLine(String... args) throws CommandLineException
6060
throw new CommandLineException("No main module has been specified\r\n");
6161
}
6262
}
63-
63+
6464
// A Scribble extension should override newMainContext as appropriate.
6565
protected MainContext newMainContext() throws ScribParserException, ScribbleException
6666
{
67-
//boolean jUnit = this.args.containsKey(ArgFlag.JUNIT);
67+
//boolean jUnit = this.args.containsKey(ArgFlag.JUNIT);
6868
boolean debug = this.args.containsKey(CLArgFlag.VERBOSE); // TODO: factor out (cf. MainContext fields)
6969
boolean useOldWF = this.args.containsKey(CLArgFlag.OLD_WF);
7070
boolean noLiveness = this.args.containsKey(CLArgFlag.NO_LIVENESS);
@@ -158,9 +158,9 @@ protected void tryRun() throws ScribParserException, ScribbleException, CommandL
158158
{
159159
fail = x;
160160
}
161-
161+
162162
// Attempt certain "output tasks" even if above failed, in case can still do useful output (hacky)
163-
try
163+
try
164164
{
165165
tryOutputTasks(job);
166166
}
@@ -180,7 +180,7 @@ protected void tryRun() throws ScribParserException, ScribbleException, CommandL
180180
// "Non-attemptable" output tasks
181181
doNonAttemptableOutputTasks(job);
182182
}
183-
183+
184184
protected void tryOutputTasks(Job job) throws CommandLineException, ScribbleException
185185
{
186186
// Following must be ordered appropriately -- ?
@@ -237,7 +237,8 @@ protected void tryOutputTasks(Job job) throws CommandLineException, ScribbleExce
237237
}
238238
}
239239
}
240-
240+
241+
// FIXME: rename
241242
protected void doNonAttemptableOutputTasks(Job job) throws ScribbleException, CommandLineException
242243
{
243244
if (this.args.containsKey(CLArgFlag.SESS_API_GEN))
@@ -253,7 +254,7 @@ protected void doNonAttemptableOutputTasks(Job job) throws ScribbleException, Co
253254
outputEndpointApi(job);
254255
}
255256
}
256-
257+
257258
// FIXME: option to write to file, like classes
258259
private void outputProjections(Job job) throws CommandLineException, ScribbleException
259260
{
@@ -393,7 +394,7 @@ private void outputSessionApi(Job job) throws ScribbleException, CommandLineExce
393394
outputClasses(classes);
394395
}
395396
}
396-
397+
397398
private void outputStateChannelApi(Job job) throws ScribbleException, CommandLineException
398399
{
399400
JobContext jcontext = job.getContext();
@@ -422,7 +423,7 @@ protected void outputClasses(Map<String, String> classes) throws ScribbleExcepti
422423
{
423424
System.out.println("[DEBUG] Writing to: " + tmp);
424425
}
425-
ScribUtil.writeToFile(tmp, classes.get(path)); return null;
426+
ScribUtil.writeToFile(tmp, classes.get(path)); return null;
426427
}); };
427428
}
428429
else
@@ -431,7 +432,7 @@ protected void outputClasses(Map<String, String> classes) throws ScribbleExcepti
431432
}
432433
classes.keySet().stream().forEach(f);
433434
}
434-
435+
435436
private static void runDot(String dot, String png) throws ScribbleException, CommandLineException
436437
{
437438
String tmpName = png + ".tmp";
@@ -451,17 +452,17 @@ private static void runDot(String dot, String png) throws ScribbleException, Com
451452
tmp.delete();
452453
}
453454
}
454-
455+
455456
protected static Path parseMainPath(String path)
456457
{
457458
return Paths.get(path);
458459
}
459-
460+
460461
protected static List<Path> parseImportPaths(String paths)
461462
{
462463
return Arrays.stream(paths.split(File.pathSeparator)).map((s) -> Paths.get(s)).collect(Collectors.toList());
463464
}
464-
465+
465466
protected static GProtocolName checkGlobalProtocolArg(JobContext jcontext, String simpname) throws CommandLineException
466467
{
467468
GProtocolName simpgpn = new GProtocolName(simpname);

scribble-demos/pom.xml

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,31 @@
11
<?xml version="1.0"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3-
<modelVersion>4.0.0</modelVersion>
4-
<artifactId>scribble-demos</artifactId>
5-
<packaging>jar</packaging>
6-
<name>Scribble::Modules::Demos</name>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<artifactId>scribble-demos</artifactId>
6+
<packaging>jar</packaging>
7+
<name>scribble-demos</name>
78

8-
<parent>
9-
<groupId>org.scribble</groupId>
10-
<artifactId>parent</artifactId>
11-
<version>0.4.4-SNAPSHOT</version>
12-
<relativePath>../pom.xml</relativePath>
13-
</parent>
9+
<parent>
10+
<groupId>org.scribble</groupId>
11+
<artifactId>parent</artifactId>
12+
<version>0.4.4-SNAPSHOT</version>
13+
<relativePath>../pom.xml</relativePath>
14+
</parent>
1415

15-
<dependencies>
16-
<dependency>
17-
<groupId>org.scribble</groupId>
18-
<artifactId>scribble-core</artifactId>
19-
</dependency>
20-
<dependency>
21-
<groupId>org.scribble</groupId>
22-
<artifactId>scribble-parser</artifactId>
23-
</dependency>
24-
<dependency>
25-
<groupId>org.scribble</groupId>
26-
<artifactId>scribble-runtime</artifactId>
27-
</dependency>
28-
<dependency>
29-
<groupId>junit</groupId>
30-
<artifactId>junit</artifactId>
31-
</dependency>
32-
</dependencies>
16+
<dependencies>
17+
<dependency>
18+
<groupId>org.scribble</groupId>
19+
<artifactId>scribble-core</artifactId>
20+
</dependency>
21+
<dependency>
22+
<groupId>org.scribble</groupId>
23+
<artifactId>scribble-parser</artifactId>
24+
</dependency>
25+
<dependency>
26+
<groupId>org.scribble</groupId>
27+
<artifactId>scribble-runtime</artifactId>
28+
</dependency>
29+
</dependencies>
3330

3431
</project>

scribble-dist/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
<groupId>org.scribble</groupId>
3636
<artifactId>scribble-cli</artifactId>
3737
</dependency>
38+
<dependency>
39+
<groupId>org.scribble</groupId>
40+
<artifactId>scribble-codegen</artifactId>
41+
</dependency>
3842
<dependency>
3943
<!--Needed to include in jar-->
4044
<groupId>org.scribble</groupId>

0 commit comments

Comments
 (0)