public T GetInvoker(params Type[] types) { if (types.Length != numParams) { throw new InvalidOperationException("Invalid generic arguments ({0} instead of {1})".FormatWith(types.Length, numParams)); } return(executor.GetOrAdd(types, (ts) => GeneratorVisitor.GetGenerator <T>(expression, ts).Compile())); }
/// <summary> /// Genera el codi font. /// </summary> /// <param name="unitDecl">Objecte 'UnitDeclaration'.</param> /// <returns>El codi generat.</returns> /// public static string Generate(UnitDeclaration unitDecl) { if (unitDecl == null) { throw new ArgumentNullException(nameof(unitDecl)); } var cb = new CodeBuilder(); var visitor = new GeneratorVisitor(cb); visitor.Visit(unitDecl); return(cb.ToString()); }
public string Next() { return(GeneratorVisitor.Visit(_syntaxTreeRootNode, nodeBuilder)); }