Exemple #1
0
        public void CallVisitMethod(BasicAstNode node)
        {
            var nodeType = node.GetType();

            if (!_autoDispatchMethods.ContainsKey(nodeType))
            {
                throw new Exception($"Unsupported Ast type: {nodeType.Name}");
            }

            _autoDispatchMethods[nodeType].Invoke(_visitor, new object[] { node });
        }
Exemple #2
0
 public TestAstHelper(BasicAstNode expect, BasicAstNode actual)
 {
     _expect = expect;
     _actual = actual;
 }
Exemple #3
0
 public void Visit(BasicAstNode visitable)
 {
     _dispatcher.CallVisitMethod(visitable);
 }
 public void Visit(BasicAstNode visitable)
 {
     throw new NotImplementedException("Calling IAstVisitor.Visit(BasicAstNode)");
 }