summaryrefslogtreecommitdiffstats
path: root/config-model/src/main/javacc/SDParser.jj
diff options
context:
space:
mode:
authorArne Juul <arnej@yahoo-inc.com>2018-11-01 09:48:56 +0000
committergjoranv <gv@oath.com>2019-01-21 15:09:25 +0100
commit953684a791ac6bb080ecd1c16e77fb57c3fcb85a (patch)
tree41890aa409898a1ff32cdfdabfb25b812964642d /config-model/src/main/javacc/SDParser.jj
parentdf35b45ca1fac714c7255772e03ba218efa8ecd8 (diff)
Revert "remove "header" and "body" keywords"
This reverts commit e24c1df653d6470089f05786d74e729bb8f82990.
Diffstat (limited to 'config-model/src/main/javacc/SDParser.jj')
-rw-r--r--config-model/src/main/javacc/SDParser.jj68
1 files changed, 65 insertions, 3 deletions
diff --git a/config-model/src/main/javacc/SDParser.jj b/config-model/src/main/javacc/SDParser.jj
index 966ef46f6ac..19c410b4b98 100644
--- a/config-model/src/main/javacc/SDParser.jj
+++ b/config-model/src/main/javacc/SDParser.jj
@@ -265,6 +265,8 @@ TOKEN :
| < STEMMING: "stemming" >
| < NORMALIZING: "normalizing" >
| < BOLDING: "bolding" >
+| < BODY: "body" >
+| < HEADER: "header" >
| < NONE: "none" >
| < ON: "on" >
| < OFF: "off" >
@@ -536,13 +538,35 @@ Object documentBody(SDDocumentType document, Search search) :
{
( annotation(search, document)
| compression(document, null)
+ | headercfg(document)
+ | bodycfg(document)
| structInside(document, search)
| field(document, search) )
{ return null; }
}
/**
- * Consumes a compression block.
+ * Consumes a document head block.
+ *
+ * @param document The document type to modify.
+ */
+void headercfg(SDDocumentType document) : { }
+{
+ <HEADER> lbrace() [compression(document, "header") (<NL>)*] <RBRACE>
+}
+
+/**
+ * Consumes a document body block.
+ *
+ * @param document The document type to modify.
+ */
+void bodycfg(SDDocumentType document) : { }
+{
+ <BODY> lbrace() [compression(document, "body") (<NL>)*] <RBRACE>
+}
+
+/**
+ * Consumes a compression block. This can be set in both document header and -body block.
*
* @param document The document type to modify.
* @param name The name of the document block to modify.
@@ -554,8 +578,12 @@ void compression(SDDocumentType document, String name) :
{
<COMPRESSION> lbrace() (cfg = compressionItem(cfg) (<NL>)*)* <RBRACE>
{
- document.getDocumentType().contentStruct().setCompressionConfig(cfg);
- document.getDocumentType().getBodyType().setCompressionConfig(cfg);
+ if (name == null || name.equals("header")) {
+ document.getDocumentType().contentStruct().setCompressionConfig(cfg);
+ }
+ if (name == null || name.equals("body")) {
+ document.getDocumentType().getBodyType().setCompressionConfig(cfg);
+ }
}
}
@@ -938,8 +966,10 @@ String fieldBody(SDField field, Search search, SDDocumentType document) : { }
{
( alias(field) |
attribute(field) |
+ body(field) |
bolding(field) |
fieldStemming(field) |
+ header(field) |
id(field, document) |
summaryInField(field) |
index(search, field) |
@@ -1466,6 +1496,36 @@ void bolding(FieldOperationContainer field) :
}
}
+/**
+ * This rule consumes a body statement of a field element.
+ *
+ * @param field The field to modify.
+ */
+void body(SDField field) : { }
+{
+ <BODY>
+ {
+ deployLogger.log(Level.WARNING, field + ": 'header/body' is deprecated and has no effect.");
+ field.setHeader(false);
+ field.setHeaderOrBodyDefined(true);
+ }
+}
+
+/**
+ * This rule consumes a header statement of a field element.
+ *
+ * @param field The field to modify.
+ */
+void header(SDField field) : { }
+{
+ <HEADER>
+ {
+ deployLogger.log(Level.WARNING, field + ": 'header/body' is deprecated and has no effect.");
+ field.setHeader(true);
+ field.setHeaderOrBodyDefined(true);
+ }
+}
+
void queryCommand(FieldOperationContainer container) :
{
String command;
@@ -2421,6 +2481,7 @@ String identifier() : { }
| <AS>
| <ASCENDING>
| <ATTRIBUTE>
+ | <BODY>
| <BOLDING>
| <COMPRESSION>
| <COMPRESSIONLEVEL>
@@ -2450,6 +2511,7 @@ String identifier() : { }
| <FULL>
| <FUNCTION>
| <GRAM>
+ | <HEADER>
| <HUGE>
| <ID>
| <IDENTICAL>