public override void VisitTaskDefinition(TaskDefinitionSyntax taskDefinitionSyntax) {
            var identifier = taskDefinitionSyntax.Identifier;
            var location   = identifier.GetLocation();

            if(location == null) {
                return;
            }

            var taskName = identifier.ToString();

            var taskDeclaration = _taskDeklarations.TryFindSymbol(taskName);
            if(taskDeclaration.Location != location) {
                taskDeclaration = null;
            }

            _taskDefinition = new TaskDefinitionSymbol(taskName, location, taskDefinitionSyntax, taskDeclaration);

            // Declarations
            foreach(var nodeDeclarationSyntax in taskDefinitionSyntax.NodeDeclarationBlock?.NodeDeclarations ?? Enumerable.Empty<NodeDeclarationSyntax>()) {
                Visit(nodeDeclarationSyntax);
            }

            // Transitions
            foreach (var transitionDefinitionSyntax in taskDefinitionSyntax.TransitionDefinitionBlock?.TransitionDefinitions ?? Enumerable.Empty<TransitionDefinitionSyntax>()) {
                Visit(transitionDefinitionSyntax);
            }

            // ExitTransitions
            foreach (var transitionDefinitionSyntax in taskDefinitionSyntax.TransitionDefinitionBlock?.ExitTransitionDefinitions ?? Enumerable.Empty<ExitTransitionDefinitionSyntax>()) {
                Visit(transitionDefinitionSyntax);
            }

            VerifyTaskDefinition();
        }
 public TaskDefinitionSymbol(string name, 
                             Location location, 
                             TaskDefinitionSyntax syntax, 
                             TaskDeclarationSymbol taskDeclaration) : base(name, location) {
     Syntax           = syntax;
     AsTaskDeclaration  = taskDeclaration;
     NodeDeclarations = new SymbolCollection<INodeSymbol>();
     Transitions      = new List<Transition>();
     ExitTransitions  = new List<ExitTransition>();
 }
        void ProcessTaskDefinitionSyntax(TaskDefinitionSyntax taskDefinitionSyntax, CancellationToken cancellationToken) {
            
            cancellationToken.ThrowIfCancellationRequested();
            
            var taskDefinitionResult= TaskDefinitionSymbolBuilder.Build(taskDefinitionSyntax, _taskDeclarations);
            _diagnostics.AddRange(taskDefinitionResult.Diagnostics);

            var taskDefinition = taskDefinitionResult.TaskDefinition;
            if(taskDefinition == null) {
                return;
            }
            if (_taskDefinitions.Contains(taskDefinition.Name)) {
                // Doppelte Einträge überspringen. Fehler existiert schon wegen der Taskdeclarations.
            } else {

                if (!CSharp.IsValidIdentifier(taskDefinition.Name)) {
                    _diagnostics.Add(new Diagnostic(
                        taskDefinition.Location,
                        DiagnosticDescriptors.Semantic.Nav2000IdentifierExpected));
                }

                _taskDefinitions.Add(taskDefinition);
            }
        }
 public static TaskDefinitionBuilderResult Build(TaskDefinitionSyntax taskDefinitionSyntax, IReadOnlySymbolCollection<TaskDeclarationSymbol> taskDeklarations) {
     var builder = new TaskDefinitionSymbolBuilder(taskDeklarations);
     builder.Visit(taskDefinitionSyntax);
     return new TaskDefinitionBuilderResult(builder._taskDefinition, builder._diagnostics);
 }
        void ProcessTaskDefinition(TaskDefinitionSyntax taskDefinitionSyntax) {

            if(null != taskDefinitionSyntax && !taskDefinitionSyntax.Identifier.IsMissing) {

                var identifier = taskDefinitionSyntax.Identifier;
                var location   = identifier.GetLocation();
                if(location != null) {
                    var taskDeclaration = new TaskDeclarationSymbol(identifier.ToString(), location, TaskDeclarationOrigin.TaskDefinition, _processAsIncludedFile);
                    AddConnectionPoints(taskDeclaration, taskDefinitionSyntax.NodeDeclarationBlock?.ConnectionPoints().ToList());
                    AddTaskDeclaration(taskDeclaration);
                }
            }
        }
		public override void PostWalkTaskDefinition(TaskDefinitionSyntax taskDefinitionSyntax) { 
			MethodsCalled["PostWalkTaskDefinition"]=true;
		}
		// TaskDefinitionSyntax
		public override bool WalkTaskDefinition(TaskDefinitionSyntax taskDefinitionSyntax) { 
			MethodsCalled["WalkTaskDefinition"]=true;
			return true; 
		}