Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions kerml/src/examples/Simple Tests/FeatureChains.kerml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ package FeatureChains {
feature h2 differences b.f, b.a intersects f.a, g disjoint from h1;

feature b_f_a chains b chains f.a;

feature x conjugates f.a;
}
3 changes: 2 additions & 1 deletion kerml/src/examples/Simple Tests/MetadataTest.kerml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ package MetadataTest {
metadata Classified {
classificationLevel = conf;
}
metadata : Security;
}

feature y {
@Classified {
classificationLevel = conf;
}
@Security;
@ : Security;
}

private #Classified #Security feature z1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,6 @@ package P {
feature h2 differences b.f, b.a intersects f.a, g disjoint from h1;

feature b_f_a chains b chains f.a;

feature x conjugates f.a;
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@ package Metadata {
metaclass C;

feature x {
metaclass A {
metadata A {
f = null;
}
metadata : B;
}

feature y {
@A { f = null; }
@B;
@ : B;
}

private #A #B feature z1;
Expand Down
Binary file modified org.omg.kerml.xtext/src-gen/org/omg/kerml/xtext/KerML.xtextbin
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7196,18 +7196,40 @@ ruleFeatureConjugation returns [EObject current=null]
}:
(
(
{
if ($current==null) {
$current = createModelElement(grammarAccess.getFeatureConjugationRule());
(
{
if ($current==null) {
$current = createModelElement(grammarAccess.getFeatureConjugationRule());
}
}
}
{
newCompositeNode(grammarAccess.getFeatureConjugationAccess().getOriginalTypeFeatureCrossReference_0());
}
ruleQualifiedName
{
afterParserOrEnumRuleCall();
}
{
newCompositeNode(grammarAccess.getFeatureConjugationAccess().getOriginalTypeFeatureCrossReference_0_0());
}
ruleQualifiedName
{
afterParserOrEnumRuleCall();
}
)
)
|
(
(
{
newCompositeNode(grammarAccess.getFeatureConjugationAccess().getOwnedRelatedElementOwnedFeatureChainParserRuleCall_1_0());
}
lv_ownedRelatedElement_1_0=ruleOwnedFeatureChain
{
if ($current==null) {
$current = createModelElementForParent(grammarAccess.getFeatureConjugationRule());
}
add(
$current,
"ownedRelatedElement",
lv_ownedRelatedElement_1_0,
"org.omg.kerml.expressions.xtext.KerMLExpressions.OwnedFeatureChain");
afterParserOrEnumRuleCall();
}
)
)
)
;
Expand Down Expand Up @@ -10897,17 +10919,19 @@ ruleMetadataFeatureDeclaration[EObject in_current] returns [EObject current=in_
}:
(
(
{
if ($current==null) {
$current = createModelElement(grammarAccess.getMetadataFeatureDeclarationRule());
(
{
if ($current==null) {
$current = createModelElement(grammarAccess.getMetadataFeatureDeclarationRule());
}
newCompositeNode(grammarAccess.getMetadataFeatureDeclarationAccess().getIdentificationParserRuleCall_0_0());
}
newCompositeNode(grammarAccess.getMetadataFeatureDeclarationAccess().getIdentificationParserRuleCall_0_0());
}
this_Identification_0=ruleIdentification[$current]
{
$current = $this_Identification_0.current;
afterParserOrEnumRuleCall();
}
this_Identification_0=ruleIdentification[$current]
{
$current = $this_Identification_0.current;
afterParserOrEnumRuleCall();
}
)?
(
otherlv_1=':'
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3227,11 +3227,11 @@ public final void mRULE_DECIMAL_VALUE() throws RecognitionException {
try {
int _type = RULE_DECIMAL_VALUE;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalKerML.g:16273:20: ( '0' .. '9' ( '0' .. '9' )* )
// InternalKerML.g:16273:22: '0' .. '9' ( '0' .. '9' )*
// InternalKerML.g:16297:20: ( '0' .. '9' ( '0' .. '9' )* )
// InternalKerML.g:16297:22: '0' .. '9' ( '0' .. '9' )*
{
matchRange('0','9');
// InternalKerML.g:16273:31: ( '0' .. '9' )*
// InternalKerML.g:16297:31: ( '0' .. '9' )*
loop1:
do {
int alt1=2;
Expand All @@ -3244,7 +3244,7 @@ public final void mRULE_DECIMAL_VALUE() throws RecognitionException {

switch (alt1) {
case 1 :
// InternalKerML.g:16273:32: '0' .. '9'
// InternalKerML.g:16297:32: '0' .. '9'
{
matchRange('0','9');

Expand Down Expand Up @@ -3272,8 +3272,8 @@ public final void mRULE_EXP_VALUE() throws RecognitionException {
try {
int _type = RULE_EXP_VALUE;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalKerML.g:16275:16: ( RULE_DECIMAL_VALUE ( 'e' | 'E' ) ( '+' | '-' )? RULE_DECIMAL_VALUE )
// InternalKerML.g:16275:18: RULE_DECIMAL_VALUE ( 'e' | 'E' ) ( '+' | '-' )? RULE_DECIMAL_VALUE
// InternalKerML.g:16299:16: ( RULE_DECIMAL_VALUE ( 'e' | 'E' ) ( '+' | '-' )? RULE_DECIMAL_VALUE )
// InternalKerML.g:16299:18: RULE_DECIMAL_VALUE ( 'e' | 'E' ) ( '+' | '-' )? RULE_DECIMAL_VALUE
{
mRULE_DECIMAL_VALUE();
if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
Expand All @@ -3285,7 +3285,7 @@ public final void mRULE_EXP_VALUE() throws RecognitionException {
recover(mse);
throw mse;}

// InternalKerML.g:16275:47: ( '+' | '-' )?
// InternalKerML.g:16299:47: ( '+' | '-' )?
int alt2=2;
int LA2_0 = input.LA(1);

Expand Down Expand Up @@ -3328,8 +3328,8 @@ public final void mRULE_ID() throws RecognitionException {
try {
int _type = RULE_ID;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalKerML.g:16277:9: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* )
// InternalKerML.g:16277:11: ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
// InternalKerML.g:16301:9: ( ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* )
// InternalKerML.g:16301:11: ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
{
if ( (input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) {
input.consume();
Expand All @@ -3340,7 +3340,7 @@ public final void mRULE_ID() throws RecognitionException {
recover(mse);
throw mse;}

// InternalKerML.g:16277:35: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
// InternalKerML.g:16301:35: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )*
loop3:
do {
int alt3=2;
Expand Down Expand Up @@ -3389,11 +3389,11 @@ public final void mRULE_UNRESTRICTED_NAME() throws RecognitionException {
try {
int _type = RULE_UNRESTRICTED_NAME;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalKerML.g:16279:24: ( '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
// InternalKerML.g:16279:26: '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\''
// InternalKerML.g:16303:24: ( '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' )
// InternalKerML.g:16303:26: '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\''
{
match('\'');
// InternalKerML.g:16279:31: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )*
// InternalKerML.g:16303:31: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )*
loop4:
do {
int alt4=3;
Expand All @@ -3409,7 +3409,7 @@ else if ( ((LA4_0>='\u0000' && LA4_0<='&')||(LA4_0>='(' && LA4_0<='[')||(LA4_0>=

switch (alt4) {
case 1 :
// InternalKerML.g:16279:32: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\"' | '\\'' | '\\\\' )
// InternalKerML.g:16303:32: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\"' | '\\'' | '\\\\' )
{
match('\\');
if ( input.LA(1)=='\"'||input.LA(1)=='\''||input.LA(1)=='\\'||input.LA(1)=='b'||input.LA(1)=='f'||input.LA(1)=='n'||input.LA(1)=='r'||input.LA(1)=='t' ) {
Expand All @@ -3425,7 +3425,7 @@ else if ( ((LA4_0>='\u0000' && LA4_0<='&')||(LA4_0>='(' && LA4_0<='[')||(LA4_0>=
}
break;
case 2 :
// InternalKerML.g:16279:73: ~ ( ( '\\\\' | '\\'' ) )
// InternalKerML.g:16303:73: ~ ( ( '\\\\' | '\\'' ) )
{
if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
input.consume();
Expand Down Expand Up @@ -3462,11 +3462,11 @@ public final void mRULE_STRING_VALUE() throws RecognitionException {
try {
int _type = RULE_STRING_VALUE;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalKerML.g:16281:19: ( '\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\"' ) ) )* '\"' )
// InternalKerML.g:16281:21: '\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\"' ) ) )* '\"'
// InternalKerML.g:16305:19: ( '\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\"' ) ) )* '\"' )
// InternalKerML.g:16305:21: '\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\"' ) ) )* '\"'
{
match('\"');
// InternalKerML.g:16281:25: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\"' ) ) )*
// InternalKerML.g:16305:25: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\"' ) ) )*
loop5:
do {
int alt5=3;
Expand All @@ -3482,7 +3482,7 @@ else if ( ((LA5_0>='\u0000' && LA5_0<='!')||(LA5_0>='#' && LA5_0<='[')||(LA5_0>=

switch (alt5) {
case 1 :
// InternalKerML.g:16281:26: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\"' | '\\'' | '\\\\' )
// InternalKerML.g:16305:26: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | '\"' | '\\'' | '\\\\' )
{
match('\\');
if ( input.LA(1)=='\"'||input.LA(1)=='\''||input.LA(1)=='\\'||input.LA(1)=='b'||input.LA(1)=='f'||input.LA(1)=='n'||input.LA(1)=='r'||input.LA(1)=='t' ) {
Expand All @@ -3498,7 +3498,7 @@ else if ( ((LA5_0>='\u0000' && LA5_0<='!')||(LA5_0>='#' && LA5_0<='[')||(LA5_0>=
}
break;
case 2 :
// InternalKerML.g:16281:67: ~ ( ( '\\\\' | '\"' ) )
// InternalKerML.g:16305:67: ~ ( ( '\\\\' | '\"' ) )
{
if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) {
input.consume();
Expand Down Expand Up @@ -3535,12 +3535,12 @@ public final void mRULE_REGULAR_COMMENT() throws RecognitionException {
try {
int _type = RULE_REGULAR_COMMENT;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalKerML.g:16283:22: ( '/*' ( options {greedy=false; } : . )* '*/' )
// InternalKerML.g:16283:24: '/*' ( options {greedy=false; } : . )* '*/'
// InternalKerML.g:16307:22: ( '/*' ( options {greedy=false; } : . )* '*/' )
// InternalKerML.g:16307:24: '/*' ( options {greedy=false; } : . )* '*/'
{
match("/*");

// InternalKerML.g:16283:29: ( options {greedy=false; } : . )*
// InternalKerML.g:16307:29: ( options {greedy=false; } : . )*
loop6:
do {
int alt6=2;
Expand All @@ -3565,7 +3565,7 @@ else if ( ((LA6_0>='\u0000' && LA6_0<=')')||(LA6_0>='+' && LA6_0<='\uFFFF')) ) {

switch (alt6) {
case 1 :
// InternalKerML.g:16283:57: .
// InternalKerML.g:16307:57: .
{
matchAny();

Expand Down Expand Up @@ -3595,12 +3595,12 @@ public final void mRULE_ML_NOTE() throws RecognitionException {
try {
int _type = RULE_ML_NOTE;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalKerML.g:16285:14: ( '//*' ( options {greedy=false; } : . )* '*/' )
// InternalKerML.g:16285:16: '//*' ( options {greedy=false; } : . )* '*/'
// InternalKerML.g:16309:14: ( '//*' ( options {greedy=false; } : . )* '*/' )
// InternalKerML.g:16309:16: '//*' ( options {greedy=false; } : . )* '*/'
{
match("//*");

// InternalKerML.g:16285:22: ( options {greedy=false; } : . )*
// InternalKerML.g:16309:22: ( options {greedy=false; } : . )*
loop7:
do {
int alt7=2;
Expand All @@ -3625,7 +3625,7 @@ else if ( ((LA7_0>='\u0000' && LA7_0<=')')||(LA7_0>='+' && LA7_0<='\uFFFF')) ) {

switch (alt7) {
case 1 :
// InternalKerML.g:16285:50: .
// InternalKerML.g:16309:50: .
{
matchAny();

Expand Down Expand Up @@ -3655,12 +3655,12 @@ public final void mRULE_SL_NOTE() throws RecognitionException {
try {
int _type = RULE_SL_NOTE;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalKerML.g:16287:14: ( '//' (~ ( ( '\\n' | '\\r' ) ) (~ ( ( '\\n' | '\\r' ) ) )* )? ( ( '\\r' )? '\\n' )? )
// InternalKerML.g:16287:16: '//' (~ ( ( '\\n' | '\\r' ) ) (~ ( ( '\\n' | '\\r' ) ) )* )? ( ( '\\r' )? '\\n' )?
// InternalKerML.g:16311:14: ( '//' (~ ( ( '\\n' | '\\r' ) ) (~ ( ( '\\n' | '\\r' ) ) )* )? ( ( '\\r' )? '\\n' )? )
// InternalKerML.g:16311:16: '//' (~ ( ( '\\n' | '\\r' ) ) (~ ( ( '\\n' | '\\r' ) ) )* )? ( ( '\\r' )? '\\n' )?
{
match("//");

// InternalKerML.g:16287:21: (~ ( ( '\\n' | '\\r' ) ) (~ ( ( '\\n' | '\\r' ) ) )* )?
// InternalKerML.g:16311:21: (~ ( ( '\\n' | '\\r' ) ) (~ ( ( '\\n' | '\\r' ) ) )* )?
int alt9=2;
int LA9_0 = input.LA(1);

Expand All @@ -3669,7 +3669,7 @@ public final void mRULE_SL_NOTE() throws RecognitionException {
}
switch (alt9) {
case 1 :
// InternalKerML.g:16287:22: ~ ( ( '\\n' | '\\r' ) ) (~ ( ( '\\n' | '\\r' ) ) )*
// InternalKerML.g:16311:22: ~ ( ( '\\n' | '\\r' ) ) (~ ( ( '\\n' | '\\r' ) ) )*
{
if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) {
input.consume();
Expand All @@ -3680,7 +3680,7 @@ public final void mRULE_SL_NOTE() throws RecognitionException {
recover(mse);
throw mse;}

// InternalKerML.g:16287:37: (~ ( ( '\\n' | '\\r' ) ) )*
// InternalKerML.g:16311:37: (~ ( ( '\\n' | '\\r' ) ) )*
loop8:
do {
int alt8=2;
Expand All @@ -3693,7 +3693,7 @@ public final void mRULE_SL_NOTE() throws RecognitionException {

switch (alt8) {
case 1 :
// InternalKerML.g:16287:37: ~ ( ( '\\n' | '\\r' ) )
// InternalKerML.g:16311:37: ~ ( ( '\\n' | '\\r' ) )
{
if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) {
input.consume();
Expand All @@ -3719,7 +3719,7 @@ public final void mRULE_SL_NOTE() throws RecognitionException {

}

// InternalKerML.g:16287:55: ( ( '\\r' )? '\\n' )?
// InternalKerML.g:16311:55: ( ( '\\r' )? '\\n' )?
int alt11=2;
int LA11_0 = input.LA(1);

Expand All @@ -3728,9 +3728,9 @@ public final void mRULE_SL_NOTE() throws RecognitionException {
}
switch (alt11) {
case 1 :
// InternalKerML.g:16287:56: ( '\\r' )? '\\n'
// InternalKerML.g:16311:56: ( '\\r' )? '\\n'
{
// InternalKerML.g:16287:56: ( '\\r' )?
// InternalKerML.g:16311:56: ( '\\r' )?
int alt10=2;
int LA10_0 = input.LA(1);

Expand All @@ -3739,7 +3739,7 @@ public final void mRULE_SL_NOTE() throws RecognitionException {
}
switch (alt10) {
case 1 :
// InternalKerML.g:16287:56: '\\r'
// InternalKerML.g:16311:56: '\\r'
{
match('\r');

Expand Down Expand Up @@ -3771,10 +3771,10 @@ public final void mRULE_WS() throws RecognitionException {
try {
int _type = RULE_WS;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalKerML.g:16289:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
// InternalKerML.g:16289:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
// InternalKerML.g:16313:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ )
// InternalKerML.g:16313:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
{
// InternalKerML.g:16289:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
// InternalKerML.g:16313:11: ( ' ' | '\\t' | '\\r' | '\\n' )+
int cnt12=0;
loop12:
do {
Expand Down
Loading
Loading