| grammar org.eclipse.osbp.xtext.functionlibrarydsl.FunctionLibraryDsl with org.eclipse.osbp.xtext.oxtype.OXtype |
| |
| import "http://osbp.eclipse.org/xtext/functionlibrarydsl/FunctionLibraryDSL" |
| import "http://osbp.eclipse.org/dsl/common/types/v1" |
| import "http://www.eclipse.org/emf/2002/Ecore" as ecore |
| import "http://www.eclipse.org/xtext/xbase/Xbase" as xbase |
| |
| FunctionLibraryModel: |
| importSection=XImportSection? |
| pckg=FunctionLibraryPackage; |
| |
| FunctionLibraryPackage: |
| {FunctionLibraryPackage} |
| 'package' name=QualifiedName '{' |
| (groups+=(FunctionLibraryGroup|FunctionLibraryBlipGroup|FunctionLibraryConverterGroup|FunctionLibraryStatemachineGroup|FunctionLibraryActionGroup)|ratings+=FunctionLibraryRating)* |
| '}'; |
| |
| FunctionLibraryGroup: |
| 'group' name=ValidID '{' |
| (functions+=FunctionLibraryFunction|tests+=FunctionLibraryTest|rates+=FunctionLibraryRate)* |
| '}'; |
| |
| FunctionLibraryBlipGroup: |
| 'blip-group' name=ValidID '{' |
| (functions+=FunctionLibraryFunction|tests+=FunctionLibraryTest|rates+=FunctionLibraryRate)* |
| '}'; |
| |
| FunctionLibraryStatemachineGroup: |
| 'statemachine' name=ValidID '{' |
| (operations+=FunctionLibraryOperation|guards+=FunctionLibraryGuard|functions+=FunctionLibraryFunction)* |
| '}'; |
| |
| FunctionLibraryActionGroup: |
| 'action' name=ValidID '{' |
| (executes+=FunctionLibraryExecute|canExecutes+=FunctionLibraryCanExecute)* |
| '}'; |
| |
| FunctionLibraryConverterGroup: |
| 'converter' name=ValidID '{' |
| 'model-datatype' convertToModelDatatype=[LDataType|TYPE_CROSS_REFERENCE] |
| 'presentation-datatype' convertToPresentationDatatype=[LDataType|TYPE_CROSS_REFERENCE] |
| convertToModel=FunctionConvertToModel |
| convertToPresentation=FunctionConvertToPresentation |
| '}'; |
| |
| FunctionConvertToModel: |
| 'to-model' body=XBlockExpression; |
| |
| FunctionConvertToPresentation: |
| 'to-presentation' body=XBlockExpression; |
| |
| FunctionLibraryRating: |
| {FunctionLibraryRating} 'rating' name=ValidID '{' (items+=FunctionLibraryRatingItem)* '}'; |
| |
| FunctionLibraryRatingItem: |
| name=ValidID; |
| |
| FunctionLibraryFunction: |
| 'function' name=ValidID '(' |
| (params+=FunctionLibraryParameter (',' params+=FunctionLibraryParameter)* )? |
| ')' |
| 'returns' oftype=JvmParameterizedTypeReference |
| body=XBlockExpression; |
| |
| FunctionLibraryTest: |
| 'test' name=ValidID '(' |
| (params+=FunctionLibraryParameter (',' params+=FunctionLibraryParameter)* )? |
| ')' |
| body=XBlockExpression; |
| |
| FunctionLibraryRate: |
| 'rate' name=ValidID '(' |
| (params+=FunctionLibraryParameter (',' params+=FunctionLibraryParameter)* )? |
| ')' |
| 'returns' oftype=[FunctionLibraryRating] |
| body=XBlockExpression; |
| |
| FunctionLibraryGuard: |
| 'guard' name=ValidID '(' |
| (params+=FunctionLibraryParameter (',' params+=FunctionLibraryParameter)* )? |
| ')' |
| body=XBlockExpression; |
| |
| FunctionLibraryOperation: |
| 'operation' name=ValidID '(' |
| (params+=FunctionLibraryParameter (',' params+=FunctionLibraryParameter)* )? |
| ')' |
| body=XBlockExpression; |
| |
| FunctionLibraryExecute: |
| 'execute' name=ValidID '(' |
| (params+=FunctionLibraryParameter (',' params+=FunctionLibraryParameter)* )? |
| ')' |
| body=XBlockExpression; |
| |
| FunctionLibraryCanExecute: |
| 'canExecute' name=ValidID '(' |
| (params+=FunctionLibraryParameter (',' params+=FunctionLibraryParameter)* )? |
| ')' |
| body=XBlockExpression; |
| |
| FunctionLibraryParameter: |
| parameterType=JvmTypeReference name=ValidID; |
| |
| TYPE_CROSS_REFERENCE: |
| ID; |