1 ;;; wisent-dot.el --- GraphViz DOT parser
3 ;; Copyright (C) 2003, 2004 Eric M. Ludlam
5 ;; Author: Eric Ludlam <zappo@gnu.org>
7 ;; X-RCS: $Id: wisent-dot.el,v 1.1 2007-11-26 15:04:27 michaels Exp $
9 ;; This file is not part of GNU Emacs.
11 ;; This program is free software; you can redistribute it and/or
12 ;; modify it under the terms of the GNU General Public License as
13 ;; published by the Free Software Foundation; either version 2, or (at
14 ;; your option) any later version.
16 ;; This program is distributed in the hope that it will be useful, but
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 ;; General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with this program; see the file COPYING. If not, write to
23 ;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 ;; Boston, MA 02110-1301, USA.
28 ;; Parser for GraphViz DOT language.
29 ;; The language is declaritive and the whole thing is parsed.
30 ;; The result could be used as a data structure representing a graph.
32 ;; This depends on graphics dot mode by
33 ;; Pieter E.J. Pareit <pieter.pareit@planetinternet.be>
34 ;; http://users.skynet.be/ppareit/graphviz-dot-mode.el
35 ;; with the following patch:
38 ;; *** graphviz-dot-mode.el 2003/03/23 17:14:22 1.1
39 ;; --- graphviz-dot-mode.el 2003/03/26 03:39:21
43 ;; (modify-syntax-entry ?/ ". 124b" st)
44 ;; (modify-syntax-entry ?* ". 23" st)
45 ;; (modify-syntax-entry ?\n "> b" st)
46 ;; + (modify-syntax-entry ?= "." st)
47 ;; + (modify-syntax-entry ?, "." st)
48 ;; + (modify-syntax-entry ?\; "." st)
49 ;; + (modify-syntax-entry ?- "." st)
50 ;; + (modify-syntax-entry ?> "." st)
51 ;; + (modify-syntax-entry ?< "." st)
53 ;; "Syntax table for `graphviz-dot-mode'.")
58 (require 'semantic-wisent)
60 (require 'wisent-dot-wy)
62 (define-mode-overload-implementation semantic-tag-components
63 graphviz-dot-mode (tag)
64 "Return the children of tag TAG."
66 ((memq (semantic-tag-class tag)
67 '(generic-node graph-attributes node link))
68 (semantic-tag-get-attribute tag :attributes)
70 ((memq (semantic-tag-class tag)
72 (semantic-tag-get-attribute tag :members)
76 (defun wisent-dot-setup-parser ()
77 "Setup buffer for parse."
78 (wisent-dot-wy--install-parser)
82 semantic-lex-analyzer 'wisent-dot-lexer
85 semantic-imenu-summary-function 'semantic-format-tag-name
86 imenu-create-index-function 'semantic-create-imenu-index
87 semantic-command-separation-character ";"
89 semantic-symbol->name-assoc-list
91 (digraph . "Directed Graph")
95 senator-step-at-tag-classes '(graph digraph)
99 (add-hook 'graphviz-dot-mode-hook 'wisent-dot-setup-parser)
101 (provide 'wisent-dot)
103 ;;; wisent-dot.el ends here