Exemple #1
0
        private void GenerateCalculationCode(ModuleBuilder target, PapDocument document)
        {
            // Main-Methode erzeugen
            target.Methods.Add(new MethodBuilder(Visibilities.Public,
                                                 OperationMainMethodName,
                                                 PapSyntaxTreeConverter.Convert(document.MainMethod.Statements)));

            // Weitere Methoden erzeugen
            target.Methods.AddRange(document.Methods.Select(m => new MethodBuilder(Visibilities.Private,
                                                                                   m.Name,
                                                                                   PapSyntaxTreeConverter.Convert(m.Statements))
            {
                Summary = m.Documentation
            }));
        }
Exemple #2
0
        public static StatementBuilder Convert(IPapSyntaxTreeNode node)
        {
            var visitor = new PapSyntaxTreeConverter();

            return(visitor.Visit(node));
        }