summaryrefslogtreecommitdiffstats
path: root/config-model/src/main/javacc/SDParser.jj
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-12-15 11:11:50 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2018-01-25 13:33:55 +0000
commitf03d9cab494447f079a342124fbd0c0b3541f439 (patch)
tree78680d759e8031abf687d2a8af1b4330733c6176 /config-model/src/main/javacc/SDParser.jj
parentce0178998956ae2fea340d5e23e9f17c0e5c3db6 (diff)
Add uri parsing support for constant tensors.
Diffstat (limited to 'config-model/src/main/javacc/SDParser.jj')
-rw-r--r--config-model/src/main/javacc/SDParser.jj15
1 files changed, 13 insertions, 2 deletions
diff --git a/config-model/src/main/javacc/SDParser.jj b/config-model/src/main/javacc/SDParser.jj
index 916a905dfcb..bf6376983a4 100644
--- a/config-model/src/main/javacc/SDParser.jj
+++ b/config-model/src/main/javacc/SDParser.jj
@@ -339,6 +339,7 @@ TOKEN :
| < RANKSCOREDROPLIMIT: "rank-score-drop-limit" >
| < CONSTANTS: "constants" >
| < FILE: "file" >
+| < URI: "uri" >
| < IDENTIFIER: ["a"-"z","A"-"Z", "_"] (["a"-"z","A"-"Z","0"-"9","_","-"])* >
| < QUOTEDSTRING: "\"" ( ~["\""] )* "\"" >
| < CONTEXT: ["a"-"z","A"-"Z"] (["a"-"z", "A"-"Z", "0"-"9"])* >
@@ -347,6 +348,8 @@ TOKEN :
| < LONG: ("-")? (["0"-"9"])+"L" >
| < STRING: (["a"-"z","A"-"Z","_","0"-"9","."])+ >
| < FILE_PATH: ["a"-"z","A"-"Z", "_"] (["a"-"z","A"-"Z","0"-"9","_","-", "/", "."])+ >
+| < HTTP: ["h","H"] ["t","T"] ["t","T"] ["p","P"] >
+| < URI_PATH: <HTTP> <COLON> ("//")? (["a"-"z","A"-"Z","0"-"9","_","-", "/", ".",":"])+ >
| < LESSTHAN: "<" >
| < GREATERTHAN: ">" >
| < VARIABLE: "$" <IDENTIFIER> >
@@ -1805,11 +1808,12 @@ void rankingConstant(Search search) :
*/
Object rankingConstantItem(RankingConstant constant) :
{
- String fileName = null;
+ String path = null;
TensorType type = null;
}
{
- ( (<FILE> <COLON> fileName = filePath() { } (<NL>)*) { constant.setFileName(fileName); }
+ ( (<FILE> <COLON> path = filePath() { } (<NL>)*) { constant.setFileName(path); }
+ | (<URI> <COLON> path = uriPath() { } (<NL>)*) { constant.setUri(path); }
| type = tensorTypeWithPrefix(rankingConstantErrorMessage(constant.getName())) (<NL>)* { constant.setType(type); }
)
{
@@ -1828,6 +1832,12 @@ String filePath() : { }
{ return token.image; }
}
+String uriPath() : { }
+{
+ ( <URI_PATH> )
+ { return token.image; }
+}
+
/**
* Consumes a rank-profile block of a search element.
*
@@ -2550,6 +2560,7 @@ String identifier() : { }
| <TRUE>
| <TYPE>
| <UCA>
+ | <URI>
| <UPPERBOUND>
| <USEDOCUMENT>
| <VARIABLE>