diff --git a/ureport2-core/dsl/ReportParser.g4 b/ureport2-core/dsl/ReportParser.g4
index a312c8f..86d1be5 100644
--- a/ureport2-core/dsl/ReportParser.g4
+++ b/ureport2-core/dsl/ReportParser.g4
@@ -1,12 +1,17 @@
grammar ReportParser;
import ReportLexer;
-expression : expr
- | ternaryExpr
+expression : exprComposite
| ifExpr
| caseExpr
;
+exprComposite : expr #singleExprComposite
+ | ternaryExpr #ternaryExprComposite
+ | LeftParen exprComposite RightParen #parenExprComposite
+ | exprComposite Operator exprComposite #complexExprComposite
+ ;
+
ternaryExpr : ifCondition (join ifCondition)* '?' expr ':' expr ;
caseExpr : 'case' '{' casePart (',' casePart)* '}' ;
diff --git a/ureport2-core/src/main/java/com/bstek/ureport/build/compute/ChartValueCompute.java b/ureport2-core/src/main/java/com/bstek/ureport/build/compute/ChartValueCompute.java
index 99d7ec5..c7ff4a7 100644
--- a/ureport2-core/src/main/java/com/bstek/ureport/build/compute/ChartValueCompute.java
+++ b/ureport2-core/src/main/java/com/bstek/ureport/build/compute/ChartValueCompute.java
@@ -21,6 +21,7 @@ import java.util.List;
import com.bstek.ureport.build.BindData;
import com.bstek.ureport.build.Context;
import com.bstek.ureport.chart.Chart;
+import com.bstek.ureport.chart.ChartData;
import com.bstek.ureport.definition.value.ChartValue;
import com.bstek.ureport.definition.value.ValueType;
import com.bstek.ureport.model.Cell;
@@ -35,7 +36,7 @@ public class ChartValueCompute implements ValueCompute {
public List compute(Cell cell, Context context) {
ChartValue chartValue=(ChartValue)cell.getValue();
Chart chart=chartValue.getChart();
- String data=chart.doCompute(cell, context);
+ ChartData data=chart.doCompute(cell, context);
List list=new ArrayList();
list.add(new BindData(data));
return list;
diff --git a/ureport2-core/src/main/java/com/bstek/ureport/chart/Chart.java b/ureport2-core/src/main/java/com/bstek/ureport/chart/Chart.java
index bc0ba87..7844071 100644
--- a/ureport2-core/src/main/java/com/bstek/ureport/chart/Chart.java
+++ b/ureport2-core/src/main/java/com/bstek/ureport/chart/Chart.java
@@ -33,10 +33,10 @@ public class Chart {
private Dataset dataset;
private XAxes xaxes;
private YAxes yaxes;
- public String doCompute(Cell cell, Context context){
+ public ChartData doCompute(Cell cell, Context context){
StringBuilder sb=new StringBuilder();
sb.append("{");
- sb.append("type:\""+dataset.type()+"\",");
+ sb.append("type:\""+dataset.getType()+"\",");
sb.append("data:"+dataset.buildDataJson(context, cell)+",");
sb.append("options:{");
if(options!=null && options.size()>0){
@@ -61,7 +61,8 @@ public class Chart {
}
sb.append("}");
sb.append("}");
- return sb.toString();
+ ChartData chartData=new ChartData(sb.toString());
+ return chartData;
}
public List
*/
@Override public T visitExpression(ReportParserParser.ExpressionContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitComplexExprComposite(ReportParserParser.ComplexExprCompositeContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitSingleExprComposite(ReportParserParser.SingleExprCompositeContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitParenExprComposite(ReportParserParser.ParenExprCompositeContext ctx) { return visitChildren(ctx); }
+ /**
+ * {@inheritDoc}
+ *
+ * The default implementation returns the result of calling
+ * {@link #visitChildren} on {@code ctx}.
+ */
+ @Override public T visitTernaryExprComposite(ReportParserParser.TernaryExprCompositeContext ctx) { return visitChildren(ctx); }
/**
* {@inheritDoc}
*
diff --git a/ureport2-core/src/main/java/com/bstek/ureport/dsl/ReportParserParser.java b/ureport2-core/src/main/java/com/bstek/ureport/dsl/ReportParserParser.java
index f3d7b76..aa17d3d 100644
--- a/ureport2-core/src/main/java/com/bstek/ureport/dsl/ReportParserParser.java
+++ b/ureport2-core/src/main/java/com/bstek/ureport/dsl/ReportParserParser.java
@@ -23,19 +23,20 @@ public class ReportParserParser extends Parser {
RightParen=25, STRING=26, AND=27, OR=28, INTEGER=29, NUMBER=30, EXCLAMATION=31,
EXP=32, LETTER=33, Identifier=34, Char=35, DIGIT=36, WS=37, NL=38;
public static final int
- RULE_expression = 0, RULE_ternaryExpr = 1, RULE_caseExpr = 2, RULE_casePart = 3,
- RULE_ifExpr = 4, RULE_ifPart = 5, RULE_elseIfPart = 6, RULE_elsePart = 7,
- RULE_expr = 8, RULE_ifCondition = 9, RULE_item = 10, RULE_unit = 11, RULE_cellPosition = 12,
- RULE_relativeCell = 13, RULE_cell = 14, RULE_dataset = 15, RULE_function = 16,
- RULE_functionParameter = 17, RULE_set = 18, RULE_cellCoordinate = 19,
- RULE_coordinate = 20, RULE_cellIndicator = 21, RULE_conditions = 22, RULE_condition = 23,
- RULE_property = 24, RULE_simpleValue = 25, RULE_join = 26, RULE_aggregate = 27;
+ RULE_expression = 0, RULE_exprComposite = 1, RULE_ternaryExpr = 2, RULE_caseExpr = 3,
+ RULE_casePart = 4, RULE_ifExpr = 5, RULE_ifPart = 6, RULE_elseIfPart = 7,
+ RULE_elsePart = 8, RULE_expr = 9, RULE_ifCondition = 10, RULE_item = 11,
+ RULE_unit = 12, RULE_cellPosition = 13, RULE_relativeCell = 14, RULE_cell = 15,
+ RULE_dataset = 16, RULE_function = 17, RULE_functionParameter = 18, RULE_set = 19,
+ RULE_cellCoordinate = 20, RULE_coordinate = 21, RULE_cellIndicator = 22,
+ RULE_conditions = 23, RULE_condition = 24, RULE_property = 25, RULE_simpleValue = 26,
+ RULE_join = 27, RULE_aggregate = 28;
public static final String[] ruleNames = {
- "expression", "ternaryExpr", "caseExpr", "casePart", "ifExpr", "ifPart",
- "elseIfPart", "elsePart", "expr", "ifCondition", "item", "unit", "cellPosition",
- "relativeCell", "cell", "dataset", "function", "functionParameter", "set",
- "cellCoordinate", "coordinate", "cellIndicator", "conditions", "condition",
- "property", "simpleValue", "join", "aggregate"
+ "expression", "exprComposite", "ternaryExpr", "caseExpr", "casePart",
+ "ifExpr", "ifPart", "elseIfPart", "elsePart", "expr", "ifCondition", "item",
+ "unit", "cellPosition", "relativeCell", "cell", "dataset", "function",
+ "functionParameter", "set", "cellCoordinate", "coordinate", "cellIndicator",
+ "conditions", "condition", "property", "simpleValue", "join", "aggregate"
};
private static final String[] _LITERAL_NAMES = {
@@ -101,11 +102,8 @@ public class ReportParserParser extends Parser {
_interp = new ParserATNSimulator(this,_ATN,_decisionToDFA,_sharedContextCache);
}
public static class ExpressionContext extends ParserRuleContext {
- public ExprContext expr() {
- return getRuleContext(ExprContext.class,0);
- }
- public TernaryExprContext ternaryExpr() {
- return getRuleContext(TernaryExprContext.class,0);
+ public ExprCompositeContext exprComposite() {
+ return getRuleContext(ExprCompositeContext.class,0);
}
public IfExprContext ifExpr() {
return getRuleContext(IfExprContext.class,0);
@@ -128,37 +126,192 @@ public class ReportParserParser extends Parser {
ExpressionContext _localctx = new ExpressionContext(_ctx, getState());
enterRule(_localctx, 0, RULE_expression);
try {
- setState(60);
+ setState(61);
+ switch (_input.LA(1)) {
+ case T__8:
+ case T__9:
+ case T__10:
+ case Cell:
+ case BOOLEAN:
+ case NULL:
+ case LeftParen:
+ case STRING:
+ case INTEGER:
+ case NUMBER:
+ case Identifier:
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(58);
+ exprComposite(0);
+ }
+ break;
+ case T__5:
+ enterOuterAlt(_localctx, 2);
+ {
+ setState(59);
+ ifExpr();
+ }
+ break;
+ case T__1:
+ enterOuterAlt(_localctx, 3);
+ {
+ setState(60);
+ caseExpr();
+ }
+ break;
+ default:
+ throw new NoViableAltException(this);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ _errHandler.reportError(this, re);
+ _errHandler.recover(this, re);
+ }
+ finally {
+ exitRule();
+ }
+ return _localctx;
+ }
+
+ public static class ExprCompositeContext extends ParserRuleContext {
+ public ExprCompositeContext(ParserRuleContext parent, int invokingState) {
+ super(parent, invokingState);
+ }
+ @Override public int getRuleIndex() { return RULE_exprComposite; }
+
+ public ExprCompositeContext() { }
+ public void copyFrom(ExprCompositeContext ctx) {
+ super.copyFrom(ctx);
+ }
+ }
+ public static class ComplexExprCompositeContext extends ExprCompositeContext {
+ public List exprComposite() {
+ return getRuleContexts(ExprCompositeContext.class);
+ }
+ public ExprCompositeContext exprComposite(int i) {
+ return getRuleContext(ExprCompositeContext.class,i);
+ }
+ public TerminalNode Operator() { return getToken(ReportParserParser.Operator, 0); }
+ public ComplexExprCompositeContext(ExprCompositeContext ctx) { copyFrom(ctx); }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof ReportParserVisitor ) return ((ReportParserVisitor extends T>)visitor).visitComplexExprComposite(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+ public static class SingleExprCompositeContext extends ExprCompositeContext {
+ public ExprContext expr() {
+ return getRuleContext(ExprContext.class,0);
+ }
+ public SingleExprCompositeContext(ExprCompositeContext ctx) { copyFrom(ctx); }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof ReportParserVisitor ) return ((ReportParserVisitor extends T>)visitor).visitSingleExprComposite(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+ public static class ParenExprCompositeContext extends ExprCompositeContext {
+ public TerminalNode LeftParen() { return getToken(ReportParserParser.LeftParen, 0); }
+ public ExprCompositeContext exprComposite() {
+ return getRuleContext(ExprCompositeContext.class,0);
+ }
+ public TerminalNode RightParen() { return getToken(ReportParserParser.RightParen, 0); }
+ public ParenExprCompositeContext(ExprCompositeContext ctx) { copyFrom(ctx); }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof ReportParserVisitor ) return ((ReportParserVisitor extends T>)visitor).visitParenExprComposite(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+ public static class TernaryExprCompositeContext extends ExprCompositeContext {
+ public TernaryExprContext ternaryExpr() {
+ return getRuleContext(TernaryExprContext.class,0);
+ }
+ public TernaryExprCompositeContext(ExprCompositeContext ctx) { copyFrom(ctx); }
+ @Override
+ public T accept(ParseTreeVisitor extends T> visitor) {
+ if ( visitor instanceof ReportParserVisitor ) return ((ReportParserVisitor extends T>)visitor).visitTernaryExprComposite(this);
+ else return visitor.visitChildren(this);
+ }
+ }
+
+ public final ExprCompositeContext exprComposite() throws RecognitionException {
+ return exprComposite(0);
+ }
+
+ private ExprCompositeContext exprComposite(int _p) throws RecognitionException {
+ ParserRuleContext _parentctx = _ctx;
+ int _parentState = getState();
+ ExprCompositeContext _localctx = new ExprCompositeContext(_ctx, _parentState);
+ ExprCompositeContext _prevctx = _localctx;
+ int _startState = 2;
+ enterRecursionRule(_localctx, 2, RULE_exprComposite, _p);
+ try {
+ int _alt;
+ enterOuterAlt(_localctx, 1);
+ {
+ setState(70);
_errHandler.sync(this);
- switch ( getInterpreter().adaptivePredict(_input,0,_ctx) ) {
+ switch ( getInterpreter().adaptivePredict(_input,1,_ctx) ) {
case 1:
- enterOuterAlt(_localctx, 1);
{
- setState(56);
+ _localctx = new SingleExprCompositeContext(_localctx);
+ _ctx = _localctx;
+ _prevctx = _localctx;
+
+ setState(64);
expr();
}
break;
case 2:
- enterOuterAlt(_localctx, 2);
{
- setState(57);
+ _localctx = new TernaryExprCompositeContext(_localctx);
+ _ctx = _localctx;
+ _prevctx = _localctx;
+ setState(65);
ternaryExpr();
}
break;
case 3:
- enterOuterAlt(_localctx, 3);
{
- setState(58);
- ifExpr();
+ _localctx = new ParenExprCompositeContext(_localctx);
+ _ctx = _localctx;
+ _prevctx = _localctx;
+ setState(66);
+ match(LeftParen);
+ setState(67);
+ exprComposite(0);
+ setState(68);
+ match(RightParen);
}
break;
- case 4:
- enterOuterAlt(_localctx, 4);
- {
- setState(59);
- caseExpr();
+ }
+ _ctx.stop = _input.LT(-1);
+ setState(77);
+ _errHandler.sync(this);
+ _alt = getInterpreter().adaptivePredict(_input,2,_ctx);
+ while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
+ if ( _alt==1 ) {
+ if ( _parseListeners!=null ) triggerExitRuleEvent();
+ _prevctx = _localctx;
+ {
+ {
+ _localctx = new ComplexExprCompositeContext(new ExprCompositeContext(_parentctx, _parentState));
+ pushNewRecursionContext(_localctx, _startState, RULE_exprComposite);
+ setState(72);
+ if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
+ setState(73);
+ match(Operator);
+ setState(74);
+ exprComposite(2);
+ }
+ }
}
- break;
+ setState(79);
+ _errHandler.sync(this);
+ _alt = getInterpreter().adaptivePredict(_input,2,_ctx);
+ }
}
}
catch (RecognitionException re) {
@@ -167,7 +320,7 @@ public class ReportParserParser extends Parser {
_errHandler.recover(this, re);
}
finally {
- exitRule();
+ unrollRecursionContexts(_parentctx);
}
return _localctx;
}
@@ -204,36 +357,36 @@ public class ReportParserParser extends Parser {
public final TernaryExprContext ternaryExpr() throws RecognitionException {
TernaryExprContext _localctx = new TernaryExprContext(_ctx, getState());
- enterRule(_localctx, 2, RULE_ternaryExpr);
+ enterRule(_localctx, 4, RULE_ternaryExpr);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(62);
+ setState(80);
ifCondition();
- setState(68);
+ setState(86);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==AND || _la==OR) {
{
{
- setState(63);
+ setState(81);
join();
- setState(64);
+ setState(82);
ifCondition();
}
}
- setState(70);
+ setState(88);
_errHandler.sync(this);
_la = _input.LA(1);
}
- setState(71);
+ setState(89);
match(T__0);
- setState(72);
+ setState(90);
expr();
- setState(73);
+ setState(91);
match(COLON);
- setState(74);
+ setState(92);
expr();
}
}
@@ -268,34 +421,34 @@ public class ReportParserParser extends Parser {
public final CaseExprContext caseExpr() throws RecognitionException {
CaseExprContext _localctx = new CaseExprContext(_ctx, getState());
- enterRule(_localctx, 4, RULE_caseExpr);
+ enterRule(_localctx, 6, RULE_caseExpr);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(76);
+ setState(94);
match(T__1);
- setState(77);
+ setState(95);
match(T__2);
- setState(78);
+ setState(96);
casePart();
- setState(83);
+ setState(101);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
- setState(79);
+ setState(97);
match(COMMA);
- setState(80);
+ setState(98);
casePart();
}
}
- setState(85);
+ setState(103);
_errHandler.sync(this);
_la = _input.LA(1);
}
- setState(86);
+ setState(104);
match(T__3);
}
}
@@ -339,48 +492,48 @@ public class ReportParserParser extends Parser {
public final CasePartContext casePart() throws RecognitionException {
CasePartContext _localctx = new CasePartContext(_ctx, getState());
- enterRule(_localctx, 6, RULE_casePart);
+ enterRule(_localctx, 8, RULE_casePart);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(88);
+ setState(106);
ifCondition();
- setState(94);
+ setState(112);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==AND || _la==OR) {
{
{
- setState(89);
+ setState(107);
join();
- setState(90);
+ setState(108);
ifCondition();
}
}
- setState(96);
+ setState(114);
_errHandler.sync(this);
_la = _input.LA(1);
}
- setState(98);
+ setState(116);
_la = _input.LA(1);
if (_la==COLON) {
{
- setState(97);
+ setState(115);
match(COLON);
}
}
- setState(101);
+ setState(119);
_la = _input.LA(1);
if (_la==T__4) {
{
- setState(100);
+ setState(118);
match(T__4);
}
}
- setState(103);
+ setState(121);
expr();
}
}
@@ -421,35 +574,35 @@ public class ReportParserParser extends Parser {
public final IfExprContext ifExpr() throws RecognitionException {
IfExprContext _localctx = new IfExprContext(_ctx, getState());
- enterRule(_localctx, 8, RULE_ifExpr);
+ enterRule(_localctx, 10, RULE_ifExpr);
int _la;
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
- setState(105);
+ setState(123);
ifPart();
- setState(109);
+ setState(127);
_errHandler.sync(this);
- _alt = getInterpreter().adaptivePredict(_input,6,_ctx);
+ _alt = getInterpreter().adaptivePredict(_input,8,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
- setState(106);
+ setState(124);
elseIfPart();
}
}
}
- setState(111);
+ setState(129);
_errHandler.sync(this);
- _alt = getInterpreter().adaptivePredict(_input,6,_ctx);
+ _alt = getInterpreter().adaptivePredict(_input,8,_ctx);
}
- setState(113);
+ setState(131);
_la = _input.LA(1);
if (_la==T__7) {
{
- setState(112);
+ setState(130);
elsePart();
}
}
@@ -496,58 +649,58 @@ public class ReportParserParser extends Parser {
public final IfPartContext ifPart() throws RecognitionException {
IfPartContext _localctx = new IfPartContext(_ctx, getState());
- enterRule(_localctx, 10, RULE_ifPart);
+ enterRule(_localctx, 12, RULE_ifPart);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(115);
+ setState(133);
match(T__5);
- setState(116);
+ setState(134);
match(LeftParen);
- setState(117);
+ setState(135);
ifCondition();
- setState(123);
+ setState(141);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==AND || _la==OR) {
{
{
- setState(118);
+ setState(136);
join();
- setState(119);
+ setState(137);
ifCondition();
}
}
- setState(125);
+ setState(143);
_errHandler.sync(this);
_la = _input.LA(1);
}
- setState(126);
+ setState(144);
match(RightParen);
- setState(127);
+ setState(145);
match(T__2);
- setState(129);
+ setState(147);
_la = _input.LA(1);
if (_la==T__4) {
{
- setState(128);
+ setState(146);
match(T__4);
}
}
- setState(131);
+ setState(149);
expr();
- setState(133);
+ setState(151);
_la = _input.LA(1);
if (_la==T__6) {
{
- setState(132);
+ setState(150);
match(T__6);
}
}
- setState(135);
+ setState(153);
match(T__3);
}
}
@@ -591,60 +744,60 @@ public class ReportParserParser extends Parser {
public final ElseIfPartContext elseIfPart() throws RecognitionException {
ElseIfPartContext _localctx = new ElseIfPartContext(_ctx, getState());
- enterRule(_localctx, 12, RULE_elseIfPart);
+ enterRule(_localctx, 14, RULE_elseIfPart);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(137);
+ setState(155);
match(T__7);
- setState(138);
+ setState(156);
match(T__5);
- setState(139);
+ setState(157);
match(LeftParen);
- setState(140);
+ setState(158);
ifCondition();
- setState(146);
+ setState(164);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==AND || _la==OR) {
{
{
- setState(141);
+ setState(159);
join();
- setState(142);
+ setState(160);
ifCondition();
}
}
- setState(148);
+ setState(166);
_errHandler.sync(this);
_la = _input.LA(1);
}
- setState(149);
+ setState(167);
match(RightParen);
- setState(150);
+ setState(168);
match(T__2);
- setState(152);
+ setState(170);
_la = _input.LA(1);
if (_la==T__4) {
{
- setState(151);
+ setState(169);
match(T__4);
}
}
- setState(154);
+ setState(172);
expr();
- setState(156);
+ setState(174);
_la = _input.LA(1);
if (_la==T__6) {
{
- setState(155);
+ setState(173);
match(T__6);
}
}
- setState(158);
+ setState(176);
match(T__3);
}
}
@@ -676,36 +829,36 @@ public class ReportParserParser extends Parser {
public final ElsePartContext elsePart() throws RecognitionException {
ElsePartContext _localctx = new ElsePartContext(_ctx, getState());
- enterRule(_localctx, 14, RULE_elsePart);
+ enterRule(_localctx, 16, RULE_elsePart);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(160);
+ setState(178);
match(T__7);
- setState(161);
+ setState(179);
match(T__2);
- setState(163);
+ setState(181);
_la = _input.LA(1);
if (_la==T__4) {
{
- setState(162);
+ setState(180);
match(T__4);
}
}
- setState(165);
+ setState(183);
expr();
- setState(167);
+ setState(185);
_la = _input.LA(1);
if (_la==T__6) {
{
- setState(166);
+ setState(184);
match(T__6);
}
}
- setState(169);
+ setState(187);
match(T__3);
}
}
@@ -744,28 +897,30 @@ public class ReportParserParser extends Parser {
public final ExprContext expr() throws RecognitionException {
ExprContext _localctx = new ExprContext(_ctx, getState());
- enterRule(_localctx, 16, RULE_expr);
- int _la;
+ enterRule(_localctx, 18, RULE_expr);
try {
+ int _alt;
enterOuterAlt(_localctx, 1);
{
- setState(171);
+ setState(189);
item();
- setState(176);
+ setState(194);
_errHandler.sync(this);
- _la = _input.LA(1);
- while (_la==Operator) {
- {
- {
- setState(172);
- match(Operator);
- setState(173);
- item();
- }
+ _alt = getInterpreter().adaptivePredict(_input,18,_ctx);
+ while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
+ if ( _alt==1 ) {
+ {
+ {
+ setState(190);
+ match(Operator);
+ setState(191);
+ item();
+ }
+ }
}
- setState(178);
+ setState(196);
_errHandler.sync(this);
- _la = _input.LA(1);
+ _alt = getInterpreter().adaptivePredict(_input,18,_ctx);
}
}
}
@@ -801,15 +956,15 @@ public class ReportParserParser extends Parser {
public final IfConditionContext ifCondition() throws RecognitionException {
IfConditionContext _localctx = new IfConditionContext(_ctx, getState());
- enterRule(_localctx, 18, RULE_ifCondition);
+ enterRule(_localctx, 20, RULE_ifCondition);
try {
enterOuterAlt(_localctx, 1);
{
- setState(179);
+ setState(197);
expr();
- setState(180);
+ setState(198);
match(OP);
- setState(181);
+ setState(199);
expr();
}
}
@@ -889,36 +1044,36 @@ public class ReportParserParser extends Parser {
public final ItemContext item() throws RecognitionException {
ItemContext _localctx = new ItemContext(_ctx, getState());
- enterRule(_localctx, 20, RULE_item);
+ enterRule(_localctx, 22, RULE_item);
int _la;
try {
int _alt;
- setState(205);
+ setState(223);
_errHandler.sync(this);
- switch ( getInterpreter().adaptivePredict(_input,19,_ctx) ) {
+ switch ( getInterpreter().adaptivePredict(_input,21,_ctx) ) {
case 1:
_localctx = new SimpleJoinContext(_localctx);
enterOuterAlt(_localctx, 1);
{
- setState(183);
+ setState(201);
unit();
- setState(188);
+ setState(206);
_errHandler.sync(this);
- _alt = getInterpreter().adaptivePredict(_input,17,_ctx);
+ _alt = getInterpreter().adaptivePredict(_input,19,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
{
{
- setState(184);
+ setState(202);
match(Operator);
- setState(185);
+ setState(203);
unit();
}
}
}
- setState(190);
+ setState(208);
_errHandler.sync(this);
- _alt = getInterpreter().adaptivePredict(_input,17,_ctx);
+ _alt = getInterpreter().adaptivePredict(_input,19,_ctx);
}
}
break;
@@ -926,11 +1081,11 @@ public class ReportParserParser extends Parser {
_localctx = new SingleParenJoinContext(_localctx);
enterOuterAlt(_localctx, 2);
{
- setState(191);
+ setState(209);
match(LeftParen);
- setState(192);
+ setState(210);
item();
- setState(193);
+ setState(211);
match(RightParen);
}
break;
@@ -938,27 +1093,27 @@ public class ReportParserParser extends Parser {
_localctx = new ParenJoinContext(_localctx);
enterOuterAlt(_localctx, 3);
{
- setState(195);
+ setState(213);
match(LeftParen);
- setState(196);
+ setState(214);
item();
- setState(199);
+ setState(217);
_errHandler.sync(this);
_la = _input.LA(1);
do {
{
{
- setState(197);
+ setState(215);
match(Operator);
- setState(198);
+ setState(216);
item();
}
}
- setState(201);
+ setState(219);
_errHandler.sync(this);
_la = _input.LA(1);
} while ( _la==Operator );
- setState(203);
+ setState(221);
match(RightParen);
}
break;
@@ -1012,85 +1167,85 @@ public class ReportParserParser extends Parser {
public final UnitContext unit() throws RecognitionException {
UnitContext _localctx = new UnitContext(_ctx, getState());
- enterRule(_localctx, 22, RULE_unit);
+ enterRule(_localctx, 24, RULE_unit);
try {
- setState(218);
+ setState(236);
_errHandler.sync(this);
- switch ( getInterpreter().adaptivePredict(_input,20,_ctx) ) {
+ switch ( getInterpreter().adaptivePredict(_input,22,_ctx) ) {
case 1:
enterOuterAlt(_localctx, 1);
{
- setState(207);
+ setState(225);
dataset();
}
break;
case 2:
enterOuterAlt(_localctx, 2);
{
- setState(208);
+ setState(226);
function();
}
break;
case 3:
enterOuterAlt(_localctx, 3);
{
- setState(209);
+ setState(227);
set(0);
}
break;
case 4:
enterOuterAlt(_localctx, 4);
{
- setState(210);
+ setState(228);
cellPosition();
}
break;
case 5:
enterOuterAlt(_localctx, 5);
{
- setState(211);
+ setState(229);
relativeCell();
}
break;
case 6:
enterOuterAlt(_localctx, 6);
{
- setState(212);
+ setState(230);
cell();
}
break;
case 7:
enterOuterAlt(_localctx, 7);
{
- setState(213);
+ setState(231);
match(INTEGER);
}
break;
case 8:
enterOuterAlt(_localctx, 8);
{
- setState(214);
+ setState(232);
match(BOOLEAN);
}
break;
case 9:
enterOuterAlt(_localctx, 9);
{
- setState(215);
+ setState(233);
match(STRING);
}
break;
case 10:
enterOuterAlt(_localctx, 10);
{
- setState(216);
+ setState(234);
match(NUMBER);
}
break;
case 11:
enterOuterAlt(_localctx, 11);
{
- setState(217);
+ setState(235);
match(NULL);
}
break;
@@ -1122,13 +1277,13 @@ public class ReportParserParser extends Parser {
public final CellPositionContext cellPosition() throws RecognitionException {
CellPositionContext _localctx = new CellPositionContext(_ctx, getState());
- enterRule(_localctx, 24, RULE_cellPosition);
+ enterRule(_localctx, 26, RULE_cellPosition);
try {
enterOuterAlt(_localctx, 1);
{
- setState(220);
+ setState(238);
match(T__8);
- setState(221);
+ setState(239);
match(Cell);
}
}
@@ -1158,13 +1313,13 @@ public class ReportParserParser extends Parser {
public final RelativeCellContext relativeCell() throws RecognitionException {
RelativeCellContext _localctx = new RelativeCellContext(_ctx, getState());
- enterRule(_localctx, 26, RULE_relativeCell);
+ enterRule(_localctx, 28, RULE_relativeCell);
try {
enterOuterAlt(_localctx, 1);
{
- setState(223);
+ setState(241);
match(T__9);
- setState(224);
+ setState(242);
match(Cell);
}
}
@@ -1196,24 +1351,24 @@ public class ReportParserParser extends Parser {
public final CellContext cell() throws RecognitionException {
CellContext _localctx = new CellContext(_ctx, getState());
- enterRule(_localctx, 28, RULE_cell);
- int _la;
+ enterRule(_localctx, 30, RULE_cell);
try {
enterOuterAlt(_localctx, 1);
{
- setState(226);
+ setState(244);
match(T__10);
- setState(229);
- _la = _input.LA(1);
- if (_la==T__11) {
+ setState(247);
+ _errHandler.sync(this);
+ switch ( getInterpreter().adaptivePredict(_input,23,_ctx) ) {
+ case 1:
{
- setState(227);
+ setState(245);
match(T__11);
- setState(228);
+ setState(246);
property(0);
}
+ break;
}
-
}
}
catch (RecognitionException re) {
@@ -1252,52 +1407,52 @@ public class ReportParserParser extends Parser {
public final DatasetContext dataset() throws RecognitionException {
DatasetContext _localctx = new DatasetContext(_ctx, getState());
- enterRule(_localctx, 30, RULE_dataset);
+ enterRule(_localctx, 32, RULE_dataset);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(231);
+ setState(249);
match(Identifier);
- setState(232);
+ setState(250);
match(T__11);
- setState(233);
+ setState(251);
aggregate();
- setState(234);
+ setState(252);
match(LeftParen);
- setState(236);
+ setState(254);
_la = _input.LA(1);
if (_la==Identifier) {
{
- setState(235);
+ setState(253);
property(0);
}
}
- setState(240);
+ setState(258);
_errHandler.sync(this);
- switch ( getInterpreter().adaptivePredict(_input,23,_ctx) ) {
+ switch ( getInterpreter().adaptivePredict(_input,25,_ctx) ) {
case 1:
{
- setState(238);
+ setState(256);
match(COMMA);
- setState(239);
+ setState(257);
conditions();
}
break;
}
- setState(244);
+ setState(262);
_la = _input.LA(1);
if (_la==COMMA) {
{
- setState(242);
+ setState(260);
match(COMMA);
- setState(243);
+ setState(261);
match(ORDER);
}
}
- setState(246);
+ setState(264);
match(RightParen);
}
}
@@ -1330,25 +1485,25 @@ public class ReportParserParser extends Parser {
public final FunctionContext function() throws RecognitionException {
FunctionContext _localctx = new FunctionContext(_ctx, getState());
- enterRule(_localctx, 32, RULE_function);
+ enterRule(_localctx, 34, RULE_function);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(248);
+ setState(266);
match(Identifier);
- setState(249);
+ setState(267);
match(LeftParen);
- setState(251);
+ setState(269);
_la = _input.LA(1);
if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << Cell) | (1L << BOOLEAN) | (1L << NULL) | (1L << STRING) | (1L << INTEGER) | (1L << NUMBER))) != 0)) {
{
- setState(250);
+ setState(268);
functionParameter();
}
}
- setState(253);
+ setState(271);
match(RightParen);
}
}
@@ -1383,33 +1538,33 @@ public class ReportParserParser extends Parser {
public final FunctionParameterContext functionParameter() throws RecognitionException {
FunctionParameterContext _localctx = new FunctionParameterContext(_ctx, getState());
- enterRule(_localctx, 34, RULE_functionParameter);
+ enterRule(_localctx, 36, RULE_functionParameter);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(255);
+ setState(273);
set(0);
- setState(262);
+ setState(280);
_errHandler.sync(this);
_la = _input.LA(1);
while ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << Cell) | (1L << BOOLEAN) | (1L << COMMA) | (1L << NULL) | (1L << STRING) | (1L << INTEGER) | (1L << NUMBER))) != 0)) {
{
{
- setState(257);
+ setState(275);
_la = _input.LA(1);
if (_la==COMMA) {
{
- setState(256);
+ setState(274);
match(COMMA);
}
}
- setState(259);
+ setState(277);
set(0);
}
}
- setState(264);
+ setState(282);
_errHandler.sync(this);
_la = _input.LA(1);
}
@@ -1544,22 +1699,22 @@ public class ReportParserParser extends Parser {
int _parentState = getState();
SetContext _localctx = new SetContext(_ctx, _parentState);
SetContext _prevctx = _localctx;
- int _startState = 36;
- enterRecursionRule(_localctx, 36, RULE_set, _p);
+ int _startState = 38;
+ enterRecursionRule(_localctx, 38, RULE_set, _p);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
- setState(298);
+ setState(316);
_errHandler.sync(this);
- switch ( getInterpreter().adaptivePredict(_input,29,_ctx) ) {
+ switch ( getInterpreter().adaptivePredict(_input,31,_ctx) ) {
case 1:
{
_localctx = new SimpleDataContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
- setState(266);
+ setState(284);
simpleValue();
}
break;
@@ -1568,7 +1723,7 @@ public class ReportParserParser extends Parser {
_localctx = new SingleCellContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
- setState(267);
+ setState(285);
match(Cell);
}
break;
@@ -1577,22 +1732,22 @@ public class ReportParserParser extends Parser {
_localctx = new WholeCellContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
- setState(268);
+ setState(286);
match(Cell);
- setState(269);
+ setState(287);
match(T__12);
- setState(270);
+ setState(288);
match(T__13);
- setState(275);
+ setState(293);
_errHandler.sync(this);
- switch ( getInterpreter().adaptivePredict(_input,28,_ctx) ) {
+ switch ( getInterpreter().adaptivePredict(_input,30,_ctx) ) {
case 1:
{
- setState(271);
+ setState(289);
match(T__2);
- setState(272);
+ setState(290);
conditions();
- setState(273);
+ setState(291);
match(T__3);
}
break;
@@ -1604,11 +1759,11 @@ public class ReportParserParser extends Parser {
_localctx = new CellPairContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
- setState(277);
+ setState(295);
match(Cell);
- setState(278);
+ setState(296);
match(COLON);
- setState(279);
+ setState(297);
match(Cell);
}
break;
@@ -1617,13 +1772,13 @@ public class ReportParserParser extends Parser {
_localctx = new SingleCellConditionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
- setState(280);
+ setState(298);
match(Cell);
- setState(281);
+ setState(299);
match(T__2);
- setState(282);
+ setState(300);
conditions();
- setState(283);
+ setState(301);
match(T__3);
}
break;
@@ -1632,13 +1787,13 @@ public class ReportParserParser extends Parser {
_localctx = new SingleCellCoordinateContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
- setState(285);
+ setState(303);
match(Cell);
- setState(286);
+ setState(304);
match(T__12);
- setState(287);
+ setState(305);
cellCoordinate();
- setState(288);
+ setState(306);
match(T__13);
}
break;
@@ -1647,27 +1802,27 @@ public class ReportParserParser extends Parser {
_localctx = new CellCoordinateConditionContext(_localctx);
_ctx = _localctx;
_prevctx = _localctx;
- setState(290);
+ setState(308);
match(Cell);
- setState(291);
+ setState(309);
match(T__12);
- setState(292);
+ setState(310);
cellCoordinate();
- setState(293);
+ setState(311);
match(T__13);
- setState(294);
+ setState(312);
match(T__2);
- setState(295);
+ setState(313);
conditions();
- setState(296);
+ setState(314);
match(T__3);
}
break;
}
_ctx.stop = _input.LT(-1);
- setState(305);
+ setState(323);
_errHandler.sync(this);
- _alt = getInterpreter().adaptivePredict(_input,30,_ctx);
+ _alt = getInterpreter().adaptivePredict(_input,32,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
if ( _parseListeners!=null ) triggerExitRuleEvent();
@@ -1676,18 +1831,18 @@ public class ReportParserParser extends Parser {
{
_localctx = new RangeContext(new SetContext(_parentctx, _parentState));
pushNewRecursionContext(_localctx, _startState, RULE_set);
- setState(300);
+ setState(318);
if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
- setState(301);
+ setState(319);
match(T__14);
- setState(302);
+ setState(320);
set(2);
}
}
}
- setState(307);
+ setState(325);
_errHandler.sync(this);
- _alt = getInterpreter().adaptivePredict(_input,30,_ctx);
+ _alt = getInterpreter().adaptivePredict(_input,32,_ctx);
}
}
}
@@ -1722,20 +1877,20 @@ public class ReportParserParser extends Parser {
public final CellCoordinateContext cellCoordinate() throws RecognitionException {
CellCoordinateContext _localctx = new CellCoordinateContext(_ctx, getState());
- enterRule(_localctx, 38, RULE_cellCoordinate);
+ enterRule(_localctx, 40, RULE_cellCoordinate);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(308);
+ setState(326);
coordinate();
- setState(311);
+ setState(329);
_la = _input.LA(1);
if (_la==T__6) {
{
- setState(309);
+ setState(327);
match(T__6);
- setState(310);
+ setState(328);
coordinate();
}
}
@@ -1773,26 +1928,26 @@ public class ReportParserParser extends Parser {
public final CoordinateContext coordinate() throws RecognitionException {
CoordinateContext _localctx = new CoordinateContext(_ctx, getState());
- enterRule(_localctx, 40, RULE_coordinate);
+ enterRule(_localctx, 42, RULE_coordinate);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(313);
+ setState(331);
cellIndicator();
- setState(318);
+ setState(336);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==COMMA) {
{
{
- setState(314);
+ setState(332);
match(COMMA);
- setState(315);
+ setState(333);
cellIndicator();
}
}
- setState(320);
+ setState(338);
_errHandler.sync(this);
_la = _input.LA(1);
}
@@ -1843,17 +1998,17 @@ public class ReportParserParser extends Parser {
public final CellIndicatorContext cellIndicator() throws RecognitionException {
CellIndicatorContext _localctx = new CellIndicatorContext(_ctx, getState());
- enterRule(_localctx, 42, RULE_cellIndicator);
+ enterRule(_localctx, 44, RULE_cellIndicator);
int _la;
try {
- setState(328);
+ setState(346);
_errHandler.sync(this);
- switch ( getInterpreter().adaptivePredict(_input,34,_ctx) ) {
+ switch ( getInterpreter().adaptivePredict(_input,36,_ctx) ) {
case 1:
_localctx = new RelativeContext(_localctx);
enterOuterAlt(_localctx, 1);
{
- setState(321);
+ setState(339);
match(Cell);
}
break;
@@ -1861,20 +2016,20 @@ public class ReportParserParser extends Parser {
_localctx = new AbsoluteContext(_localctx);
enterOuterAlt(_localctx, 2);
{
- setState(322);
+ setState(340);
match(Cell);
- setState(323);
+ setState(341);
match(COLON);
- setState(325);
+ setState(343);
_la = _input.LA(1);
if (_la==EXCLAMATION) {
{
- setState(324);
+ setState(342);
match(EXCLAMATION);
}
}
- setState(327);
+ setState(345);
match(INTEGER);
}
break;
@@ -1917,26 +2072,26 @@ public class ReportParserParser extends Parser {
public final ConditionsContext conditions() throws RecognitionException {
ConditionsContext _localctx = new ConditionsContext(_ctx, getState());
- enterRule(_localctx, 44, RULE_conditions);
+ enterRule(_localctx, 46, RULE_conditions);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(330);
+ setState(348);
condition();
- setState(336);
+ setState(354);
_errHandler.sync(this);
_la = _input.LA(1);
while (_la==AND || _la==OR) {
{
{
- setState(331);
+ setState(349);
join();
- setState(332);
+ setState(350);
condition();
}
}
- setState(338);
+ setState(356);
_errHandler.sync(this);
_la = _input.LA(1);
}
@@ -2010,20 +2165,20 @@ public class ReportParserParser extends Parser {
public final ConditionContext condition() throws RecognitionException {
ConditionContext _localctx = new ConditionContext(_ctx, getState());
- enterRule(_localctx, 46, RULE_condition);
+ enterRule(_localctx, 48, RULE_condition);
try {
- setState(350);
+ setState(368);
_errHandler.sync(this);
- switch ( getInterpreter().adaptivePredict(_input,36,_ctx) ) {
+ switch ( getInterpreter().adaptivePredict(_input,38,_ctx) ) {
case 1:
_localctx = new CellNameExprConditionContext(_localctx);
enterOuterAlt(_localctx, 1);
{
- setState(339);
+ setState(357);
match(Cell);
- setState(340);
+ setState(358);
match(OP);
- setState(341);
+ setState(359);
expr();
}
break;
@@ -2031,11 +2186,11 @@ public class ReportParserParser extends Parser {
_localctx = new PropertyConditionContext(_localctx);
enterOuterAlt(_localctx, 2);
{
- setState(342);
+ setState(360);
property(0);
- setState(343);
+ setState(361);
match(OP);
- setState(344);
+ setState(362);
expr();
}
break;
@@ -2043,11 +2198,11 @@ public class ReportParserParser extends Parser {
_localctx = new ExprConditionContext(_localctx);
enterOuterAlt(_localctx, 3);
{
- setState(346);
+ setState(364);
expr();
- setState(347);
+ setState(365);
match(OP);
- setState(348);
+ setState(366);
expr();
}
break;
@@ -2092,20 +2247,20 @@ public class ReportParserParser extends Parser {
int _parentState = getState();
PropertyContext _localctx = new PropertyContext(_ctx, _parentState);
PropertyContext _prevctx = _localctx;
- int _startState = 48;
- enterRecursionRule(_localctx, 48, RULE_property, _p);
+ int _startState = 50;
+ enterRecursionRule(_localctx, 50, RULE_property, _p);
try {
int _alt;
enterOuterAlt(_localctx, 1);
{
{
- setState(353);
+ setState(371);
match(Identifier);
}
_ctx.stop = _input.LT(-1);
- setState(360);
+ setState(378);
_errHandler.sync(this);
- _alt = getInterpreter().adaptivePredict(_input,37,_ctx);
+ _alt = getInterpreter().adaptivePredict(_input,39,_ctx);
while ( _alt!=2 && _alt!=org.antlr.v4.runtime.atn.ATN.INVALID_ALT_NUMBER ) {
if ( _alt==1 ) {
if ( _parseListeners!=null ) triggerExitRuleEvent();
@@ -2114,18 +2269,18 @@ public class ReportParserParser extends Parser {
{
_localctx = new PropertyContext(_parentctx, _parentState);
pushNewRecursionContext(_localctx, _startState, RULE_property);
- setState(355);
+ setState(373);
if (!(precpred(_ctx, 1))) throw new FailedPredicateException(this, "precpred(_ctx, 1)");
- setState(356);
+ setState(374);
match(T__11);
- setState(357);
+ setState(375);
property(2);
}
}
}
- setState(362);
+ setState(380);
_errHandler.sync(this);
- _alt = getInterpreter().adaptivePredict(_input,37,_ctx);
+ _alt = getInterpreter().adaptivePredict(_input,39,_ctx);
}
}
}
@@ -2159,12 +2314,12 @@ public class ReportParserParser extends Parser {
public final SimpleValueContext simpleValue() throws RecognitionException {
SimpleValueContext _localctx = new SimpleValueContext(_ctx, getState());
- enterRule(_localctx, 50, RULE_simpleValue);
+ enterRule(_localctx, 52, RULE_simpleValue);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(363);
+ setState(381);
_la = _input.LA(1);
if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << BOOLEAN) | (1L << NULL) | (1L << STRING) | (1L << INTEGER) | (1L << NUMBER))) != 0)) ) {
_errHandler.recoverInline(this);
@@ -2200,12 +2355,12 @@ public class ReportParserParser extends Parser {
public final JoinContext join() throws RecognitionException {
JoinContext _localctx = new JoinContext(_ctx, getState());
- enterRule(_localctx, 52, RULE_join);
+ enterRule(_localctx, 54, RULE_join);
int _la;
try {
enterOuterAlt(_localctx, 1);
{
- setState(365);
+ setState(383);
_la = _input.LA(1);
if ( !(_la==AND || _la==OR) ) {
_errHandler.recoverInline(this);
@@ -2240,11 +2395,11 @@ public class ReportParserParser extends Parser {
public final AggregateContext aggregate() throws RecognitionException {
AggregateContext _localctx = new AggregateContext(_ctx, getState());
- enterRule(_localctx, 54, RULE_aggregate);
+ enterRule(_localctx, 56, RULE_aggregate);
try {
enterOuterAlt(_localctx, 1);
{
- setState(367);
+ setState(385);
match(Identifier);
}
}
@@ -2261,162 +2416,179 @@ public class ReportParserParser extends Parser {
public boolean sempred(RuleContext _localctx, int ruleIndex, int predIndex) {
switch (ruleIndex) {
- case 18:
+ case 1:
+ return exprComposite_sempred((ExprCompositeContext)_localctx, predIndex);
+ case 19:
return set_sempred((SetContext)_localctx, predIndex);
- case 24:
+ case 25:
return property_sempred((PropertyContext)_localctx, predIndex);
}
return true;
}
- private boolean set_sempred(SetContext _localctx, int predIndex) {
+ private boolean exprComposite_sempred(ExprCompositeContext _localctx, int predIndex) {
switch (predIndex) {
case 0:
return precpred(_ctx, 1);
}
return true;
}
- private boolean property_sempred(PropertyContext _localctx, int predIndex) {
+ private boolean set_sempred(SetContext _localctx, int predIndex) {
switch (predIndex) {
case 1:
return precpred(_ctx, 1);
}
return true;
}
+ private boolean property_sempred(PropertyContext _localctx, int predIndex) {
+ switch (predIndex) {
+ case 2:
+ return precpred(_ctx, 1);
+ }
+ return true;
+ }
public static final String _serializedATN =
- "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3(\u0174\4\2\t\2\4"+
+ "\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\3(\u0186\4\2\t\2\4"+
"\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n\4\13\t"+
"\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22\t\22"+
"\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31\t\31"+
- "\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\3\2\3\2\3\2\3\2\5\2?\n\2\3\3"+
- "\3\3\3\3\3\3\7\3E\n\3\f\3\16\3H\13\3\3\3\3\3\3\3\3\3\3\3\3\4\3\4\3\4\3"+
- "\4\3\4\7\4T\n\4\f\4\16\4W\13\4\3\4\3\4\3\5\3\5\3\5\3\5\7\5_\n\5\f\5\16"+
- "\5b\13\5\3\5\5\5e\n\5\3\5\5\5h\n\5\3\5\3\5\3\6\3\6\7\6n\n\6\f\6\16\6q"+
- "\13\6\3\6\5\6t\n\6\3\7\3\7\3\7\3\7\3\7\3\7\7\7|\n\7\f\7\16\7\177\13\7"+
- "\3\7\3\7\3\7\5\7\u0084\n\7\3\7\3\7\5\7\u0088\n\7\3\7\3\7\3\b\3\b\3\b\3"+
- "\b\3\b\3\b\3\b\7\b\u0093\n\b\f\b\16\b\u0096\13\b\3\b\3\b\3\b\5\b\u009b"+
- "\n\b\3\b\3\b\5\b\u009f\n\b\3\b\3\b\3\t\3\t\3\t\5\t\u00a6\n\t\3\t\3\t\5"+
- "\t\u00aa\n\t\3\t\3\t\3\n\3\n\3\n\7\n\u00b1\n\n\f\n\16\n\u00b4\13\n\3\13"+
- "\3\13\3\13\3\13\3\f\3\f\3\f\7\f\u00bd\n\f\f\f\16\f\u00c0\13\f\3\f\3\f"+
- "\3\f\3\f\3\f\3\f\3\f\3\f\6\f\u00ca\n\f\r\f\16\f\u00cb\3\f\3\f\5\f\u00d0"+
- "\n\f\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\5\r\u00dd\n\r\3\16\3"+
- "\16\3\16\3\17\3\17\3\17\3\20\3\20\3\20\5\20\u00e8\n\20\3\21\3\21\3\21"+
- "\3\21\3\21\5\21\u00ef\n\21\3\21\3\21\5\21\u00f3\n\21\3\21\3\21\5\21\u00f7"+
- "\n\21\3\21\3\21\3\22\3\22\3\22\5\22\u00fe\n\22\3\22\3\22\3\23\3\23\5\23"+
- "\u0104\n\23\3\23\7\23\u0107\n\23\f\23\16\23\u010a\13\23\3\24\3\24\3\24"+
- "\3\24\3\24\3\24\3\24\3\24\3\24\3\24\5\24\u0116\n\24\3\24\3\24\3\24\3\24"+
- "\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24\3\24"+
- "\3\24\3\24\3\24\5\24\u012d\n\24\3\24\3\24\3\24\7\24\u0132\n\24\f\24\16"+
- "\24\u0135\13\24\3\25\3\25\3\25\5\25\u013a\n\25\3\26\3\26\3\26\7\26\u013f"+
- "\n\26\f\26\16\26\u0142\13\26\3\27\3\27\3\27\3\27\5\27\u0148\n\27\3\27"+
- "\5\27\u014b\n\27\3\30\3\30\3\30\3\30\7\30\u0151\n\30\f\30\16\30\u0154"+
- "\13\30\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\3\31\5\31\u0161"+
- "\n\31\3\32\3\32\3\32\3\32\3\32\3\32\7\32\u0169\n\32\f\32\16\32\u016c\13"+
- "\32\3\33\3\33\3\34\3\34\3\35\3\35\3\35\2\4&\62\36\2\4\6\b\n\f\16\20\22"+
- "\24\26\30\32\34\36 \"$&(*,.\60\62\64\668\2\4\6\2\26\26\31\31\34\34\37"+
- " \3\2\35\36\u018f\2>\3\2\2\2\4@\3\2\2\2\6N\3\2\2\2\bZ\3\2\2\2\nk\3\2\2"+
- "\2\fu\3\2\2\2\16\u008b\3\2\2\2\20\u00a2\3\2\2\2\22\u00ad\3\2\2\2\24\u00b5"+
- "\3\2\2\2\26\u00cf\3\2\2\2\30\u00dc\3\2\2\2\32\u00de\3\2\2\2\34\u00e1\3"+
- "\2\2\2\36\u00e4\3\2\2\2 \u00e9\3\2\2\2\"\u00fa\3\2\2\2$\u0101\3\2\2\2"+
- "&\u012c\3\2\2\2(\u0136\3\2\2\2*\u013b\3\2\2\2,\u014a\3\2\2\2.\u014c\3"+
- "\2\2\2\60\u0160\3\2\2\2\62\u0162\3\2\2\2\64\u016d\3\2\2\2\66\u016f\3\2"+
- "\2\28\u0171\3\2\2\2:?\5\22\n\2;?\5\4\3\2\5\n\6\2=?\5\6\4\2>:\3\2\2\2"+
- ">;\3\2\2\2><\3\2\2\2>=\3\2\2\2?\3\3\2\2\2@F\5\24\13\2AB\5\66\34\2BC\5"+
- "\24\13\2CE\3\2\2\2DA\3\2\2\2EH\3\2\2\2FD\3\2\2\2FG\3\2\2\2GI\3\2\2\2H"+
- "F\3\2\2\2IJ\7\3\2\2JK\5\22\n\2KL\7\27\2\2LM\5\22\n\2M\5\3\2\2\2NO\7\4"+
- "\2\2OP\7\5\2\2PU\5\b\5\2QR\7\30\2\2RT\5\b\5\2SQ\3\2\2\2TW\3\2\2\2US\3"+
- "\2\2\2UV\3\2\2\2VX\3\2\2\2WU\3\2\2\2XY\7\6\2\2Y\7\3\2\2\2Z`\5\24\13\2"+
- "[\\\5\66\34\2\\]\5\24\13\2]_\3\2\2\2^[\3\2\2\2_b\3\2\2\2`^\3\2\2\2`a\3"+
- "\2\2\2ad\3\2\2\2b`\3\2\2\2ce\7\27\2\2dc\3\2\2\2de\3\2\2\2eg\3\2\2\2fh"+
- "\7\7\2\2gf\3\2\2\2gh\3\2\2\2hi\3\2\2\2ij\5\22\n\2j\t\3\2\2\2ko\5\f\7\2"+
- "ln\5\16\b\2ml\3\2\2\2nq\3\2\2\2om\3\2\2\2op\3\2\2\2ps\3\2\2\2qo\3\2\2"+
- "\2rt\5\20\t\2sr\3\2\2\2st\3\2\2\2t\13\3\2\2\2uv\7\b\2\2vw\7\32\2\2w}\5"+
- "\24\13\2xy\5\66\34\2yz\5\24\13\2z|\3\2\2\2{x\3\2\2\2|\177\3\2\2\2}{\3"+
- "\2\2\2}~\3\2\2\2~\u0080\3\2\2\2\177}\3\2\2\2\u0080\u0081\7\33\2\2\u0081"+
- "\u0083\7\5\2\2\u0082\u0084\7\7\2\2\u0083\u0082\3\2\2\2\u0083\u0084\3\2"+
- "\2\2\u0084\u0085\3\2\2\2\u0085\u0087\5\22\n\2\u0086\u0088\7\t\2\2\u0087"+
- "\u0086\3\2\2\2\u0087\u0088\3\2\2\2\u0088\u0089\3\2\2\2\u0089\u008a\7\6"+
- "\2\2\u008a\r\3\2\2\2\u008b\u008c\7\n\2\2\u008c\u008d\7\b\2\2\u008d\u008e"+
- "\7\32\2\2\u008e\u0094\5\24\13\2\u008f\u0090\5\66\34\2\u0090\u0091\5\24"+
- "\13\2\u0091\u0093\3\2\2\2\u0092\u008f\3\2\2\2\u0093\u0096\3\2\2\2\u0094"+
- "\u0092\3\2\2\2\u0094\u0095\3\2\2\2\u0095\u0097\3\2\2\2\u0096\u0094\3\2"+
- "\2\2\u0097\u0098\7\33\2\2\u0098\u009a\7\5\2\2\u0099\u009b\7\7\2\2\u009a"+
- "\u0099\3\2\2\2\u009a\u009b\3\2\2\2\u009b\u009c\3\2\2\2\u009c\u009e\5\22"+
- "\n\2\u009d\u009f\7\t\2\2\u009e\u009d\3\2\2\2\u009e\u009f\3\2\2\2\u009f"+
- "\u00a0\3\2\2\2\u00a0\u00a1\7\6\2\2\u00a1\17\3\2\2\2\u00a2\u00a3\7\n\2"+
- "\2\u00a3\u00a5\7\5\2\2\u00a4\u00a6\7\7\2\2\u00a5\u00a4\3\2\2\2\u00a5\u00a6"+
- "\3\2\2\2\u00a6\u00a7\3\2\2\2\u00a7\u00a9\5\22\n\2\u00a8\u00aa\7\t\2\2"+
- "\u00a9\u00a8\3\2\2\2\u00a9\u00aa\3\2\2\2\u00aa\u00ab\3\2\2\2\u00ab\u00ac"+
- "\7\6\2\2\u00ac\21\3\2\2\2\u00ad\u00b2\5\26\f\2\u00ae\u00af\7\23\2\2\u00af"+
- "\u00b1\5\26\f\2\u00b0\u00ae\3\2\2\2\u00b1\u00b4\3\2\2\2\u00b2\u00b0\3"+
- "\2\2\2\u00b2\u00b3\3\2\2\2\u00b3\23\3\2\2\2\u00b4\u00b2\3\2\2\2\u00b5"+
- "\u00b6\5\22\n\2\u00b6\u00b7\7\24\2\2\u00b7\u00b8\5\22\n\2\u00b8\25\3\2"+
- "\2\2\u00b9\u00be\5\30\r\2\u00ba\u00bb\7\23\2\2\u00bb\u00bd\5\30\r\2\u00bc"+
- "\u00ba\3\2\2\2\u00bd\u00c0\3\2\2\2\u00be\u00bc\3\2\2\2\u00be\u00bf\3\2"+
- "\2\2\u00bf\u00d0\3\2\2\2\u00c0\u00be\3\2\2\2\u00c1\u00c2\7\32\2\2\u00c2"+
- "\u00c3\5\26\f\2\u00c3\u00c4\7\33\2\2\u00c4\u00d0\3\2\2\2\u00c5\u00c6\7"+
- "\32\2\2\u00c6\u00c9\5\26\f\2\u00c7\u00c8\7\23\2\2\u00c8\u00ca\5\26\f\2"+
- "\u00c9\u00c7\3\2\2\2\u00ca\u00cb\3\2\2\2\u00cb\u00c9\3\2\2\2\u00cb\u00cc"+
- "\3\2\2\2\u00cc\u00cd\3\2\2\2\u00cd\u00ce\7\33\2\2\u00ce\u00d0\3\2\2\2"+
- "\u00cf\u00b9\3\2\2\2\u00cf\u00c1\3\2\2\2\u00cf\u00c5\3\2\2\2\u00d0\27"+
- "\3\2\2\2\u00d1\u00dd\5 \21\2\u00d2\u00dd\5\"\22\2\u00d3\u00dd\5&\24\2"+
- "\u00d4\u00dd\5\32\16\2\u00d5\u00dd\5\34\17\2\u00d6\u00dd\5\36\20\2\u00d7"+
- "\u00dd\7\37\2\2\u00d8\u00dd\7\26\2\2\u00d9\u00dd\7\34\2\2\u00da\u00dd"+
- "\7 \2\2\u00db\u00dd\7\31\2\2\u00dc\u00d1\3\2\2\2\u00dc\u00d2\3\2\2\2\u00dc"+
- "\u00d3\3\2\2\2\u00dc\u00d4\3\2\2\2\u00dc\u00d5\3\2\2\2\u00dc\u00d6\3\2"+
- "\2\2\u00dc\u00d7\3\2\2\2\u00dc\u00d8\3\2\2\2\u00dc\u00d9\3\2\2\2\u00dc"+
- "\u00da\3\2\2\2\u00dc\u00db\3\2\2\2\u00dd\31\3\2\2\2\u00de\u00df\7\13\2"+
- "\2\u00df\u00e0\7\22\2\2\u00e0\33\3\2\2\2\u00e1\u00e2\7\f\2\2\u00e2\u00e3"+
- "\7\22\2\2\u00e3\35\3\2\2\2\u00e4\u00e7\7\r\2\2\u00e5\u00e6\7\16\2\2\u00e6"+
- "\u00e8\5\62\32\2\u00e7\u00e5\3\2\2\2\u00e7\u00e8\3\2\2\2\u00e8\37\3\2"+
- "\2\2\u00e9\u00ea\7$\2\2\u00ea\u00eb\7\16\2\2\u00eb\u00ec\58\35\2\u00ec"+
- "\u00ee\7\32\2\2\u00ed\u00ef\5\62\32\2\u00ee\u00ed\3\2\2\2\u00ee\u00ef"+
- "\3\2\2\2\u00ef\u00f2\3\2\2\2\u00f0\u00f1\7\30\2\2\u00f1\u00f3\5.\30\2"+
- "\u00f2\u00f0\3\2\2\2\u00f2\u00f3\3\2\2\2\u00f3\u00f6\3\2\2\2\u00f4\u00f5"+
- "\7\30\2\2\u00f5\u00f7\7\25\2\2\u00f6\u00f4\3\2\2\2\u00f6\u00f7\3\2\2\2"+
- "\u00f7\u00f8\3\2\2\2\u00f8\u00f9\7\33\2\2\u00f9!\3\2\2\2\u00fa\u00fb\7"+
- "$\2\2\u00fb\u00fd\7\32\2\2\u00fc\u00fe\5$\23\2\u00fd\u00fc\3\2\2\2\u00fd"+
- "\u00fe\3\2\2\2\u00fe\u00ff\3\2\2\2\u00ff\u0100\7\33\2\2\u0100#\3\2\2\2"+
- "\u0101\u0108\5&\24\2\u0102\u0104\7\30\2\2\u0103\u0102\3\2\2\2\u0103\u0104"+
- "\3\2\2\2\u0104\u0105\3\2\2\2\u0105\u0107\5&\24\2\u0106\u0103\3\2\2\2\u0107"+
- "\u010a\3\2\2\2\u0108\u0106\3\2\2\2\u0108\u0109\3\2\2\2\u0109%\3\2\2\2"+
- "\u010a\u0108\3\2\2\2\u010b\u010c\b\24\1\2\u010c\u012d\5\64\33\2\u010d"+
- "\u012d\7\22\2\2\u010e\u010f\7\22\2\2\u010f\u0110\7\17\2\2\u0110\u0115"+
- "\7\20\2\2\u0111\u0112\7\5\2\2\u0112\u0113\5.\30\2\u0113\u0114\7\6\2\2"+
- "\u0114\u0116\3\2\2\2\u0115\u0111\3\2\2\2\u0115\u0116\3\2\2\2\u0116\u012d"+
- "\3\2\2\2\u0117\u0118\7\22\2\2\u0118\u0119\7\27\2\2\u0119\u012d\7\22\2"+
- "\2\u011a\u011b\7\22\2\2\u011b\u011c\7\5\2\2\u011c\u011d\5.\30\2\u011d"+
- "\u011e\7\6\2\2\u011e\u012d\3\2\2\2\u011f\u0120\7\22\2\2\u0120\u0121\7"+
- "\17\2\2\u0121\u0122\5(\25\2\u0122\u0123\7\20\2\2\u0123\u012d\3\2\2\2\u0124"+
- "\u0125\7\22\2\2\u0125\u0126\7\17\2\2\u0126\u0127\5(\25\2\u0127\u0128\7"+
- "\20\2\2\u0128\u0129\7\5\2\2\u0129\u012a\5.\30\2\u012a\u012b\7\6\2\2\u012b"+
- "\u012d\3\2\2\2\u012c\u010b\3\2\2\2\u012c\u010d\3\2\2\2\u012c\u010e\3\2"+
- "\2\2\u012c\u0117\3\2\2\2\u012c\u011a\3\2\2\2\u012c\u011f\3\2\2\2\u012c"+
- "\u0124\3\2\2\2\u012d\u0133\3\2\2\2\u012e\u012f\f\3\2\2\u012f\u0130\7\21"+
- "\2\2\u0130\u0132\5&\24\4\u0131\u012e\3\2\2\2\u0132\u0135\3\2\2\2\u0133"+
- "\u0131\3\2\2\2\u0133\u0134\3\2\2\2\u0134\'\3\2\2\2\u0135\u0133\3\2\2\2"+
- "\u0136\u0139\5*\26\2\u0137\u0138\7\t\2\2\u0138\u013a\5*\26\2\u0139\u0137"+
- "\3\2\2\2\u0139\u013a\3\2\2\2\u013a)\3\2\2\2\u013b\u0140\5,\27\2\u013c"+
- "\u013d\7\30\2\2\u013d\u013f\5,\27\2\u013e\u013c\3\2\2\2\u013f\u0142\3"+
- "\2\2\2\u0140\u013e\3\2\2\2\u0140\u0141\3\2\2\2\u0141+\3\2\2\2\u0142\u0140"+
- "\3\2\2\2\u0143\u014b\7\22\2\2\u0144\u0145\7\22\2\2\u0145\u0147\7\27\2"+
- "\2\u0146\u0148\7!\2\2\u0147\u0146\3\2\2\2\u0147\u0148\3\2\2\2\u0148\u0149"+
- "\3\2\2\2\u0149\u014b\7\37\2\2\u014a\u0143\3\2\2\2\u014a\u0144\3\2\2\2"+
- "\u014b-\3\2\2\2\u014c\u0152\5\60\31\2\u014d\u014e\5\66\34\2\u014e\u014f"+
- "\5\60\31\2\u014f\u0151\3\2\2\2\u0150\u014d\3\2\2\2\u0151\u0154\3\2\2\2"+
- "\u0152\u0150\3\2\2\2\u0152\u0153\3\2\2\2\u0153/\3\2\2\2\u0154\u0152\3"+
- "\2\2\2\u0155\u0156\7\22\2\2\u0156\u0157\7\24\2\2\u0157\u0161\5\22\n\2"+
- "\u0158\u0159\5\62\32\2\u0159\u015a\7\24\2\2\u015a\u015b\5\22\n\2\u015b"+
- "\u0161\3\2\2\2\u015c\u015d\5\22\n\2\u015d\u015e\7\24\2\2\u015e\u015f\5"+
- "\22\n\2\u015f\u0161\3\2\2\2\u0160\u0155\3\2\2\2\u0160\u0158\3\2\2\2\u0160"+
- "\u015c\3\2\2\2\u0161\61\3\2\2\2\u0162\u0163\b\32\1\2\u0163\u0164\7$\2"+
- "\2\u0164\u016a\3\2\2\2\u0165\u0166\f\3\2\2\u0166\u0167\7\16\2\2\u0167"+
- "\u0169\5\62\32\4\u0168\u0165\3\2\2\2\u0169\u016c\3\2\2\2\u016a\u0168\3"+
- "\2\2\2\u016a\u016b\3\2\2\2\u016b\63\3\2\2\2\u016c\u016a\3\2\2\2\u016d"+
- "\u016e\t\2\2\2\u016e\65\3\2\2\2\u016f\u0170\t\3\2\2\u0170\67\3\2\2\2\u0171"+
- "\u0172\7$\2\2\u01729\3\2\2\2(>FU`dgos}\u0083\u0087\u0094\u009a\u009e\u00a5"+
- "\u00a9\u00b2\u00be\u00cb\u00cf\u00dc\u00e7\u00ee\u00f2\u00f6\u00fd\u0103"+
- "\u0108\u0115\u012c\u0133\u0139\u0140\u0147\u014a\u0152\u0160\u016a";
+ "\4\32\t\32\4\33\t\33\4\34\t\34\4\35\t\35\4\36\t\36\3\2\3\2\3\2\5\2@\n"+
+ "\2\3\3\3\3\3\3\3\3\3\3\3\3\3\3\5\3I\n\3\3\3\3\3\3\3\7\3N\n\3\f\3\16\3"+
+ "Q\13\3\3\4\3\4\3\4\3\4\7\4W\n\4\f\4\16\4Z\13\4\3\4\3\4\3\4\3\4\3\4\3\5"+
+ "\3\5\3\5\3\5\3\5\7\5f\n\5\f\5\16\5i\13\5\3\5\3\5\3\6\3\6\3\6\3\6\7\6q"+
+ "\n\6\f\6\16\6t\13\6\3\6\5\6w\n\6\3\6\5\6z\n\6\3\6\3\6\3\7\3\7\7\7\u0080"+
+ "\n\7\f\7\16\7\u0083\13\7\3\7\5\7\u0086\n\7\3\b\3\b\3\b\3\b\3\b\3\b\7\b"+
+ "\u008e\n\b\f\b\16\b\u0091\13\b\3\b\3\b\3\b\5\b\u0096\n\b\3\b\3\b\5\b\u009a"+
+ "\n\b\3\b\3\b\3\t\3\t\3\t\3\t\3\t\3\t\3\t\7\t\u00a5\n\t\f\t\16\t\u00a8"+
+ "\13\t\3\t\3\t\3\t\5\t\u00ad\n\t\3\t\3\t\5\t\u00b1\n\t\3\t\3\t\3\n\3\n"+
+ "\3\n\5\n\u00b8\n\n\3\n\3\n\5\n\u00bc\n\n\3\n\3\n\3\13\3\13\3\13\7\13\u00c3"+
+ "\n\13\f\13\16\13\u00c6\13\13\3\f\3\f\3\f\3\f\3\r\3\r\3\r\7\r\u00cf\n\r"+
+ "\f\r\16\r\u00d2\13\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\3\r\6\r\u00dc\n\r\r\r"+
+ "\16\r\u00dd\3\r\3\r\5\r\u00e2\n\r\3\16\3\16\3\16\3\16\3\16\3\16\3\16\3"+
+ "\16\3\16\3\16\3\16\5\16\u00ef\n\16\3\17\3\17\3\17\3\20\3\20\3\20\3\21"+
+ "\3\21\3\21\5\21\u00fa\n\21\3\22\3\22\3\22\3\22\3\22\5\22\u0101\n\22\3"+
+ "\22\3\22\5\22\u0105\n\22\3\22\3\22\5\22\u0109\n\22\3\22\3\22\3\23\3\23"+
+ "\3\23\5\23\u0110\n\23\3\23\3\23\3\24\3\24\5\24\u0116\n\24\3\24\7\24\u0119"+
+ "\n\24\f\24\16\24\u011c\13\24\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3"+
+ "\25\3\25\5\25\u0128\n\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25"+
+ "\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\3\25\5\25\u013f"+
+ "\n\25\3\25\3\25\3\25\7\25\u0144\n\25\f\25\16\25\u0147\13\25\3\26\3\26"+
+ "\3\26\5\26\u014c\n\26\3\27\3\27\3\27\7\27\u0151\n\27\f\27\16\27\u0154"+
+ "\13\27\3\30\3\30\3\30\3\30\5\30\u015a\n\30\3\30\5\30\u015d\n\30\3\31\3"+
+ "\31\3\31\3\31\7\31\u0163\n\31\f\31\16\31\u0166\13\31\3\32\3\32\3\32\3"+
+ "\32\3\32\3\32\3\32\3\32\3\32\3\32\3\32\5\32\u0173\n\32\3\33\3\33\3\33"+
+ "\3\33\3\33\3\33\7\33\u017b\n\33\f\33\16\33\u017e\13\33\3\34\3\34\3\35"+
+ "\3\35\3\36\3\36\3\36\2\5\4(\64\37\2\4\6\b\n\f\16\20\22\24\26\30\32\34"+
+ "\36 \"$&(*,.\60\62\64\668:\2\4\6\2\26\26\31\31\34\34\37 \3\2\35\36\u01a2"+
+ "\2?\3\2\2\2\4H\3\2\2\2\6R\3\2\2\2\b`\3\2\2\2\nl\3\2\2\2\f}\3\2\2\2\16"+
+ "\u0087\3\2\2\2\20\u009d\3\2\2\2\22\u00b4\3\2\2\2\24\u00bf\3\2\2\2\26\u00c7"+
+ "\3\2\2\2\30\u00e1\3\2\2\2\32\u00ee\3\2\2\2\34\u00f0\3\2\2\2\36\u00f3\3"+
+ "\2\2\2 \u00f6\3\2\2\2\"\u00fb\3\2\2\2$\u010c\3\2\2\2&\u0113\3\2\2\2(\u013e"+
+ "\3\2\2\2*\u0148\3\2\2\2,\u014d\3\2\2\2.\u015c\3\2\2\2\60\u015e\3\2\2\2"+
+ "\62\u0172\3\2\2\2\64\u0174\3\2\2\2\66\u017f\3\2\2\28\u0181\3\2\2\2:\u0183"+
+ "\3\2\2\2<@\5\4\3\2=@\5\f\7\2>@\5\b\5\2?<\3\2\2\2?=\3\2\2\2?>\3\2\2\2@"+
+ "\3\3\2\2\2AB\b\3\1\2BI\5\24\13\2CI\5\6\4\2DE\7\32\2\2EF\5\4\3\2FG\7\33"+
+ "\2\2GI\3\2\2\2HA\3\2\2\2HC\3\2\2\2HD\3\2\2\2IO\3\2\2\2JK\f\3\2\2KL\7\23"+
+ "\2\2LN\5\4\3\4MJ\3\2\2\2NQ\3\2\2\2OM\3\2\2\2OP\3\2\2\2P\5\3\2\2\2QO\3"+
+ "\2\2\2RX\5\26\f\2ST\58\35\2TU\5\26\f\2UW\3\2\2\2VS\3\2\2\2WZ\3\2\2\2X"+
+ "V\3\2\2\2XY\3\2\2\2Y[\3\2\2\2ZX\3\2\2\2[\\\7\3\2\2\\]\5\24\13\2]^\7\27"+
+ "\2\2^_\5\24\13\2_\7\3\2\2\2`a\7\4\2\2ab\7\5\2\2bg\5\n\6\2cd\7\30\2\2d"+
+ "f\5\n\6\2ec\3\2\2\2fi\3\2\2\2ge\3\2\2\2gh\3\2\2\2hj\3\2\2\2ig\3\2\2\2"+
+ "jk\7\6\2\2k\t\3\2\2\2lr\5\26\f\2mn\58\35\2no\5\26\f\2oq\3\2\2\2pm\3\2"+
+ "\2\2qt\3\2\2\2rp\3\2\2\2rs\3\2\2\2sv\3\2\2\2tr\3\2\2\2uw\7\27\2\2vu\3"+
+ "\2\2\2vw\3\2\2\2wy\3\2\2\2xz\7\7\2\2yx\3\2\2\2yz\3\2\2\2z{\3\2\2\2{|\5"+
+ "\24\13\2|\13\3\2\2\2}\u0081\5\16\b\2~\u0080\5\20\t\2\177~\3\2\2\2\u0080"+
+ "\u0083\3\2\2\2\u0081\177\3\2\2\2\u0081\u0082\3\2\2\2\u0082\u0085\3\2\2"+
+ "\2\u0083\u0081\3\2\2\2\u0084\u0086\5\22\n\2\u0085\u0084\3\2\2\2\u0085"+
+ "\u0086\3\2\2\2\u0086\r\3\2\2\2\u0087\u0088\7\b\2\2\u0088\u0089\7\32\2"+
+ "\2\u0089\u008f\5\26\f\2\u008a\u008b\58\35\2\u008b\u008c\5\26\f\2\u008c"+
+ "\u008e\3\2\2\2\u008d\u008a\3\2\2\2\u008e\u0091\3\2\2\2\u008f\u008d\3\2"+
+ "\2\2\u008f\u0090\3\2\2\2\u0090\u0092\3\2\2\2\u0091\u008f\3\2\2\2\u0092"+
+ "\u0093\7\33\2\2\u0093\u0095\7\5\2\2\u0094\u0096\7\7\2\2\u0095\u0094\3"+
+ "\2\2\2\u0095\u0096\3\2\2\2\u0096\u0097\3\2\2\2\u0097\u0099\5\24\13\2\u0098"+
+ "\u009a\7\t\2\2\u0099\u0098\3\2\2\2\u0099\u009a\3\2\2\2\u009a\u009b\3\2"+
+ "\2\2\u009b\u009c\7\6\2\2\u009c\17\3\2\2\2\u009d\u009e\7\n\2\2\u009e\u009f"+
+ "\7\b\2\2\u009f\u00a0\7\32\2\2\u00a0\u00a6\5\26\f\2\u00a1\u00a2\58\35\2"+
+ "\u00a2\u00a3\5\26\f\2\u00a3\u00a5\3\2\2\2\u00a4\u00a1\3\2\2\2\u00a5\u00a8"+
+ "\3\2\2\2\u00a6\u00a4\3\2\2\2\u00a6\u00a7\3\2\2\2\u00a7\u00a9\3\2\2\2\u00a8"+
+ "\u00a6\3\2\2\2\u00a9\u00aa\7\33\2\2\u00aa\u00ac\7\5\2\2\u00ab\u00ad\7"+
+ "\7\2\2\u00ac\u00ab\3\2\2\2\u00ac\u00ad\3\2\2\2\u00ad\u00ae\3\2\2\2\u00ae"+
+ "\u00b0\5\24\13\2\u00af\u00b1\7\t\2\2\u00b0\u00af\3\2\2\2\u00b0\u00b1\3"+
+ "\2\2\2\u00b1\u00b2\3\2\2\2\u00b2\u00b3\7\6\2\2\u00b3\21\3\2\2\2\u00b4"+
+ "\u00b5\7\n\2\2\u00b5\u00b7\7\5\2\2\u00b6\u00b8\7\7\2\2\u00b7\u00b6\3\2"+
+ "\2\2\u00b7\u00b8\3\2\2\2\u00b8\u00b9\3\2\2\2\u00b9\u00bb\5\24\13\2\u00ba"+
+ "\u00bc\7\t\2\2\u00bb\u00ba\3\2\2\2\u00bb\u00bc\3\2\2\2\u00bc\u00bd\3\2"+
+ "\2\2\u00bd\u00be\7\6\2\2\u00be\23\3\2\2\2\u00bf\u00c4\5\30\r\2\u00c0\u00c1"+
+ "\7\23\2\2\u00c1\u00c3\5\30\r\2\u00c2\u00c0\3\2\2\2\u00c3\u00c6\3\2\2\2"+
+ "\u00c4\u00c2\3\2\2\2\u00c4\u00c5\3\2\2\2\u00c5\25\3\2\2\2\u00c6\u00c4"+
+ "\3\2\2\2\u00c7\u00c8\5\24\13\2\u00c8\u00c9\7\24\2\2\u00c9\u00ca\5\24\13"+
+ "\2\u00ca\27\3\2\2\2\u00cb\u00d0\5\32\16\2\u00cc\u00cd\7\23\2\2\u00cd\u00cf"+
+ "\5\32\16\2\u00ce\u00cc\3\2\2\2\u00cf\u00d2\3\2\2\2\u00d0\u00ce\3\2\2\2"+
+ "\u00d0\u00d1\3\2\2\2\u00d1\u00e2\3\2\2\2\u00d2\u00d0\3\2\2\2\u00d3\u00d4"+
+ "\7\32\2\2\u00d4\u00d5\5\30\r\2\u00d5\u00d6\7\33\2\2\u00d6\u00e2\3\2\2"+
+ "\2\u00d7\u00d8\7\32\2\2\u00d8\u00db\5\30\r\2\u00d9\u00da\7\23\2\2\u00da"+
+ "\u00dc\5\30\r\2\u00db\u00d9\3\2\2\2\u00dc\u00dd\3\2\2\2\u00dd\u00db\3"+
+ "\2\2\2\u00dd\u00de\3\2\2\2\u00de\u00df\3\2\2\2\u00df\u00e0\7\33\2\2\u00e0"+
+ "\u00e2\3\2\2\2\u00e1\u00cb\3\2\2\2\u00e1\u00d3\3\2\2\2\u00e1\u00d7\3\2"+
+ "\2\2\u00e2\31\3\2\2\2\u00e3\u00ef\5\"\22\2\u00e4\u00ef\5$\23\2\u00e5\u00ef"+
+ "\5(\25\2\u00e6\u00ef\5\34\17\2\u00e7\u00ef\5\36\20\2\u00e8\u00ef\5 \21"+
+ "\2\u00e9\u00ef\7\37\2\2\u00ea\u00ef\7\26\2\2\u00eb\u00ef\7\34\2\2\u00ec"+
+ "\u00ef\7 \2\2\u00ed\u00ef\7\31\2\2\u00ee\u00e3\3\2\2\2\u00ee\u00e4\3\2"+
+ "\2\2\u00ee\u00e5\3\2\2\2\u00ee\u00e6\3\2\2\2\u00ee\u00e7\3\2\2\2\u00ee"+
+ "\u00e8\3\2\2\2\u00ee\u00e9\3\2\2\2\u00ee\u00ea\3\2\2\2\u00ee\u00eb\3\2"+
+ "\2\2\u00ee\u00ec\3\2\2\2\u00ee\u00ed\3\2\2\2\u00ef\33\3\2\2\2\u00f0\u00f1"+
+ "\7\13\2\2\u00f1\u00f2\7\22\2\2\u00f2\35\3\2\2\2\u00f3\u00f4\7\f\2\2\u00f4"+
+ "\u00f5\7\22\2\2\u00f5\37\3\2\2\2\u00f6\u00f9\7\r\2\2\u00f7\u00f8\7\16"+
+ "\2\2\u00f8\u00fa\5\64\33\2\u00f9\u00f7\3\2\2\2\u00f9\u00fa\3\2\2\2\u00fa"+
+ "!\3\2\2\2\u00fb\u00fc\7$\2\2\u00fc\u00fd\7\16\2\2\u00fd\u00fe\5:\36\2"+
+ "\u00fe\u0100\7\32\2\2\u00ff\u0101\5\64\33\2\u0100\u00ff\3\2\2\2\u0100"+
+ "\u0101\3\2\2\2\u0101\u0104\3\2\2\2\u0102\u0103\7\30\2\2\u0103\u0105\5"+
+ "\60\31\2\u0104\u0102\3\2\2\2\u0104\u0105\3\2\2\2\u0105\u0108\3\2\2\2\u0106"+
+ "\u0107\7\30\2\2\u0107\u0109\7\25\2\2\u0108\u0106\3\2\2\2\u0108\u0109\3"+
+ "\2\2\2\u0109\u010a\3\2\2\2\u010a\u010b\7\33\2\2\u010b#\3\2\2\2\u010c\u010d"+
+ "\7$\2\2\u010d\u010f\7\32\2\2\u010e\u0110\5&\24\2\u010f\u010e\3\2\2\2\u010f"+
+ "\u0110\3\2\2\2\u0110\u0111\3\2\2\2\u0111\u0112\7\33\2\2\u0112%\3\2\2\2"+
+ "\u0113\u011a\5(\25\2\u0114\u0116\7\30\2\2\u0115\u0114\3\2\2\2\u0115\u0116"+
+ "\3\2\2\2\u0116\u0117\3\2\2\2\u0117\u0119\5(\25\2\u0118\u0115\3\2\2\2\u0119"+
+ "\u011c\3\2\2\2\u011a\u0118\3\2\2\2\u011a\u011b\3\2\2\2\u011b\'\3\2\2\2"+
+ "\u011c\u011a\3\2\2\2\u011d\u011e\b\25\1\2\u011e\u013f\5\66\34\2\u011f"+
+ "\u013f\7\22\2\2\u0120\u0121\7\22\2\2\u0121\u0122\7\17\2\2\u0122\u0127"+
+ "\7\20\2\2\u0123\u0124\7\5\2\2\u0124\u0125\5\60\31\2\u0125\u0126\7\6\2"+
+ "\2\u0126\u0128\3\2\2\2\u0127\u0123\3\2\2\2\u0127\u0128\3\2\2\2\u0128\u013f"+
+ "\3\2\2\2\u0129\u012a\7\22\2\2\u012a\u012b\7\27\2\2\u012b\u013f\7\22\2"+
+ "\2\u012c\u012d\7\22\2\2\u012d\u012e\7\5\2\2\u012e\u012f\5\60\31\2\u012f"+
+ "\u0130\7\6\2\2\u0130\u013f\3\2\2\2\u0131\u0132\7\22\2\2\u0132\u0133\7"+
+ "\17\2\2\u0133\u0134\5*\26\2\u0134\u0135\7\20\2\2\u0135\u013f\3\2\2\2\u0136"+
+ "\u0137\7\22\2\2\u0137\u0138\7\17\2\2\u0138\u0139\5*\26\2\u0139\u013a\7"+
+ "\20\2\2\u013a\u013b\7\5\2\2\u013b\u013c\5\60\31\2\u013c\u013d\7\6\2\2"+
+ "\u013d\u013f\3\2\2\2\u013e\u011d\3\2\2\2\u013e\u011f\3\2\2\2\u013e\u0120"+
+ "\3\2\2\2\u013e\u0129\3\2\2\2\u013e\u012c\3\2\2\2\u013e\u0131\3\2\2\2\u013e"+
+ "\u0136\3\2\2\2\u013f\u0145\3\2\2\2\u0140\u0141\f\3\2\2\u0141\u0142\7\21"+
+ "\2\2\u0142\u0144\5(\25\4\u0143\u0140\3\2\2\2\u0144\u0147\3\2\2\2\u0145"+
+ "\u0143\3\2\2\2\u0145\u0146\3\2\2\2\u0146)\3\2\2\2\u0147\u0145\3\2\2\2"+
+ "\u0148\u014b\5,\27\2\u0149\u014a\7\t\2\2\u014a\u014c\5,\27\2\u014b\u0149"+
+ "\3\2\2\2\u014b\u014c\3\2\2\2\u014c+\3\2\2\2\u014d\u0152\5.\30\2\u014e"+
+ "\u014f\7\30\2\2\u014f\u0151\5.\30\2\u0150\u014e\3\2\2\2\u0151\u0154\3"+
+ "\2\2\2\u0152\u0150\3\2\2\2\u0152\u0153\3\2\2\2\u0153-\3\2\2\2\u0154\u0152"+
+ "\3\2\2\2\u0155\u015d\7\22\2\2\u0156\u0157\7\22\2\2\u0157\u0159\7\27\2"+
+ "\2\u0158\u015a\7!\2\2\u0159\u0158\3\2\2\2\u0159\u015a\3\2\2\2\u015a\u015b"+
+ "\3\2\2\2\u015b\u015d\7\37\2\2\u015c\u0155\3\2\2\2\u015c\u0156\3\2\2\2"+
+ "\u015d/\3\2\2\2\u015e\u0164\5\62\32\2\u015f\u0160\58\35\2\u0160\u0161"+
+ "\5\62\32\2\u0161\u0163\3\2\2\2\u0162\u015f\3\2\2\2\u0163\u0166\3\2\2\2"+
+ "\u0164\u0162\3\2\2\2\u0164\u0165\3\2\2\2\u0165\61\3\2\2\2\u0166\u0164"+
+ "\3\2\2\2\u0167\u0168\7\22\2\2\u0168\u0169\7\24\2\2\u0169\u0173\5\24\13"+
+ "\2\u016a\u016b\5\64\33\2\u016b\u016c\7\24\2\2\u016c\u016d\5\24\13\2\u016d"+
+ "\u0173\3\2\2\2\u016e\u016f\5\24\13\2\u016f\u0170\7\24\2\2\u0170\u0171"+
+ "\5\24\13\2\u0171\u0173\3\2\2\2\u0172\u0167\3\2\2\2\u0172\u016a\3\2\2\2"+
+ "\u0172\u016e\3\2\2\2\u0173\63\3\2\2\2\u0174\u0175\b\33\1\2\u0175\u0176"+
+ "\7$\2\2\u0176\u017c\3\2\2\2\u0177\u0178\f\3\2\2\u0178\u0179\7\16\2\2\u0179"+
+ "\u017b\5\64\33\4\u017a\u0177\3\2\2\2\u017b\u017e\3\2\2\2\u017c\u017a\3"+
+ "\2\2\2\u017c\u017d\3\2\2\2\u017d\65\3\2\2\2\u017e\u017c\3\2\2\2\u017f"+
+ "\u0180\t\2\2\2\u0180\67\3\2\2\2\u0181\u0182\t\3\2\2\u01829\3\2\2\2\u0183"+
+ "\u0184\7$\2\2\u0184;\3\2\2\2*?HOXgrvy\u0081\u0085\u008f\u0095\u0099\u00a6"+
+ "\u00ac\u00b0\u00b7\u00bb\u00c4\u00d0\u00dd\u00e1\u00ee\u00f9\u0100\u0104"+
+ "\u0108\u010f\u0115\u011a\u0127\u013e\u0145\u014b\u0152\u0159\u015c\u0164"+
+ "\u0172\u017c";
public static final ATN _ATN =
new ATNDeserializer().deserialize(_serializedATN.toCharArray());
static {
diff --git a/ureport2-core/src/main/java/com/bstek/ureport/dsl/ReportParserVisitor.java b/ureport2-core/src/main/java/com/bstek/ureport/dsl/ReportParserVisitor.java
index 66ca0fe..53ecef7 100644
--- a/ureport2-core/src/main/java/com/bstek/ureport/dsl/ReportParserVisitor.java
+++ b/ureport2-core/src/main/java/com/bstek/ureport/dsl/ReportParserVisitor.java
@@ -16,6 +16,34 @@ public interface ReportParserVisitor extends ParseTreeVisitor {
* @return the visitor result
*/
T visitExpression(ReportParserParser.ExpressionContext ctx);
+ /**
+ * Visit a parse tree produced by the {@code complexExprComposite}
+ * labeled alternative in {@link ReportParserParser#exprComposite}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitComplexExprComposite(ReportParserParser.ComplexExprCompositeContext ctx);
+ /**
+ * Visit a parse tree produced by the {@code singleExprComposite}
+ * labeled alternative in {@link ReportParserParser#exprComposite}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitSingleExprComposite(ReportParserParser.SingleExprCompositeContext ctx);
+ /**
+ * Visit a parse tree produced by the {@code parenExprComposite}
+ * labeled alternative in {@link ReportParserParser#exprComposite}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitParenExprComposite(ReportParserParser.ParenExprCompositeContext ctx);
+ /**
+ * Visit a parse tree produced by the {@code ternaryExprComposite}
+ * labeled alternative in {@link ReportParserParser#exprComposite}.
+ * @param ctx the parse tree
+ * @return the visitor result
+ */
+ T visitTernaryExprComposite(ReportParserParser.TernaryExprCompositeContext ctx);
/**
* Visit a parse tree produced by {@link ReportParserParser#ternaryExpr}.
* @param ctx the parse tree
diff --git a/ureport2-core/src/main/java/com/bstek/ureport/export/html/HtmlProducer.java b/ureport2-core/src/main/java/com/bstek/ureport/export/html/HtmlProducer.java
index 9a8f286..a1123fa 100644
--- a/ureport2-core/src/main/java/com/bstek/ureport/export/html/HtmlProducer.java
+++ b/ureport2-core/src/main/java/com/bstek/ureport/export/html/HtmlProducer.java
@@ -22,6 +22,7 @@ import org.apache.commons.lang3.StringUtils;
import com.bstek.ureport.build.Context;
import com.bstek.ureport.build.paging.Page;
+import com.bstek.ureport.chart.ChartData;
import com.bstek.ureport.definition.Alignment;
import com.bstek.ureport.definition.Border;
import com.bstek.ureport.definition.CellStyle;
@@ -161,10 +162,16 @@ public class HtmlProducer{
}
sb.append("");
+ }else if(obj instanceof ChartData){
+ String canvasId="_canvas_"+cell.getName()+i+"-"+j;
+ sb.append("");
+ ChartData chartData=(ChartData)obj;
+ sb.append(chartData.buildJavascript(canvasId));
}else{
String text=obj.toString();
text=text.replaceAll("\r\n", "
");
text=text.replaceAll("\n", "
");
+ text=text.replaceAll(" ", " ");
sb.append(text);
}
if(hasLink){
diff --git a/ureport2-core/src/main/java/com/bstek/ureport/expression/parse/ExpressionVisitor.java b/ureport2-core/src/main/java/com/bstek/ureport/expression/parse/ExpressionVisitor.java
index 4bed758..666546e 100644
--- a/ureport2-core/src/main/java/com/bstek/ureport/expression/parse/ExpressionVisitor.java
+++ b/ureport2-core/src/main/java/com/bstek/ureport/expression/parse/ExpressionVisitor.java
@@ -23,8 +23,10 @@ import org.antlr.v4.runtime.tree.TerminalNode;
import com.bstek.ureport.dsl.ReportParserBaseVisitor;
import com.bstek.ureport.dsl.ReportParserParser.CaseExprContext;
import com.bstek.ureport.dsl.ReportParserParser.CasePartContext;
+import com.bstek.ureport.dsl.ReportParserParser.ComplexExprCompositeContext;
import com.bstek.ureport.dsl.ReportParserParser.ElseIfPartContext;
import com.bstek.ureport.dsl.ReportParserParser.ElsePartContext;
+import com.bstek.ureport.dsl.ReportParserParser.ExprCompositeContext;
import com.bstek.ureport.dsl.ReportParserParser.ExprContext;
import com.bstek.ureport.dsl.ReportParserParser.ExpressionContext;
import com.bstek.ureport.dsl.ReportParserParser.IfConditionContext;
@@ -32,9 +34,12 @@ import com.bstek.ureport.dsl.ReportParserParser.IfExprContext;
import com.bstek.ureport.dsl.ReportParserParser.IfPartContext;
import com.bstek.ureport.dsl.ReportParserParser.ItemContext;
import com.bstek.ureport.dsl.ReportParserParser.JoinContext;
+import com.bstek.ureport.dsl.ReportParserParser.ParenExprCompositeContext;
import com.bstek.ureport.dsl.ReportParserParser.ParenJoinContext;
import com.bstek.ureport.dsl.ReportParserParser.SimpleJoinContext;
+import com.bstek.ureport.dsl.ReportParserParser.SingleExprCompositeContext;
import com.bstek.ureport.dsl.ReportParserParser.SingleParenJoinContext;
+import com.bstek.ureport.dsl.ReportParserParser.TernaryExprCompositeContext;
import com.bstek.ureport.dsl.ReportParserParser.TernaryExprContext;
import com.bstek.ureport.dsl.ReportParserParser.UnitContext;
import com.bstek.ureport.exception.ReportParseException;
@@ -63,12 +68,11 @@ public class ExpressionVisitor extends ReportParserBaseVisitor{
}
@Override
public Expression visitExpression(ExpressionContext ctx) {
- ExprContext exprContext=ctx.expr();
+ ExprCompositeContext exprCompositeContext=ctx.exprComposite();
IfExprContext ifExprContext=ctx.ifExpr();
CaseExprContext caseExprContext=ctx.caseExpr();
- TernaryExprContext ternaryExprContext=ctx.ternaryExpr();
- if(exprContext!=null){
- return parseExpr(exprContext);
+ if(exprCompositeContext!=null){
+ return parseExprComposite(exprCompositeContext);
}else if(ifExprContext!=null){
IfExpression expr=new IfExpression();
expr.setExpr(ctx.getText());
@@ -122,7 +126,22 @@ public class ExpressionVisitor extends ReportParserBaseVisitor{
elseIfExpressionList.add(elseIfExpr);
}
return expr;
- }else if(ternaryExprContext!=null){
+ }else{
+ throw new ReportParseException("Expression ["+ctx.getText()+"] is invalid.");
+ }
+ }
+ private Expression parseExprComposite(ExprCompositeContext exprCompositeContext) {
+ if(exprCompositeContext instanceof SingleExprCompositeContext){
+ SingleExprCompositeContext singleExprCompositeContext=(SingleExprCompositeContext)exprCompositeContext;
+ ExprContext exprContext=singleExprCompositeContext.expr();
+ return parseExpr(exprContext);
+ }else if(exprCompositeContext instanceof ParenExprCompositeContext){
+ ParenExprCompositeContext parenExprCompositeContext=(ParenExprCompositeContext)exprCompositeContext;
+ ExprCompositeContext childExprCompositeContext=parenExprCompositeContext.exprComposite();
+ return parseExprComposite(childExprCompositeContext);
+ }else if(exprCompositeContext instanceof TernaryExprCompositeContext){
+ TernaryExprCompositeContext ternaryExprCompositeContext=(TernaryExprCompositeContext)exprCompositeContext;
+ TernaryExprContext ternaryExprContext=ternaryExprCompositeContext.ternaryExpr();
List ifConditionContexts=ternaryExprContext.ifCondition();
IfExpression expr=new IfExpression();
expr.setConditionList(parseCondtionList(ifConditionContexts, ternaryExprContext.join()));
@@ -133,10 +152,27 @@ public class ExpressionVisitor extends ReportParserBaseVisitor{
elseExpr.setExpression(parseExpr(secondExprContext));
expr.setElseExpression(elseExpr);
return expr;
+ }else if(exprCompositeContext instanceof ComplexExprCompositeContext){
+ ComplexExprCompositeContext complexExprCompositeContext=(ComplexExprCompositeContext)exprCompositeContext;
+ ExprCompositeContext leftExprCompositeContext=complexExprCompositeContext.exprComposite(0);
+ Expression leftExpression=parseExprComposite(leftExprCompositeContext);
+ ExprCompositeContext rightExprCompositeContext=complexExprCompositeContext.exprComposite(1);
+ Expression rightExpression=parseExprComposite(rightExprCompositeContext);
+ String op=complexExprCompositeContext.Operator().getText();
+ Operator operator=Operator.parse(op);
+ List expressions=new ArrayList();
+ expressions.add((BaseExpression)leftExpression);
+ expressions.add((BaseExpression)rightExpression);
+ List operators=new ArrayList();
+ operators.add(operator);
+ ParenExpression expression=new ParenExpression(operators, expressions);
+ expression.setExpr(complexExprCompositeContext.getText());
+ return expression;
}else{
- throw new ReportParseException("Expression ["+ctx.getText()+"] is invalid.");
+ throw new ReportParseException("Unknow context :"+exprCompositeContext);
}
}
+
private Expression parseExpr(ExprContext exprContext) {
List expressions=new ArrayList();
List operators=new ArrayList();
diff --git a/ureport2-core/src/main/resources/ureport-core-context.xml b/ureport2-core/src/main/resources/ureport-core-context.xml
index 788506e..258c553 100644
--- a/ureport2-core/src/main/resources/ureport-core-context.xml
+++ b/ureport2-core/src/main/resources/ureport-core-context.xml
@@ -5,10 +5,13 @@
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
">
-
+
+
+
+
diff --git a/ureport2-core/src/main/resources/ureport2.xsd b/ureport2-core/src/main/resources/ureport2.xsd
index fd7e791..fb3b13e 100644
--- a/ureport2-core/src/main/resources/ureport2.xsd
+++ b/ureport2-core/src/main/resources/ureport2.xsd
@@ -251,6 +251,322 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+