示例#1
0
 void TypeExpr(out NBase res)
 {
     res = null; string type = string.Empty;
     if (TokenEquals(1, NType.PrimitiveTypes))
     {
         Expect(1);
         type = t.val;
     }
     else if (la.kind == 58)
     {
         Get();
         Expect(1);
         type = t.val;
         if (la.kind == 6)
         {
             Get();
             Expect(1);
             type = type + ":" + t.val;
         }
     }
     else
     {
         SynErr(74);
     }
     res = new NType(type, null, NType.NKind.Type, null);
     if (la.kind == 5)
     {
         Get();
         ((NType)res).IsNullable = true;
     }
 }
示例#2
0
 public NCast(NKind kind, NBase value, NType type) : base(value)
 {
     Kind = kind;
     Type = type;
 }
示例#3
0
 public NNew(NType type, NIdentBase next, NArgs args = null) : base(type.Name, next)
 {
     Type = type;
     Args = args ?? new NArgs();
 }