Exemplo n.º 1
0
        internal static bool DrawAST(ParseTreeNode id)
        {
            if (id.ChildNodes.Count == 1)
            {
                string func_name = id.FindTokenAndGetText();

                List <ScopeMember> functs = Program.Global.GetFunctions(func_name);

                if (functs.Count != 0)
                {
                    foreach (var f in functs)
                    {
                        string fname = f.Name + f.GetHashCode();

                        ASTImageCreator imgCreator = new ASTImageCreator(f.Root, Program.ImagePath, fname, Function: true);

                        Logger.AddImg(imgCreator.GetAsImage64());
                    }
                    return(true);
                }
                else
                {
                    Logger.AddError(id, "No existe ninguna función con ese nombre");
                }
            }
            return(false);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Obtiene la imagen que genera el AST en formato BitMap (Util para la GUI)
        /// </summary>
        /// <returns></returns>
        internal BitmapImage GetASTImage()
        {
            ASTImageCreator img_creator = new ASTImageCreator(compiler.Ast.Root);

            return(img_creator.GetAsImage());
        }