public override object VisitClassReferenceExpression(ClassReferenceExpression classReferenceExpression, object data) { if (resolver.CallingClass == null) { return(null); } return(resolver.CallingClass.DefaultReturnType); }
public object VisitClassReferenceExpression(ClassReferenceExpression classReferenceExpression, object data) { // VB's MyClass.Method references methods in the CURRENT class, ignoring overrides!!! // that is supported neither by C# nor Boo. // Most of the time, "Me"="self" should also do the job. AddWarning(classReferenceExpression, "Class reference is not supported, replaced with self reference."); return(new B.SelfLiteralExpression(GetLexicalInfo(classReferenceExpression))); }
public void ClassReferenceExpressionClassNameValid() { // Check class name var reference = new ClassReferenceExpression("namespace", "Foo"); new ClassReferenceExpression("namespace", "Bar1"); new ClassReferenceExpression("namespace", "Bo2OUy8F"); Assert.AreEqual("namespace.Foo", reference.ToString()); }
public void ClassReferenceExpressionNameSpace() { // Check namespace name var reference = new ClassReferenceExpression("Boo.Bee", "Foo"); new ClassReferenceExpression("Foo.Boo.Bee1", "Foo"); new ClassReferenceExpression("Foo.Be3UYT76567g", "Foo"); Assert.AreEqual("Boo.Bee.Foo", reference.ToString()); }
public override object VisitClassReferenceExpression(ClassReferenceExpression classReferenceExpression, object data) { if (resolver.CallingClass != null) { return(CreateResolveResult(resolver.CallingClass.DefaultReturnType)); } else { return(null); } }
public virtual object VisitClassReferenceExpression(ClassReferenceExpression classReferenceExpression, object data) { throw new global::System.NotImplementedException("ClassReferenceExpression"); }
public virtual object Visit(ClassReferenceExpression classReferenceExpression, object data) { Debug.Assert(classReferenceExpression != null); return(data); }
void SimpleNonInvocationExpression( #line 1645 "VBNET.ATG" out Expression pexpr) { #line 1647 "VBNET.ATG" Expression expr; TypeReference type = null; string name = String.Empty; pexpr = null; if (StartOf(32)) { switch (la.kind) { case 3: { lexer.NextToken(); #line 1655 "VBNET.ATG" pexpr = new PrimitiveExpression(t.literalValue, t.val) { LiteralFormat = t.literalFormat }; break; } case 4: { lexer.NextToken(); #line 1656 "VBNET.ATG" pexpr = new PrimitiveExpression(t.literalValue, t.val) { LiteralFormat = t.literalFormat }; break; } case 7: { lexer.NextToken(); #line 1657 "VBNET.ATG" pexpr = new PrimitiveExpression(t.literalValue, t.val) { LiteralFormat = t.literalFormat }; break; } case 6: { lexer.NextToken(); #line 1658 "VBNET.ATG" pexpr = new PrimitiveExpression(t.literalValue, t.val) { LiteralFormat = t.literalFormat }; break; } case 5: { lexer.NextToken(); #line 1659 "VBNET.ATG" pexpr = new PrimitiveExpression(t.literalValue, t.val) { LiteralFormat = t.literalFormat }; break; } case 9: { lexer.NextToken(); #line 1660 "VBNET.ATG" pexpr = new PrimitiveExpression(t.literalValue, t.val) { LiteralFormat = t.literalFormat }; break; } case 8: { lexer.NextToken(); #line 1661 "VBNET.ATG" pexpr = new PrimitiveExpression(t.literalValue, t.val) { LiteralFormat = t.literalFormat }; break; } case 202: { lexer.NextToken(); #line 1663 "VBNET.ATG" pexpr = new PrimitiveExpression(true, "true"); break; } case 109: { lexer.NextToken(); #line 1664 "VBNET.ATG" pexpr = new PrimitiveExpression(false, "false"); break; } case 151: { lexer.NextToken(); #line 1665 "VBNET.ATG" pexpr = new PrimitiveExpression(null, "null"); break; } case 25: { lexer.NextToken(); Expr( #line 1666 "VBNET.ATG" out expr); Expect(26); #line 1666 "VBNET.ATG" pexpr = new ParenthesizedExpression(expr); break; } case 2: case 45: case 49: case 51: case 52: case 53: case 54: case 57: case 74: case 85: case 91: case 94: case 103: case 108: case 113: case 120: case 126: case 130: case 133: case 156: case 162: case 169: case 188: case 197: case 198: case 208: case 209: case 215: { Identifier(); #line 1668 "VBNET.ATG" pexpr = new IdentifierExpression(t.val); pexpr.StartLocation = t.Location; pexpr.EndLocation = t.EndLocation; if ( #line 1671 "VBNET.ATG" la.kind == Tokens.OpenParenthesis && Peek(1).kind == Tokens.Of) { lexer.NextToken(); Expect(155); TypeArgumentList( #line 1672 "VBNET.ATG" ((IdentifierExpression)pexpr).TypeArguments); Expect(26); } break; } case 55: case 58: case 69: case 86: case 87: case 96: case 128: case 137: case 154: case 181: case 186: case 187: case 193: case 206: case 207: case 210: { #line 1674 "VBNET.ATG" string val = String.Empty; if (StartOf(11)) { PrimitiveTypeName( #line 1675 "VBNET.ATG" out val); } else if (la.kind == 154) { lexer.NextToken(); #line 1675 "VBNET.ATG" val = "System.Object"; } else SynErr(257); #line 1676 "VBNET.ATG" pexpr = new TypeReferenceExpression(new TypeReference(val, true)); break; } case 139: { lexer.NextToken(); #line 1677 "VBNET.ATG" pexpr = new ThisReferenceExpression(); break; } case 144: case 145: { #line 1678 "VBNET.ATG" Expression retExpr = null; if (la.kind == 144) { lexer.NextToken(); #line 1679 "VBNET.ATG" retExpr = new BaseReferenceExpression(); } else if (la.kind == 145) { lexer.NextToken(); #line 1680 "VBNET.ATG" retExpr = new ClassReferenceExpression(); } else SynErr(258); Expect(16); IdentifierOrKeyword( #line 1682 "VBNET.ATG" out name); #line 1682 "VBNET.ATG" pexpr = new MemberReferenceExpression(retExpr, name); break; } case 117: { lexer.NextToken(); Expect(16); Identifier(); #line 1684 "VBNET.ATG" type = new TypeReference(t.val ?? ""); #line 1686 "VBNET.ATG" type.IsGlobal = true; #line 1687 "VBNET.ATG" pexpr = new TypeReferenceExpression(type); break; } case 148: { ObjectCreateExpression( #line 1688 "VBNET.ATG" out expr); #line 1688 "VBNET.ATG" pexpr = expr; break; } case 81: case 93: case 204: { #line 1690 "VBNET.ATG" CastType castType = CastType.Cast; if (la.kind == 93) { lexer.NextToken(); } else if (la.kind == 81) { lexer.NextToken(); #line 1692 "VBNET.ATG" castType = CastType.Conversion; } else if (la.kind == 204) { lexer.NextToken(); #line 1693 "VBNET.ATG" castType = CastType.TryCast; } else SynErr(259); Expect(25); Expr( #line 1695 "VBNET.ATG" out expr); Expect(12); TypeName( #line 1695 "VBNET.ATG" out type); Expect(26); #line 1696 "VBNET.ATG" pexpr = new CastExpression(type, expr, castType); break; } case 63: case 64: case 65: case 66: case 67: case 68: case 70: case 72: case 73: case 77: case 78: case 79: case 80: case 82: case 83: case 84: { CastTarget( #line 1697 "VBNET.ATG" out type); Expect(25); Expr( #line 1697 "VBNET.ATG" out expr); Expect(26); #line 1697 "VBNET.ATG" pexpr = new CastExpression(type, expr, CastType.PrimitiveConversion); break; } case 44: { lexer.NextToken(); Expr( #line 1698 "VBNET.ATG" out expr); #line 1698 "VBNET.ATG" pexpr = new AddressOfExpression(expr); break; } case 116: { lexer.NextToken(); Expect(25); GetTypeTypeName( #line 1699 "VBNET.ATG" out type); Expect(26); #line 1699 "VBNET.ATG" pexpr = new TypeOfExpression(type); break; } case 205: { lexer.NextToken(); SimpleExpr( #line 1700 "VBNET.ATG" out expr); Expect(131); TypeName( #line 1700 "VBNET.ATG" out type); #line 1700 "VBNET.ATG" pexpr = new TypeOfIsExpression(expr, type); break; } case 122: { ConditionalExpression( #line 1701 "VBNET.ATG" out pexpr); break; } } } else if (la.kind == 16) { lexer.NextToken(); IdentifierOrKeyword( #line 1705 "VBNET.ATG" out name); #line 1705 "VBNET.ATG" pexpr = new MemberReferenceExpression(null, name); } else SynErr(260); }
/// <summary> /// Generates the code for an <see cref="ClassReferenceExpression"/>. /// </summary> /// <param name="expression">The expression</param> /// <returns>A BaZic code</returns> private string GenerateClassReferenceExpression(ClassReferenceExpression expression) { return($"{expression.Namespace}.{expression.ClassName}"); }
public virtual object VisitClassReferenceExpression(ClassReferenceExpression classReferenceExpression, object data) { Debug.Assert((classReferenceExpression != null)); return null; }
public override object VisitClassReferenceExpression(ClassReferenceExpression classReferenceExpression, object data) { return(base.VisitClassReferenceExpression(classReferenceExpression, data)); }
public object VisitClassReferenceExpression(ClassReferenceExpression classReferenceExpression, object data) { throw new NotImplementedException(); }
private bool IsMatch(ClassReferenceExpression left, ClassReferenceExpression right) { return(false); }
public virtual object TrackedVisitClassReferenceExpression(ClassReferenceExpression classReferenceExpression, object data) { return base.VisitClassReferenceExpression(classReferenceExpression, data); }
public sealed override object VisitClassReferenceExpression(ClassReferenceExpression classReferenceExpression, object data) { BeginVisit(classReferenceExpression); object result = TrackedVisitClassReferenceExpression(classReferenceExpression, data); EndVisit(classReferenceExpression); return result; }