| grammar org.eclipse.osee.framework.core.dsl.OseeDsl with org.eclipse.xtext.common.Terminals |
| |
| generate oseeDsl "http://www.eclipse.org/osee/framework/core/dsl/OseeDsl" |
| |
| OseeDsl: |
| (imports+=Import)* |
| (artifactTypes+=XArtifactType | relationTypes+=XRelationType | attributeTypes+=XAttributeType | |
| enumTypes+=XOseeEnumType | enumOverrides+=XOseeEnumOverride)* |
| (artifactMatchRefs+=XArtifactMatcher | |
| accessDeclarations+=AccessContext | roleDeclarations+=Role)*; |
| |
| Import: |
| 'import' importURI=STRING; |
| |
| terminal STRING: |
| '"' ('\\' ('"') | !('"'))* '"' | "'" ('\\' ("'") | !("'"))* "'"; |
| |
| terminal WHOLE_NUM_STR: |
| ('0'..'9')+; |
| |
| terminal HEX_INT: |
| '0x' ('A'..'F' | '0'..'9')+; |
| |
| QUALIFIED_NAME: |
| ID ('.' ID)*; |
| |
| /////////////////////////////////////// |
| // OSEE TYPE MODEL // |
| /////////////////////////////////////// |
| OseeElement: |
| XOseeEnumOverride | OseeType; |
| |
| OseeType: |
| XArtifactType | XRelationType | XAttributeType | XOseeEnumType; |
| |
| XArtifactType: |
| (abstract?='abstract')? 'artifactType' name=STRING ('extends' |
| superArtifactTypes+=[XArtifactType|STRING] (',' |
| superArtifactTypes+=[XArtifactType|STRING])*)? '{' ('guid' typeGuid=STRING)? |
| 'uuid' uuid=HEX_INT |
| (validAttributeTypes+=XAttributeTypeRef)* '}'; |
| |
| XAttributeTypeRef: |
| 'attribute' validAttributeType=[XAttributeType|STRING] ('branchGuid' branchGuid=STRING)?; |
| |
| XAttributeType: |
| 'attributeType' name=STRING ('extends' baseAttributeType=AttributeBaseType) ('overrides' |
| override=[XAttributeType|STRING])? '{' ('guid' typeGuid=STRING)? 'uuid' uuid=HEX_INT 'dataProvider' |
| dataProvider=('DefaultAttributeDataProvider' | 'UriAttributeDataProvider' | QUALIFIED_NAME) 'min' min=WHOLE_NUM_STR |
| 'max' max=(WHOLE_NUM_STR | 'unlimited') ('taggerId' taggerId=('DefaultAttributeTaggerProvider' | QUALIFIED_NAME))? |
| ('enumType' enumType=[XOseeEnumType|STRING])? ('description' description=STRING)? ('defaultValue' |
| defaultValue=STRING)? ('fileExtension' fileExtension=STRING)? '}'; |
| |
| AttributeBaseType: |
| 'BooleanAttribute' | 'CompressedContentAttribute' | 'DateAttribute' | 'EnumeratedAttribute' | |
| 'FloatingPointAttribute' | 'IntegerAttribute' | 'JavaObjectAttribute' | 'StringAttribute' | |
| 'ArtifactReferenceAttribute' | 'BranchReferenceAttribute' | 'WordAttribute' | 'OutlineNumberAttribute' | |
| QUALIFIED_NAME; |
| |
| XOseeEnumType: |
| 'oseeEnumType' name=STRING '{' ('guid' typeGuid=STRING)? 'uuid' uuid=HEX_INT (enumEntries+=XOseeEnumEntry)* '}'; |
| |
| XOseeEnumEntry: |
| 'entry' name=STRING (ordinal=WHOLE_NUM_STR)? ('entryGuid' entryGuid=STRING)?; |
| |
| XOseeEnumOverride: |
| 'overrides enum' overridenEnumType=[XOseeEnumType|STRING] '{' (inheritAll?='inheritAll')? |
| (overrideOptions+=OverrideOption)* '}'; |
| |
| OverrideOption: |
| AddEnum | RemoveEnum; |
| |
| AddEnum: |
| 'add' enumEntry=STRING (ordinal=WHOLE_NUM_STR)? ('entryGuid' entryGuid=STRING)?; |
| |
| RemoveEnum: |
| 'remove' enumEntry=[XOseeEnumEntry|STRING]; |
| |
| XRelationType: |
| 'relationType' name=STRING '{' ('guid' typeGuid=STRING)? 'uuid' uuid=HEX_INT |
| 'sideAName' sideAName=STRING 'sideAArtifactType' sideAArtifactType=[XArtifactType|STRING] |
| 'sideBName' sideBName=STRING 'sideBArtifactType' sideBArtifactType=[XArtifactType|STRING] |
| 'defaultOrderType' defaultOrderType=RelationOrderType 'multiplicity' multiplicity=RelationMultiplicityEnum '}'; |
| |
| enum RelationMultiplicityEnum: |
| ONE_TO_ONE | ONE_TO_MANY | MANY_TO_ONE | MANY_TO_MANY; |
| |
| RelationOrderType: |
| 'Lexicographical_Ascending' | 'Lexicographical_Descending' | 'Unordered' | ID; |
| |
| /////////////////////////////////////// |
| // OSEE MATCH RULES // |
| /////////////////////////////////////// |
| enum CompareOp: |
| EQ | LIKE; |
| |
| enum XLogicOperator: |
| AND | OR; |
| |
| CONDITION_VALUE: |
| WHOLE_NUM_STR | STRING; |
| |
| enum MatchField: |
| artifactName | artifactGuid | branchName | branchGuid; |
| |
| Condition: |
| SimpleCondition | CompoundCondition; |
| |
| SimpleCondition: |
| field=MatchField op=CompareOp expression=STRING; |
| |
| CompoundCondition: |
| '(' conditions+=SimpleCondition (operators+=XLogicOperator conditions+=SimpleCondition)+ ')'; |
| |
| XArtifactMatcher: |
| 'artifactMatcher' name=STRING 'where' |
| conditions+=Condition (operators+=XLogicOperator conditions+=Condition)* ';'; |
| |
| /////////////////////////////////////// |
| // OSEE ACCESS MODEL // |
| /////////////////////////////////////// |
| Role: |
| 'role' name=STRING ('extends' superRoles+=[Role|STRING])? '{' |
| (usersAndGroups+=UsersAndGroups | referencedContexts+=ReferencedContext)+ '}'; |
| |
| ReferencedContext: |
| 'accessContext' accessContextRef=STRING ';'; |
| |
| UsersAndGroups: |
| 'guid' userOrGroupGuid=STRING ';'; |
| |
| AccessContext: |
| 'accessContext' name=STRING ('extends' |
| superAccessContexts+=[AccessContext|STRING])? '{' 'guid' guid=STRING ';' |
| (accessRules+=ObjectRestriction | hierarchyRestrictions+=HierarchyRestriction)+ '}'; |
| |
| HierarchyRestriction: |
| 'childrenOf' artifactMatcherRef=[XArtifactMatcher|STRING] '{' (accessRules+=ObjectRestriction)+ |
| '}'; |
| |
| enum AccessPermissionEnum: |
| ALLOW | DENY; |
| |
| RelationTypeArtifactTypePredicate: |
| 'artifactType' artifactTypeRef=[XArtifactType|STRING]; |
| |
| RelationTypeArtifactPredicate: |
| 'artifact' artifactMatcherRef=[XArtifactMatcher|STRING]; |
| |
| RelationTypePredicate: |
| RelationTypeArtifactPredicate | RelationTypeArtifactTypePredicate; |
| |
| ObjectRestriction: |
| ArtifactMatchRestriction | ArtifactTypeRestriction | RelationTypeRestriction | AttributeTypeRestriction; |
| |
| ArtifactMatchRestriction: |
| permission=AccessPermissionEnum 'edit' 'artifact' artifactMatcherRef=[XArtifactMatcher|STRING] |
| ';'; |
| |
| ArtifactTypeRestriction: |
| permission=AccessPermissionEnum 'edit' 'artifactType' artifactTypeRef=[XArtifactType|STRING] ';'; |
| |
| AttributeTypeRestriction: |
| permission=AccessPermissionEnum 'edit' 'attributeType' attributeTypeRef=[XAttributeType|STRING] |
| ('of' 'artifactType' artifactTypeRef=[XArtifactType|STRING])? ';'; |
| |
| LegacyRelationTypeRestriction: |
| permission=AccessPermissionEnum 'edit' 'relationType' relationTypeRef=[XRelationType|STRING] |
| restrictedToSide=XRelationSideEnum ('artifact' artifactMatcherRef=[XArtifactMatcher|STRING])? ';'; |
| |
| RelationTypeRestriction: |
| permission=AccessPermissionEnum 'edit' 'relationType' (relationTypeMatch?=RelationTypeMatch | |
| relationTypeRef=[XRelationType|STRING]) |
| restrictedToSide=XRelationSideEnum (predicate=RelationTypePredicate)? ';'; |
| |
| enum RelationTypeMatch: |
| ALL; |
| |
| enum XRelationSideEnum: |
| SIDE_A | SIDE_B | BOTH; |
| |