private CodeCatchClause GenerateClause(ExceptHandler eh) { if (eh.type is Identifier ex) { return(gen.CatchClause( null, new CodeTypeReference(ex.Name), () => eh.body.Accept(this))); } else { return(gen.CatchClause( null, null, () => eh.body.Accept(this))); } }
private CodeCatchClause GenerateClause(ExceptHandler eh) { var ex = eh.type as Identifier; if (ex != null) { return(gen.CatchClause( null, new CodeTypeReference(ex.Name), () => eh.body.Accept(this))); } else { return(gen.CatchClause( null, null, () => eh.body.Accept(this))); } throw new NotImplementedException(); }
public DataType VisitHandler(ExceptHandler h) { DataType typeval = DataType.Unknown; if (h.type != null) { typeval = h.type.Accept(this); } if (h.name != null) { scope.BindByScope(analyzer, h.name, typeval); } if (h.body != null) { return(h.body.Accept(this)); } else { return(DataType.Unknown); } }
internal static AST Convert(Node node) { AST ast; if (node is TryStatementHandler) ast = new ExceptHandler((TryStatementHandler)node); else throw new ArgumentTypeException("Unexpected node type: " + node.GetType()); ast.GetSourceLocation(node); return ast; }