summaryrefslogtreecommitdiffstats
path: root/config-model/src/main/javacc/IntermediateParser.jj
diff options
context:
space:
mode:
Diffstat (limited to 'config-model/src/main/javacc/IntermediateParser.jj')
-rw-r--r--config-model/src/main/javacc/IntermediateParser.jj26
1 files changed, 13 insertions, 13 deletions
diff --git a/config-model/src/main/javacc/IntermediateParser.jj b/config-model/src/main/javacc/IntermediateParser.jj
index cc03773f333..a8e77dead6e 100644
--- a/config-model/src/main/javacc/IntermediateParser.jj
+++ b/config-model/src/main/javacc/IntermediateParser.jj
@@ -427,16 +427,11 @@ void rootSchemaItem(ParsedSchema schema) : { }
*/
ParsedSchema rootDocument() :
{
- ParsedSchema schema = new ParsedSchema("<unnamed>");
+ ParsedSchema schema = null;
}
{
- ( (rootDocumentItem(schema) (<NL>)*)*<EOF> )
+ ( (schema = rootDocumentItem(schema) (<NL>)*)*<EOF> )
{
- if (schema.hasDocument()) {
- ParsedDocument doc = schema.getDocument();
- schema = new ParsedSchema(doc.name());
- schema.addDocument(doc);
- }
return schema;
}
}
@@ -446,9 +441,16 @@ ParsedSchema rootDocument() :
*
* @param schema the schema object to modify.
*/
-void rootDocumentItem(ParsedSchema schema) : { }
+ParsedSchema rootDocumentItem(ParsedSchema schema) :
+{
+ ParsedDocument doc = null;
+}
{
- ( namedDocument(schema) )
+ ( doc = namedDocument() {
+ if (schema == null) schema = new ParsedSchema(doc.name());
+ schema.addDocument(doc);
+ return schema;
+ } )
}
/**
@@ -483,10 +485,8 @@ void document(ParsedSchema schema) :
/**
* Consumes a document element, explicitly named
- *
- * @param schema the schema object to add content to
*/
-void namedDocument(ParsedSchema schema) :
+ParsedDocument namedDocument() :
{
String name;
ParsedDocument document;
@@ -496,7 +496,7 @@ void namedDocument(ParsedSchema schema) :
[ inheritsDocument(document) (<NL>)* ]
<LBRACE> (<NL>)* (documentBody(document) (<NL>)*)* <RBRACE> )
{
- schema.addDocument(document);
+ return document;
}
}