mirror of
https://github.com/twiglet/cs2j.git
synced 2025-01-18 13:15:17 +01:00
unsupported: checed/unchecked/default
This commit is contained in:
parent
e55bbd562c
commit
9732e938bd
@ -332,9 +332,9 @@ primary_expression returns [int precedence]
|
|||||||
| object_creation_expression
|
| object_creation_expression
|
||||||
| anonymous_object_creation_expression) // new {int X, string Y}
|
| anonymous_object_creation_expression) // new {int X, string Y}
|
||||||
| sizeof_expression // sizeof (struct)
|
| sizeof_expression // sizeof (struct)
|
||||||
| checked_expression // checked (...
|
| checked_expression -> { $checked_expression.st } // checked (...
|
||||||
| unchecked_expression // unchecked {...}
|
| unchecked_expression -> { $unchecked_expression.st } // unchecked {...}
|
||||||
| default_value_expression // default
|
| default_value_expression -> { $default_value_expression.st } // default
|
||||||
| anonymous_method_expression // delegate (int foo) {}
|
| anonymous_method_expression // delegate (int foo) {}
|
||||||
;
|
;
|
||||||
// primary_expression:
|
// primary_expression:
|
||||||
@ -459,12 +459,39 @@ variable_initializer:
|
|||||||
expression -> { $expression.st } | array_initializer -> { $array_initializer.st };
|
expression -> { $expression.st } | array_initializer -> { $array_initializer.st };
|
||||||
sizeof_expression:
|
sizeof_expression:
|
||||||
^('sizeof' unmanaged_type );
|
^('sizeof' unmanaged_type );
|
||||||
checked_expression:
|
checked_expression
|
||||||
^('checked' expression ) ;
|
@init {
|
||||||
unchecked_expression:
|
StringTemplate someText = null;
|
||||||
^('unchecked' expression ) ;
|
}:
|
||||||
default_value_expression:
|
^('checked' expression )
|
||||||
^('default' type ) ;
|
{ someText = %op();
|
||||||
|
%{someText}.op = "checked";
|
||||||
|
%{someText}.post = $expression.st;
|
||||||
|
%{someText}.space = " ";
|
||||||
|
} -> unsupported(reason = {"checked expressions are not supported"}, text = { someText } )
|
||||||
|
;
|
||||||
|
unchecked_expression
|
||||||
|
@init {
|
||||||
|
StringTemplate someText = null;
|
||||||
|
}:
|
||||||
|
^('unchecked' expression )
|
||||||
|
{ someText = %op();
|
||||||
|
%{someText}.op = "unchecked";
|
||||||
|
%{someText}.post = $expression.st;
|
||||||
|
%{someText}.space = " ";
|
||||||
|
} -> unsupported(reason = {"unchecked expressions are not supported"}, text = { someText } )
|
||||||
|
;
|
||||||
|
default_value_expression
|
||||||
|
@init {
|
||||||
|
StringTemplate someText = null;
|
||||||
|
}:
|
||||||
|
^('default' type )
|
||||||
|
{ someText = %op();
|
||||||
|
%{someText}.op = "default";
|
||||||
|
%{someText}.post = $type.st;
|
||||||
|
%{someText}.space = " ";
|
||||||
|
} -> unsupported(reason = {"default expressions are not yet supported"}, text = { someText } )
|
||||||
|
;
|
||||||
anonymous_method_expression:
|
anonymous_method_expression:
|
||||||
^('delegate' explicit_anonymous_function_signature? block);
|
^('delegate' explicit_anonymous_function_signature? block);
|
||||||
explicit_anonymous_function_signature:
|
explicit_anonymous_function_signature:
|
||||||
@ -1180,8 +1207,8 @@ embedded_statement returns [bool isSemi, bool isBraces, bool isIf]
|
|||||||
| ^('try' { preComments = CollectedComments; } b=block catch_clauses? finally_clause?)
|
| ^('try' { preComments = CollectedComments; } b=block catch_clauses? finally_clause?)
|
||||||
-> try(comments = { preComments }, block = {$b.st}, blocksemi = {$b.isSemi}, blockbraces = { !$b.isSemi },
|
-> try(comments = { preComments }, block = {$b.st}, blocksemi = {$b.isSemi}, blockbraces = { !$b.isSemi },
|
||||||
catches = { $catch_clauses.st }, fin = { $finally_clause.st } )
|
catches = { $catch_clauses.st }, fin = { $finally_clause.st } )
|
||||||
| checked_statement
|
| checked_statement -> { $checked_statement.st }
|
||||||
| unchecked_statement
|
| unchecked_statement -> { $unchecked_statement.st }
|
||||||
| lock_statement -> { $lock_statement.st }
|
| lock_statement -> { $lock_statement.st }
|
||||||
| using_statement
|
| using_statement
|
||||||
| yield_statement
|
| yield_statement
|
||||||
@ -1282,10 +1309,28 @@ catch_clause:
|
|||||||
^('catch' type identifier block) -> catch_template(type = { $type.st }, id = { $identifier.st }, block = {$block.st}, blocksemi = { $block.isSemi }, blockbraces = { !$block.isSemi } );
|
^('catch' type identifier block) -> catch_template(type = { $type.st }, id = { $identifier.st }, block = {$block.st}, blocksemi = { $block.isSemi }, blockbraces = { !$block.isSemi } );
|
||||||
finally_clause:
|
finally_clause:
|
||||||
^('finally' block) -> fin(block = {$block.st}, blocksemi = { $block.isSemi }, blockbraces = { !$block.isSemi });
|
^('finally' block) -> fin(block = {$block.st}, blocksemi = { $block.isSemi }, blockbraces = { !$block.isSemi });
|
||||||
checked_statement:
|
checked_statement
|
||||||
'checked' block ;
|
@init {
|
||||||
unchecked_statement:
|
StringTemplate someText = null;
|
||||||
'unchecked' block ;
|
}:
|
||||||
|
'checked' block
|
||||||
|
{ someText = %keyword_block();
|
||||||
|
%{someText}.keyword = "checked";
|
||||||
|
%{someText}.block = $block.st;
|
||||||
|
%{someText}.blocksemi = $block.isSemi;
|
||||||
|
%{someText}.blockbraces = !$block.isSemi; } -> unsupported(reason = {"checked statements are not supported"}, text = { someText } )
|
||||||
|
;
|
||||||
|
unchecked_statement
|
||||||
|
@init {
|
||||||
|
StringTemplate someText = null;
|
||||||
|
}:
|
||||||
|
'unchecked' block
|
||||||
|
{ someText = %keyword_block();
|
||||||
|
%{someText}.keyword = "unchecked";
|
||||||
|
%{someText}.block = $block.st;
|
||||||
|
%{someText}.blocksemi = $block.isSemi;
|
||||||
|
%{someText}.blockbraces = !$block.isSemi; } -> unsupported(reason = {"checked statements are not supported"}, text = { someText } )
|
||||||
|
;
|
||||||
lock_statement
|
lock_statement
|
||||||
@init {
|
@init {
|
||||||
StringTemplate someText = null;
|
StringTemplate someText = null;
|
||||||
@ -1295,7 +1340,8 @@ lock_statement
|
|||||||
%{someText}.exp = $expression.st;
|
%{someText}.exp = $expression.st;
|
||||||
%{someText}.block = $embedded_statement.st;
|
%{someText}.block = $embedded_statement.st;
|
||||||
%{someText}.blocksemi = $embedded_statement.isSemi;
|
%{someText}.blocksemi = $embedded_statement.isSemi;
|
||||||
%{someText}.blockbraces = $embedded_statement.isBraces; } -> unsupported(reason = {"lock() statements are not supported"}, text = { someText } );
|
%{someText}.blockbraces = $embedded_statement.isBraces; } -> unsupported(reason = {"lock() statements are not supported"}, text = { someText } )
|
||||||
|
;
|
||||||
using_statement:
|
using_statement:
|
||||||
'using' '(' resource_acquisition ')' embedded_statement ;
|
'using' '(' resource_acquisition ')' embedded_statement ;
|
||||||
resource_acquisition:
|
resource_acquisition:
|
||||||
|
@ -210,6 +210,12 @@ lock(<exp>)
|
|||||||
<block(statements = block, issemi = blocksemi, isbraces = blockbraces)>
|
<block(statements = block, issemi = blocksemi, isbraces = blockbraces)>
|
||||||
>>
|
>>
|
||||||
|
|
||||||
|
keyword_block(comments,keyword,block,blocksemi, blockbraces) ::= <<
|
||||||
|
<comments; separator="\n">
|
||||||
|
<keyword>
|
||||||
|
<block(statements = block, issemi = blocksemi, isbraces = blockbraces)>
|
||||||
|
>>
|
||||||
|
|
||||||
block(statements,issemi,isbraces) ::= <<
|
block(statements,issemi,isbraces) ::= <<
|
||||||
<if(issemi)>
|
<if(issemi)>
|
||||||
;
|
;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user