[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] pnet/cscc/csharp cs_grammar.y, 1.67, 1.68 cs_invok
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] pnet/cscc/csharp cs_grammar.y, 1.67, 1.68 cs_invoke.tc, 1.26, 1.27 |
Date: |
Fri, 07 Nov 2003 00:12:38 +0000 |
Update of /cvsroot/dotgnu-pnet/pnet/cscc/csharp
In directory subversions:/tmp/cvs-serv13213/cscc/csharp
Modified Files:
cs_grammar.y cs_invoke.tc
Log Message:
Add the "Type.default" idiom to the C# compiler, for C# 2.0 compatibility.
Index: cs_grammar.y
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/cscc/csharp/cs_grammar.y,v
retrieving revision 1.67
retrieving revision 1.68
diff -C2 -d -r1.67 -r1.68
*** cs_grammar.y 26 Oct 2003 05:59:53 -0000 1.67
--- cs_grammar.y 7 Nov 2003 00:12:36 -0000 1.68
***************
*** 1494,1497 ****
--- 1494,1503 ----
| MODULE { $$ = ILQualIdentSimple("<Module>"); }
| DELEGATE AnonymousMethod { $$ = $2; }
+ | PrimaryExpression '.' DEFAULT {
+ $$ = ILNode_DefaultConstructor_create($1, 0);
+ }
+ | BuiltinType '.' DEFAULT {
+ $$ = ILNode_DefaultConstructor_create($1, 0);
+ }
;
Index: cs_invoke.tc
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/cscc/csharp/cs_invoke.tc,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** cs_invoke.tc 8 May 2003 21:03:49 -0000 1.26
--- cs_invoke.tc 7 Nov 2003 00:12:36 -0000 1.27
***************
*** 736,740 ****
{
/* Replace this node with a default constructor call */
! *parent = ILNode_DefaultConstructor_create(objectType);
yysetfilename(*parent, yygetfilename(node));
yysetlinenum(*parent, yygetlinenum(node));
--- 736,740 ----
{
/* Replace this node with a default constructor call */
! *parent = ILNode_DefaultConstructor_create(0,
objectType);
yysetfilename(*parent, yygetfilename(node));
yysetlinenum(*parent, yygetlinenum(node));
***************
*** 849,854 ****
ILNode_SemAnalysis(ILNode_DefaultConstructor)
{
! /* This is a dummy: it won't be called in practice */
! return CSSemValueDefault;
}
--- 849,920 ----
ILNode_SemAnalysis(ILNode_DefaultConstructor)
{
! ILEvalValue evalValue;
! CSSemValue value;
!
! /* Evaluate the type sub-expression */
! node->type = CSSemType(node->expr, info, &(node->expr));
!
! /* Perform constant evaluation */
! if(ILTypeIsReference(node->type))
! {
! evalValue.valueType = ILMachineType_ObjectRef;
! evalValue.un.oValue = 0;
! CSSemSetConstant(value, node->type, evalValue);
! }
! else
! {
! evalValue.valueType = ILTypeToMachineType(node->type);
! switch(evalValue.valueType)
! {
! case ILMachineType_Boolean:
! case ILMachineType_Int8:
! case ILMachineType_UInt8:
! case ILMachineType_Int16:
! case ILMachineType_UInt16:
! case ILMachineType_Char:
! case ILMachineType_Int32:
! case ILMachineType_UInt32:
! {
! evalValue.un.i4Value = 0;
! }
! break;
!
! case ILMachineType_Int64:
! case ILMachineType_UInt64:
! {
! evalValue.un.i8Value = 0;
! }
! break;
!
! case ILMachineType_Float32:
! {
! evalValue.un.r4Value = (ILFloat)0.0;
! }
! break;
!
! case ILMachineType_Float64:
! {
! evalValue.un.r8Value = (ILDouble)0.0;
! }
! break;
!
! case ILMachineType_Decimal:
! {
! ILDecimalFromInt32(&(evalValue.un.decValue), 0);
! }
! break;
!
! default:
! {
! CSSemSetRValue(value, node->type);
! return value;
! }
! /* Not reached */
! }
! CSSemSetConstant(value, node->type, evalValue);
! }
!
! /* Return the final semantic value to the caller */
! return value;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] pnet/cscc/csharp cs_grammar.y, 1.67, 1.68 cs_invoke.tc, 1.26, 1.27,
Rhys Weatherley <address@hidden> <=
- Prev by Date:
[Dotgnu-pnet-commits] pnet ChangeLog,1.2739,1.2740
- Next by Date:
[Dotgnu-pnet-commits] pnet/codegen cg_defs.h, 1.2, 1.3 cg_misc.tc, 1.48, 1.49 cg_nodes.tc, 1.83, 1.84
- Previous by thread:
[Dotgnu-pnet-commits] pnet ChangeLog,1.2739,1.2740
- Next by thread:
[Dotgnu-pnet-commits] pnet/codegen cg_defs.h, 1.2, 1.3 cg_misc.tc, 1.48, 1.49 cg_nodes.tc, 1.83, 1.84
- Index(es):