示例#1
0
        /// <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());
        }
示例#2
0
 public string Next()
 {
     return(GeneratorVisitor.Visit(_syntaxTreeRootNode, nodeBuilder));
 }