Ejemplo n.º 1
0
            public ExecutionPathMethodCollection(IILBuilder ilBuilder, Automata <TInstruction, TOperand> automata)
            {
                _ilBuilder = ilBuilder;
                _automata  = automata;

                var length = 128;

                while (length < automata._executionPathRegistry.Count)
                {
                    length *= 2;
                }

                _executionPaths = new ExecutionPathMethod[length];

                for (var i = 0; i < length; i++)
                {
                    _executionPaths[i] = new ExecutionPathMethod(_ilBuilder, automata, i);
                }
            }
Ejemplo n.º 2
0
            public ExecutionPathMethod(IILBuilder builder, Automata <TInstruction, TOperand> automata, int index)
            {
                _mainDelegate = (process, threadStack, closure) =>
                {
                    var executionPath = automata._executionPathRegistry[index];

                    _mainDelegate = builder.BuildMain(executionPath, out _mainClosure);

                    return(_mainDelegate(process, threadStack, _mainClosure));
                };

                _parallelDelegate = (process, threadStack, closure) =>
                {
                    var executionPath = automata._executionPathRegistry[index];

                    _parallelDelegate = builder.BuildParallel(executionPath, out _parallelClosure);

                    return(_parallelDelegate(process, threadStack, _parallelClosure));
                };
            }
Ejemplo n.º 3
0
            public ExecutionPathMethod(ExecutionPath executionPath, IILBuilder builder, bool lazy)
            {
                if (lazy)
                {
                    _mainDelegate = (process, threadStack, closure) =>
                    {
                        _mainDelegate = builder.BuildMain(executionPath, out _mainClosure);

                        return(_mainDelegate(process, threadStack, _mainClosure));
                    };

                    _parallelDelegate = (process, threadStack, closure) =>
                    {
                        _parallelDelegate = builder.BuildParallel(executionPath, out _parallelClosure);

                        return(_parallelDelegate(process, threadStack, _parallelClosure));
                    };
                }
                else
                {
                    _mainDelegate     = builder.BuildMain(executionPath, out _mainClosure);
                    _parallelDelegate = builder.BuildParallel(executionPath, out _parallelClosure);
                }
            }
Ejemplo n.º 4
0
 public CachingILBuilder(IILBuilder wrapping)
 {
     Wrapping = wrapping;
 }
Ejemplo n.º 5
0
 public CodeParser(string codeFilePath, IILBuilder ilBuider)
 {
     CodeFilePath = codeFilePath;
     ILBuilder    = ilBuider;
 }