public override void ExitPlayerVarsPlayerExpression(PlayerVarsPlayerExpression playerVarsPlayerExpression) { var playerClass = playerVarsPlayerExpression.NearestAncestorOfType <Root>().SourceFiles.SelectMany(x => x.ClassDeclarations) .Where(x => x.Name == "Player").ToList(); if (playerClass.Count > 1) { throw new CompilationError(playerClass.First().Context, "The class 'Player' can not be duplicated"); } playerVarsPlayerExpression.Type = new ReferenceType(playerVarsPlayerExpression.Context, playerClass.First()); }
public override INode VisitPlayerVarsPlayerExpression(PlayerVarsPlayerExpression playerVarsPlayerExpression) { return(new PlayerVarsPlayerExpression(playerVarsPlayerExpression.Context, playerVarsPlayerExpression.Children.Select(Visit))); }
public virtual void ExitPlayerVarsPlayerExpression(PlayerVarsPlayerExpression playerVarsPlayerExpression) { }
public virtual T VisitPlayerVarsPlayerExpression(PlayerVarsPlayerExpression playerVarsPlayerExpression) { return(VisitChildren(playerVarsPlayerExpression)); }
public override void ExitPlayerVarsPlayerExpression(PlayerVarsPlayerExpression playerVarsPlayerExpression) { playerVarsPlayerExpression.ReplaceWith(playerVarsPlayerExpression.thisExpression); }