예제 #1
0
        /// <summary>
        /// Creates a new Ast parser with the given <see cref="ControlFlowGraph{TInstruction}"/>
        /// </summary>
        /// <param name="controlFlowGraph">The <see cref="ControlFlowGraph{TInstruction}"/> to parse</param>
        /// <param name="dataFlowGraph">The <see cref="DataFlowGraph{TContents}"/> to parse</param>
        public AstParser(ControlFlowGraph <TInstruction> controlFlowGraph, DataFlowGraph <TInstruction> dataFlowGraph)
        {
            if (dataFlowGraph == null)
            {
                throw new ArgumentNullException(nameof(dataFlowGraph));
            }
            _controlFlowGraph = controlFlowGraph ?? throw new ArgumentNullException(nameof(controlFlowGraph));
            _architecture     = new AstArchitecture <TInstruction>(controlFlowGraph.Architecture);

            var context = new AstParserContext <TInstruction>(_controlFlowGraph, dataFlowGraph);

            _transformer = new BlockTransformer <TInstruction>(context);
        }
예제 #2
0
 internal BlockTransformer(AstParserContext <TInstruction> context)
 {
     _context = context;
 }