Skip to content
Permalink
Browse files
Updated parser so it can successfully parse all the unit test proto f…
…iles. Generator is still in progress.

git-svn-id: https://svn.apache.org/repos/asf/activemq/sandbox/activemq-protobuf@690397 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
chirino committed Aug 29, 2008
1 parent f42edbc commit 74edd13352f8722cd84c2ba73f8c2d0408a52c08
Showing 4 changed files with 232 additions and 113 deletions.
@@ -0,0 +1,20 @@
package org.apache.activemq.protobuf.compiler;

import java.util.Map;

public class GroupDescriptor extends FieldDescriptor {
private Map<String,FieldDescriptor> fields;

public GroupDescriptor(ProtoDescriptor protoDescriptor) {
super(protoDescriptor);
}

public Map<String, FieldDescriptor> getFields() {
return fields;
}

public void setFields(Map<String, FieldDescriptor> fields) {
this.fields = fields;
}

}
@@ -29,6 +29,7 @@ public class MessageDescriptor {
private Map<String,EnumDescriptor> enums;
private final ProtoDescriptor protoDescriptor;
private List<ExtendDescriptor> extendsList;
private Map<String, OptionDescriptor> options;

public MessageDescriptor(ProtoDescriptor protoDescriptor) {
this.protoDescriptor = protoDescriptor;
@@ -90,4 +91,12 @@ public void validate(List<String> errors) {

}

public Map<String, OptionDescriptor> getOptions() {
return options;
}

public void setOptions(Map<String, OptionDescriptor> options) {
this.options = options;
}

}
@@ -77,11 +77,12 @@ public boolean accept(File pathname) {
List<File> recFiles = Arrays.asList(files);
for (File file : recFiles) {
try {
getLog().info("Compiling: "+file.getPath());
JavaGenerator generator = new JavaGenerator();
generator.setOutputDirectory(outputDirectory);
generator.compile(file);
} catch (ParseException e) {
throw new MojoExecutionException("Parse failed: " + e.getMessage(), e);
throw new MojoExecutionException("Parse failed: "+file.getPath()+"\n"+ e.getMessage(), e);
} catch (CompilerException e) {
throw new MojoExecutionException("Compile failed", e);
} catch (IOException e) {

0 comments on commit 74edd13

Please sign in to comment.