blob: a455ea38735e08bc9678efc5efc9d872c4287428 [file] [log] [blame]
/**
*
* Copyright (c) 2015 - 2016 - Loetz GmbH&Co.KG, 69115 Heidelberg, Germany
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation
* Jörg Riegel - ongoing development
*
*/
grammar org.eclipse.osbp.xtext.datamartdsl.DatamartDSL with org.eclipse.osbp.xtext.oxtype.OXtype
import "http://osbp.eclipse.org/xtext/datamartdsl/DatamartDSL" as datamart
import "http://osbp.eclipse.org/xtext/cubedsl/CubeDSL" as cube
import "http://osbp.eclipse.org/xtext/authorizationdsl/AuthorizationDSL" as authorization
import "http://osbp.eclipse.org/dsl/common/types/v1" as types
import "http://osbp.eclipse.org/dsl/entity/v1" as entity
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
DatamartModel returns datamart::DatamartModel:
importSection=XImportSection?
packages+=DatamartPackage*;
DatamartPackage returns datamart::DatamartPackage:
{datamart::DatamartPackage} 'package' name=QualifiedName
('{' (definitions+=DatamartDefinition)* '}' )?;
DatamartDefinition returns datamart::DatamartDefinition:
'datamart' name=ID (description?='description' descriptionValue=TRANSLATABLESTRING)?
('for' '{' (roles+=DatamartRole)* '}')?
'using' source=DatamartSource;
DatamartRole returns datamart::DatamartRole:
'role' assignedRole=[authorization::Role];
DatamartSource returns datamart::DatamartSource:
DatamartCube | DatamartEntity | DatamartTask;
DatamartTask returns datamart::DatamartTask:
'task' taskQuery=TaskQueryTopicEnum
('columns' '{' columns+=DatamartColumn* '}')?
('conditions' '{' conditions+=DatamartCondition* '}')? ;
DatamartColumn returns datamart::DatamartColumn:
'column' columnRef=TaskQueryColumnEnum;
DatamartTaskFilter returns datamart::DatamartTaskFilter:
'filter' filterRef=TaskFilterEnum;
DatamartCube returns datamart::DatamartCube:
'cube' cubeRef=[cube::CubeType] (nonEmpty?='nonempty')?
'{' axisslicer+=DatamartCubeElement* '}';
DatamartReference returns datamart::DatamartReference:
'join' ref=[entity::LEntityReference];
//DotExpression returns datamart::Ref:
// EntityRef ({datamart::DotExpression.ref=current} "."
// tail=[entity::LEntityReference]
// )*;
//
//EntityRef returns datamart::Ref:
// {datamart::EntityRef} entity=[entity::LEntity];
DatamartEntity returns datamart::DatamartEntity:
'entity' entityRef=[entity::LEntity] (tracking?='tracking')? ('{'
('navigation' '{' navigations+=DatamartNavigation* '}')?
('attributes' '{' attributes+=DatamartAttribute* '}')?
('conditions' '{' conditions+=DatamartCondition* '}')?
('ordering' '{' ordering+=DatamartOrder* '}')?
('fillerRows' fillerMinCountRows=INT 'to' fillerMaxCountRows=INT '{' fillerDatas+=AttributeFillerData* '}')?
'}')?;
DatamartNavigation returns datamart::DatamartNavigation:
DatamartOwner | DatamartMember;
DatamartOwner returns datamart::DatamartOwner:
'many2one' joinRef=DatamartReference 'to' datamartEntity=DatamartEntity;
DatamartMember returns datamart::DatamartMember:
'one2many' joinRef=DatamartReference 'to' datamartEntity=DatamartEntity;
DatamartAxis returns datamart::DatamartAxis:
'axis' name=AxisEnum;
DatamartAttributeBase returns datamart::DatamartAttributeBase:
'attribute' attributeRef=[entity::LEntityAttribute];
DatamartAttribute returns datamart::DatamartAttribute:
'attribute' attributeRef=[entity::LEntityAttribute] (aliased?='alias' aliasName=TRANSLATABLEID)? axis=DatamartAxis (hasColumnWeight?='columnWeight' columnWeight=INT)?
((aggregated?='aggregate' aggregate=SqlAggregationEnum)? & (scaled?='scale' scale=ValueScaleEnum)?);
DatamartCondition returns datamart::DatamartCondition:
'condition' condition=DatamartDisjunction;
DatamartOrder returns datamart::DatamartOrder:
'order' orderBy=[entity::LEntityAttribute] orderHow=OrderEnum (hasColumnWeight?='columnWeight' columnWeight=INT)?;
DatamartDisjunction returns datamart::Expression:
DatamartConjunction (({datamart::Disjunction.left=current} 'or') right=DatamartConjunction)*;
DatamartConjunction returns datamart::Expression:
DatamartConditionalExpression (({datamart::Conjunction.left=current} 'and') right=DatamartConditionalExpression)*;
DatamartConditionalExpression returns datamart::Expression:
DatamartOperand (({datamart::ConditionalExpression.left=current} operator=OperatorEnum) right=DatamartOperand)*;
DatamartOperand returns datamart::Expression:
DatamartValue | '(' DatamartDisjunction ')';
DatamartValue returns datamart::Expression:
numberValue=Number|stringValue=STRING|((filtered?='filtered' (optional?='optional')?) | selected?='selected' | ranged?='ranged')|DatamartTaskFilter|DatamartColumn|DatamartAttributeBase;
DatamartCubeElement returns datamart::DatamartCubeElement:
DatamartCubeAxis|DatamartSlicer|DatamartDefineDerivedMeasure;
DatamartDefineDerivedMeasure returns datamart::DatamartDefineDerivedMeasure:
'derive' name=TRANSLATABLEID 'from' derivedElement+=DatamartAddition*;
DatamartAddition returns datamart::Expression:
DatamartMultiplication (({datamart::Addition.left=current} '+'| {datamart::Subtraction.left=current} '-') right=DatamartMultiplication)*;
DatamartMultiplication returns datamart::Expression:
DatamartPrimary (({datamart::Multiplication.left=current} '*' | {datamart::Division.left=current} '/') right=DatamartPrimary)*;
DatamartPrimary returns datamart::Expression:
DatamartNumberOrElement | '(' DatamartAddition ')';
DatamartNumberOrElement returns datamart::Expression:
value=Number | DatamartMeasure | DatamartDerivedMeasure | DatamartMemberTuple | DatamartAggregation;
DatamartMemberTuple returns datamart::Expression:
((function=DatamartFunction | function = DatamartParameterFunction) 'of')? hierarchy=DatamartHierarchy ({datamart::DatamartMemberTuple.left = current} 'over' right=DatamartMeasure);
DatamartFunction returns datamart::DatamartFunction:
function=FunctionEnum;
DatamartParameterFunction returns datamart::DatamartParameterFunction:
function=ParameterFunctionEnum '(' parameter=DatamartFunctionIntParameter ')';
DatamartFunctionIntParameter returns datamart::DatamartFunctionIntParameter:
value=INT;
DatamartSetFunction returns datamart::DatamartSetFunction:
setFunction=SetFunctionEnum;
DatamartSetParameterFunction returns datamart::DatamartSetParameterFunction:
setFunction=SetParameterFunctionEnum '(' parameter=DatamartFunctionIntParameter ')';
DatamartSetAggregationFunction returns datamart::DatamartSetAggregationFunction:
aggregation=SetAggregationEnum '(' parameter=DatamartFunctionIntParameter ')';
DatamartSetTuple returns datamart::Expression:
(setFunction = DatamartSetFunction | setFunction = DatamartSetParameterFunction) ({datamart::DatamartSetTuple.left = current} 'of' right=DatamartHierarchy);
DatamartAggregationFunction returns datamart::DatamartAggregationFunction:
aggregation=AggregationEnum;
DatamartAggregation returns datamart::Expression:
aggregation=DatamartAggregationFunction 'of' (set=DatamartSetTuple | set=DatamartHierarchy) ({datamart::DatamartAggregation.left = current} 'over' right=DatamartMeasure);
DatamartSetAggregation returns datamart::Expression:
aggregation=DatamartSetAggregationFunction 'of' (set=DatamartSetTuple | set=DatamartHierarchy) ({datamart::DatamartSetAggregation.left = current} 'over' right=DatamartMeasure);
DatamartSlicer returns datamart::DatamartSlicer:
'slicer' element=DatamartElement;
DatamartCubeAxis returns datamart::DatamartCubeAxis:
{datamart::DatamartCubeAxis} axis=DatamartAxis '{' elements+=DatamartElement* '}';
DatamartElement returns datamart::DatamartElement:
DatamartHierarchy|DatamartMeasure|DatamartDerivedMeasure|DatamartSetAggregation;
DatamartDerivedMeasure returns datamart::DatamartDerivedMeasure:
'derived' derivedRef=[datamart::DatamartDefineDerivedMeasure] (scaled?='scale' scale=ValueScaleEnum)?;
DatamartMeasure returns datamart::DatamartMeasure:
'measure' measureRef=[cube::CubeMeasure] (scaled?='scale' scale=ValueScaleEnum)?;
DatamartHierarchy returns datamart::DatamartHierarchy:
'hierarchy' hierarchyRef=[cube::CubeHierarchy] (defaultMember?='default')? (allMember?='condensed')? (allLevels?='exploded')? ('level' levelRef=[cube::CubeLevel] (filtered?='filtered'| selected?='selected')?)? (all?='detailed' (except?='except' exceptRef=[cube::CubeLevel])? (ordered?='orderby' orderRef=(DatamartMeasure|DatamartDerivedMeasure) (descending?='descending')?)?)?;
TRANSLATABLESTRING:
STRING;
TRANSLATABLEID:
ID;
enum AxisEnum returns datamart::AxisEnum:
DEFAULT='default' | COLUMNS='columns' | ROWS='rows' | PAGES='pages' | SECTIONS='sections' | CHAPTERS='chapters' /* | AXIS(<index>)*/;
enum FunctionEnum returns datamart::FunctionEnum:
PREVMEMBER='previous' | NEXTMEMBER='next' | FIRSTCHILD='first' | LASTCHILD='last';
enum ParameterFunctionEnum returns datamart::ParameterFunctionEnum:
LAG='lag' | LEAD='lead';
enum SetFunctionEnum returns datamart::SetFunctionEnum:
YTD='year-to-date' | PERIODSTODATE='periods' /*| ALLMEMBERS='all' | ASCENDANTS='ascendants'*/;
enum SetParameterFunctionEnum returns datamart::SetParameterFunctionEnum:
TAIL='tail' | HEAD='head';
enum SetAggregationEnum returns datamart::SetAggregationEnum:
TOPCOUNT='topcount' | TOPSUM='topsummation' | TOPPERCENT='toppercentage' | BOTTOMCOUNT='bottomcount' | BOTTOMSUM='bottomsummation' | BOTTOMPERCENT='bottompercentage';
enum AggregationEnum returns datamart::AggregationEnum:
AVG='average' | SUM='summation' | AGGREGATE='aggregate' | STDDEV='deviation';
enum OperatorEnum returns datamart::OperatorEnum:
EQUALS='=' | LESS='<' | GREATER=">" | LESSEQUAL='<=' | GREATEREQUAL='>=' | LIKE='like';
enum SqlAggregationEnum returns datamart::SqlAggregationEnum:
AVG='average' | SUM='summation' | COUNT='count';
enum ValueScaleEnum returns datamart::ValueScaleEnum:
AXIS='group1' | AXIS2='group2' | AXIS3='group3' | AXIS4='group4' | AXIS5='group5' | AXIS6='group6' | AXIS7='group7' | AXIS8='group8' | AXIS9='group9';
enum TaskQueryTopicEnum returns datamart::TaskQueryTopicEnum:
Q1='BusinessAdministrator' | Q2='PotentialOwner' | Q3='Recipient' | Q4='TaskInitiator' | Q5='TaskStakeholder' | Q6='ExcludedOwner';
enum TaskQueryColumnEnum returns datamart::TaskQueryColumnEnum:
P1='Name' | P2='Priority' | P3='Status' | P4='Subject' | P5='Description' | P6='ExpirationTime' | P7='CreatedOn' | P8='CreatedBy' | P9='ActivationTime' |
P10='ActualOwner' | P11='TaskId' | P12 = 'ProcessId' | P13='ProcessInstanceId' | P14='ProcessSessionId';
enum TaskFilterEnum returns datamart::TaskFilterEnum:
F1='Groups' | F2='Users';
enum OrderEnum returns datamart::OrderEnum:
ASC='ascending' | DESC='descending';
AttributeFillerData returns datamart::AttributeFillerData:
'fill' attributeRef=[entity::LEntityAttribute] 'with' fillerType=AttributeFillerType;
AttributeFillerType returns datamart::AttributeFillerType:
AttributeFillerDateFuture | AttributeFillerDatePast
| AttributeFillerDateRange
| AttributeFillerSignedDoubleRange | AttributeFillerSignedDoubleRandom
| AttributeFillerSignedIntegerRange | AttributeFillerSignedIntegerRandom
| AttributeFillerTextRandom
| AttributeFillerTextParagraphs | AttributeFillerTextSentences | AttributeFillerTextWords
| AttributeFillerUnsignedDoubleRange | AttributeFillerUnsignedDoubleRandom
| AttributeFillerUnsignedIntegerRange | AttributeFillerUnsignedIntegerRandom
;
AttributeFillerDateFuture returns datamart::AttributeFillerDateFuture:
'filler-date-future' dateFutureYears=INT 'years';
AttributeFillerDatePast returns datamart::AttributeFillerDatePast:
'filler-date-past' datePastYears=INT 'years';
AttributeFillerDateRange returns datamart::AttributeFillerDateRange:
'filler-date-range' dateBeginYears=SINT 'upToIncluding' dateEndYears=SINT 'years';
AttributeFillerSignedDoubleRange returns datamart::AttributeFillerSignedDoubleRange:
'filler-signed-double-range'
((beginRange=SignedNumber | beginRangeRef=[entity::LEntityAttribute])? 'upToIncluding' (endRange=SignedNumber|endRangeRef=[entity::LEntityAttribute]))?
'with' decimals=INT 'decimals'
('rounded' rounded=UnsignedNumber)?;
AttributeFillerSignedDoubleRandom returns datamart::AttributeFillerSignedDoubleRandom:
'filler-signed-double-random' '(' (items+=SignedNumber)+ ')';
AttributeFillerSignedIntegerRange returns datamart::AttributeFillerSignedIntegerRange:
{datamart::AttributeFillerSignedIntegerRange} 'filler-signed-integer-range'
((beginRange=SINT | beginRangeRef=[entity::LEntityAttribute])? 'upToIncluding' (endRange=SINT|endRangeRef=[entity::LEntityAttribute]))?
('rounded' rounded=INT)?;
AttributeFillerSignedIntegerRandom returns datamart::AttributeFillerSignedIntegerRandom:
'filler-signed-integer-random' '(' (items+=SINT)+ ')';
AttributeFillerTextRandom returns datamart::AttributeFillerTextRandom:
'filler-text-random' '(' (items+=STRING)+ ')';
AttributeFillerTextParagraphs returns datamart::AttributeFillerTextParagraphs:
{datamart::AttributeFillerTextParagraphs} 'filler-text-paragraphs' (count=INT)?;
AttributeFillerTextSentences returns datamart::AttributeFillerTextSentences:
{datamart::AttributeFillerTextSentences} 'filler-text-sentences' (count=INT)?;
AttributeFillerTextWords returns datamart::AttributeFillerTextWords:
{datamart::AttributeFillerTextWords} 'filler-text-words' (count=INT)?;
AttributeFillerUnsignedDoubleRange returns datamart::AttributeFillerUnsignedDoubleRange:
'filler-unsigned-double-range'
((beginRange=UnsignedNumber | beginRangeRef=[entity::LEntityAttribute])? 'upToIncluding' (endRange=UnsignedNumber|endRangeRef=[entity::LEntityAttribute]))?
'with' decimals=INT 'decimals'
('rounded' rounded=UnsignedNumber)?;
AttributeFillerUnsignedDoubleRandom returns datamart::AttributeFillerUnsignedDoubleRandom:
'filler-unsigned-double-random' '(' (items+=UnsignedNumber)+ ')';
AttributeFillerUnsignedIntegerRange returns datamart::AttributeFillerUnsignedIntegerRange:
{datamart::AttributeFillerUnsignedIntegerRange} 'filler-unsigned-integer-range'
((beginRange=INT | beginRangeRef=[entity::LEntityAttribute])? 'upToIncluding' (endRange=INT|endRangeRef=[entity::LEntityAttribute]))?
('rounded' rounded=INT)?;
AttributeFillerUnsignedIntegerRandom returns datamart::AttributeFillerUnsignedIntegerRandom:
'filler-unsigned-integer-random' '(' (items+=INT)+ ')';
SignedNumber returns ecore::EDouble:
('-')? UnsignedNumber;
UnsignedNumber returns ecore::EDouble:
INT ('.' (INT))?;
SINT returns ecore::EInt:
('-')? INT;