Ejemplo n.º 1
0
        public TaskDef CreateTaskDef(Token token, AstNodeKind kind)
        {
            if (token.ToString() == Name)
            {
                kind = AstNodeKind.CreatorDef;
            }

            switch (kind)
            {
            case AstNodeKind.CreatorDef:
                token = TokenInstance.CSharp.CREATE;
                break;
            }
            //Create StubDef
            TaskStubDef stubDef;

            switch (kind)
            {
            case AstNodeKind.CreatorDef:
                stubDef = new ExpertStubDef(token);
                break;

            default:
                stubDef = new TaskStubDef(token);
                break;
            }
            //CreateProcDef
            TaskProcedureDef procDef = new TaskProcedureDef(new Token(token.ToString() + "Proc"));

            TaskDef taskDef = TaskDef.Create(this, kind, token, stubDef, procDef);

            return(taskDef);
        }
Ejemplo n.º 2
0
 //
 public TaskDef(ExpertDef parent, AstNodeKind kind, Token token, TaskStubDef stubDef, TaskProcedureDef procDef)
     : base(kind, token)
 {
     Parent         = parent;
     stubDef.Parent = procDef.Parent = this;
     StubDef        = stubDef;
     ProcedureDef   = procDef;
     Atomicity      = Atomicity.StronglyNonAtomic;
 }
Ejemplo n.º 3
0
        public static TaskDef Create(ExpertDef parent, AstNodeKind kind, Token token, TaskStubDef stubDef, TaskProcedureDef procDef)
        {
            TaskDef def = new TaskDef(parent, kind, token, stubDef, procDef);

            if (kind != AstNodeKind.InnerTaskDef)
            {
                def.AddChild(stubDef);
            }
            def.AddChild(procDef);
            parent.AddChild(def);

            return(def);
        }