use of org.wso2.carbon.bpel.ui.bpel2svg.Link in project siddhi by wso2.
the class SiddhiQLBaseVisitorImpl method visitEquality_math_operation.
/**
* {@inheritDoc}
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*
* @param ctx
*/
@Override
public Expression visitEquality_math_operation(@NotNull SiddhiQLParser.Equality_math_operationContext ctx) {
if (ctx.eq != null) {
Expression expression = Expression.compare((Expression) visit(ctx.math_operation(0)), Compare.Operator.EQUAL, (Expression) visit(ctx.math_operation(1)));
populateQueryContext(expression, ctx);
return expression;
} else if (ctx.not_eq != null) {
Expression expression = Expression.compare((Expression) visit(ctx.math_operation(0)), Compare.Operator.NOT_EQUAL, (Expression) visit(ctx.math_operation(1)));
populateQueryContext(expression, ctx);
return expression;
} else {
throw newSiddhiParserException(ctx);
}
}
use of org.wso2.carbon.bpel.ui.bpel2svg.Link in project siddhi by wso2.
the class SiddhiQLBaseVisitorImpl method visitOutput_attribute.
/**
* {@inheritDoc}
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*
* @param ctx
*/
@Override
public Object visitOutput_attribute(@NotNull SiddhiQLParser.Output_attributeContext ctx) {
// ;
if (ctx.AS() != null) {
OutputAttribute outputAttribute = new OutputAttribute((String) visit(ctx.attribute_name()), (Expression) visit(ctx.attribute()));
populateQueryContext(outputAttribute, ctx);
return outputAttribute;
} else {
OutputAttribute outputAttribute = new OutputAttribute((Variable) visit(ctx.attribute_reference()));
populateQueryContext(outputAttribute, ctx);
return outputAttribute;
}
}
use of org.wso2.carbon.bpel.ui.bpel2svg.Link in project siddhi by wso2.
the class SiddhiQLBaseVisitorImpl method visitSigned_int_value.
/**
* {@inheritDoc}
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*
* @param ctx
*/
@Override
public IntConstant visitSigned_int_value(@NotNull SiddhiQLParser.Signed_int_valueContext ctx) {
IntConstant intConstant = Expression.value(Integer.parseInt(ctx.getText()));
populateQueryContext(intConstant, ctx);
return intConstant;
}
use of org.wso2.carbon.bpel.ui.bpel2svg.Link in project siddhi by wso2.
the class SiddhiQLBaseVisitorImpl method visitSigned_double_value.
/**
* {@inheritDoc}
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*
* @param ctx
*/
@Override
public DoubleConstant visitSigned_double_value(@NotNull SiddhiQLParser.Signed_double_valueContext ctx) {
DoubleConstant doubleConstant = Expression.value(Double.parseDouble(ctx.getText()));
populateQueryContext(doubleConstant, ctx);
return doubleConstant;
}
use of org.wso2.carbon.bpel.ui.bpel2svg.Link in project siddhi by wso2.
the class SiddhiQLBaseVisitorImpl method visitSequence_collection_stateful_source.
/**
* {@inheritDoc}
* <p>The default implementation returns the result of calling
* {@link #visitChildren} on {@code ctx}.</p>
*
* @param ctx
*/
@Override
public CountStateElement visitSequence_collection_stateful_source(@NotNull SiddhiQLParser.Sequence_collection_stateful_sourceContext ctx) {
// sequence_collection_stateful_source
// :standard_stateful_source ('<' collect '>'|zero_or_more='*'|zero_or_one='?'|one_or_more='+')
// ;
StreamStateElement streamStateElement = (StreamStateElement) visit(ctx.standard_stateful_source());
if (ctx.one_or_more != null) {
CountStateElement countStateElement = new CountStateElement(streamStateElement, 1, CountStateElement.ANY);
populateQueryContext(countStateElement, ctx);
return countStateElement;
} else if (ctx.zero_or_more != null) {
CountStateElement countStateElement = new CountStateElement(streamStateElement, 0, CountStateElement.ANY);
populateQueryContext(countStateElement, ctx);
return countStateElement;
} else if (ctx.zero_or_one != null) {
CountStateElement countStateElement = new CountStateElement(streamStateElement, 0, 1);
populateQueryContext(countStateElement, ctx);
return countStateElement;
} else if (ctx.collect() != null) {
Object[] minMax = (Object[]) visit(ctx.collect());
int min = CountStateElement.ANY;
int max = CountStateElement.ANY;
if (minMax[0] != null) {
min = (Integer) minMax[0];
}
if (minMax[1] != null) {
max = (Integer) minMax[1];
}
CountStateElement countStateElement = new CountStateElement(streamStateElement, min, max);
populateQueryContext(countStateElement, ctx);
return countStateElement;
} else {
throw newSiddhiParserException(ctx);
}
}
Aggregations