Skip to content

Commit

Permalink
add in default support for set of
Browse files Browse the repository at this point in the history
  • Loading branch information
jchambers-ln committed Jan 31, 2024
1 parent 3d29435 commit feb5e49
Show file tree
Hide file tree
Showing 12 changed files with 936 additions and 713 deletions.
2 changes: 1 addition & 1 deletion wsclient/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>org.hpccsystems</groupId>
<artifactId>hpcc4j</artifactId>
<version>9.7.0-0-SNAPSHOT</version>
<version>9.7.0-0-TEST</version>
</parent>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ opts:
opt:
maxlength
| maxcount
| setdefaultval
| defaultval
| xpath
| xmldefaultval
Expand All @@ -93,7 +94,7 @@ maxcount:
;

defaultval:
'DEFAULT' OPAREN STRING CPAREN
('DEFAULT' OPAREN STRING CPAREN)
;

xpath:
Expand All @@ -104,6 +105,10 @@ xmldefaultval:
'XMLDEFAULT' OPAREN STRING CPAREN
;

setdefaultval:
('DEFAULT' OPAREN OSQUARE STRING CSQUARE CPAREN | 'DEFAULT' OPAREN SETSTRING CPAREN)
;

annotation_name : ATOKEN;
annotation_param : (TOKEN|UTOKEN);
annotation_arguments : annotation_param (COMMA annotation_param)*;
Expand All @@ -114,6 +119,9 @@ comment:
( '/*' annotation? (COMMA annotation)* .*? (.*?'*/' | '*/'))
;

QUOTE : '\'';
OSQUARE : '[';
CSQUARE : ']';
OPAREN : '(';
CPAREN : ')';
OCURLY : '{';
Expand All @@ -130,6 +138,7 @@ DATASET_SYM : 'DATASET';
WS : [ \t\r\n] -> skip;
INT : [0-9]+ ;
fragment ESCAPED_QUOTE : '\\\'';
SETSTRING : '[\'' ( ESCAPED_QUOTE | ~('\'') )* '\']';
STRING : '\'' ( ESCAPED_QUOTE | ~('\'') )* '\'';
ATOKEN: [@][a-zA-Z0-9_-]+[a-zA-Z0-9_];
TOKEN : ~[_\r\n\t; (),:={}-]~[\r\n \t;(),:={}-]* ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.apache.logging.log4j.LogManager;
import org.hpccsystems.ws.client.antlr.gen.EclRecordBaseListener;
import org.hpccsystems.ws.client.antlr.gen.EclRecordParser;
import org.hpccsystems.ws.client.gen.axis2.wsdfu.latest.DFUDataColumn;
import org.hpccsystems.ws.client.platform.DFUDataColumnAnnotation;
import org.hpccsystems.ws.client.wrappers.EclRecordWrapper;
import org.hpccsystems.ws.client.wrappers.wsdfu.DFUDataColumnWrapper;
Expand Down Expand Up @@ -396,6 +397,30 @@ else if (currentrec != null)
}
}

/**
* {@inheritDoc}
*
* <p>
* When entering a DEFAULT option, set the columnvalue of the current field/rec to its value
* </p>
*/
@Override
public void enterSetdefaultval(EclRecordParser.SetdefaultvalContext ctx)
{
String val = ctx.getChild(2).getText();
val = val.replace("['", "");
val = val.replace("']", "");

if (currentfield != null)
{
currentfield.setColumnValue(val);
}
else if (currentrec != null)
{
currentrec.setColumnValue(val);
}
}

/**
* {@inheritDoc}
*
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,28 @@ T__11=12
T__12=13
T__13=14
T__14=15
OPAREN=16
CPAREN=17
OCURLY=18
CCURLY=19
COMMA=20
SEMI=21
EQ=22
ASSING_SYM=23
REC_SYM=24
END_SYM=25
DATASET_SYM=26
WS=27
INT=28
STRING=29
ATOKEN=30
TOKEN=31
UTOKEN=32
ECL_NUMBERED_TYPE=33
QUOTE=16
OSQUARE=17
CSQUARE=18
OPAREN=19
CPAREN=20
OCURLY=21
CCURLY=22
COMMA=23
SEMI=24
EQ=25
ASSING_SYM=26
REC_SYM=27
END_SYM=28
DATASET_SYM=29
WS=30
INT=31
SETSTRING=32
STRING=33
ATOKEN=34
TOKEN=35
UTOKEN=36
ECL_NUMBERED_TYPE=37
'SET OF'=1
'set of'=2
'MAXLENGTH'=3
Expand All @@ -46,13 +50,16 @@ ECL_NUMBERED_TYPE=33
'//'=13
'/*'=14
'*/'=15
'('=16
')'=17
'{'=18
'}'=19
','=20
'='=22
':='=23
'RECORD'=24
'END'=25
'DATASET'=26
'\''=16
'['=17
']'=18
'('=19
')'=20
'{'=21
'}'=22
','=23
'='=25
':='=26
'RECORD'=27
'END'=28
'DATASET'=29
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,18 @@ public class EclRecordBaseListener implements EclRecordListener {
* <p>The default implementation does nothing.</p>
*/
@Override public void exitXmldefaultval(EclRecordParser.XmldefaultvalContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void enterSetdefaultval(EclRecordParser.SetdefaultvalContext ctx) { }
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/
@Override public void exitSetdefaultval(EclRecordParser.SetdefaultvalContext ctx) { }
/**
* {@inheritDoc}
*
Expand Down

Large diffs are not rendered by default.

Loading

0 comments on commit feb5e49

Please sign in to comment.