mirror of
https://github.com/twiglet/cs2j.git
synced 2025-01-18 13:15:17 +01:00
pass type contexts a bit more widely
This commit is contained in:
parent
d71a5f83f2
commit
9e9bba2f40
@ -1298,9 +1298,9 @@ array_creation_expression returns [TypeRepTemplate dotNetType]:
|
|||||||
array_initializer:
|
array_initializer:
|
||||||
'{' variable_initializer_list? ','? '}' ;
|
'{' variable_initializer_list? ','? '}' ;
|
||||||
variable_initializer_list:
|
variable_initializer_list:
|
||||||
variable_initializer (',' variable_initializer)* ;
|
variable_initializer[ObjectType] (',' variable_initializer[ObjectType])* ;
|
||||||
variable_initializer:
|
variable_initializer[TypeRepTemplate typeCtxt]:
|
||||||
expression[ObjectType] | array_initializer ;
|
expression[$typeCtxt] | array_initializer ;
|
||||||
sizeof_expression:
|
sizeof_expression:
|
||||||
^('sizeof' unmanaged_type );
|
^('sizeof' unmanaged_type );
|
||||||
checked_expression:
|
checked_expression:
|
||||||
@ -2189,9 +2189,9 @@ constant_declaration:
|
|||||||
constant_declarators[TypeRepTemplate ty]:
|
constant_declarators[TypeRepTemplate ty]:
|
||||||
constant_declarator[$ty] (',' constant_declarator[$ty])* ;
|
constant_declarator[$ty] (',' constant_declarator[$ty])* ;
|
||||||
constant_declarator[TypeRepTemplate ty]:
|
constant_declarator[TypeRepTemplate ty]:
|
||||||
identifier { $SymTab::symtab[$identifier.thetext] = $ty; } ('=' constant_expression)? ;
|
identifier { $SymTab::symtab[$identifier.thetext] = $ty; } ('=' constant_expression[$ty])? ;
|
||||||
constant_expression returns [string rmId]:
|
constant_expression[TypeRepTemplate tyCtxt] returns [string rmId]:
|
||||||
expression[ObjectType] {$rmId = $expression.rmId; };
|
expression[$tyCtxt] {$rmId = $expression.rmId; };
|
||||||
|
|
||||||
///////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////
|
||||||
field_declaration[CommonTree tyTree, TypeRepTemplate ty]:
|
field_declaration[CommonTree tyTree, TypeRepTemplate ty]:
|
||||||
@ -2211,7 +2211,7 @@ variable_declarator[CommonTree tyTree, TypeRepTemplate ty]
|
|||||||
}
|
}
|
||||||
}:
|
}:
|
||||||
identifier
|
identifier
|
||||||
(e='=' variable_initializer { hasInit = true; constructStruct = false; constructEnum = false; } )?
|
(e='=' variable_initializer[$ty] { hasInit = true; constructStruct = false; constructEnum = false; } )?
|
||||||
magicConstructStruct[constructStruct, $tyTree, $identifier.tree != null ? $identifier.tree.Token : null]
|
magicConstructStruct[constructStruct, $tyTree, $identifier.tree != null ? $identifier.tree.Token : null]
|
||||||
magicConstructDefaultEnum[constructEnum, $ty, zeroEnum, $identifier.tree != null ? $identifier.tree.Token : null]
|
magicConstructDefaultEnum[constructEnum, $ty, zeroEnum, $identifier.tree != null ? $identifier.tree.Token : null]
|
||||||
// eg. event EventHandler IInterface.VariableName = Foo;
|
// eg. event EventHandler IInterface.VariableName = Foo;
|
||||||
@ -2640,7 +2640,7 @@ switch_label returns [bool isDefault]
|
|||||||
@init {
|
@init {
|
||||||
$isDefault = false;
|
$isDefault = false;
|
||||||
}:
|
}:
|
||||||
^(c='case' ce=constant_expression )
|
^(c='case' ce=constant_expression[ObjectType] )
|
||||||
-> { $switch_statement::convertToIfThenElse }?
|
-> { $switch_statement::convertToIfThenElse }?
|
||||||
// scrutVar.equals(ce)
|
// scrutVar.equals(ce)
|
||||||
^(APPLY[$c.token, "APPLY"] ^(DOT[$c.token, "."] IDENTIFIER[$c.token, $switch_statement::scrutVar] IDENTIFIER[$c.token, "equals"]) ^(ARGS[$c.token, "ARGS"] $ce))
|
^(APPLY[$c.token, "APPLY"] ^(DOT[$c.token, "."] IDENTIFIER[$c.token, $switch_statement::scrutVar] IDENTIFIER[$c.token, "equals"]) ^(ARGS[$c.token, "ARGS"] $ce))
|
||||||
@ -2730,7 +2730,7 @@ continue_statement:
|
|||||||
'continue' ';' ;
|
'continue' ';' ;
|
||||||
goto_statement:
|
goto_statement:
|
||||||
'goto' ( identifier
|
'goto' ( identifier
|
||||||
| 'case' constant_expression
|
| 'case' constant_expression[ObjectType]
|
||||||
| 'default') ';' ;
|
| 'default') ';' ;
|
||||||
catch_clauses:
|
catch_clauses:
|
||||||
catch_clause+ ;
|
catch_clause+ ;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user