Hi Lars,
You will eventually need to create your own lexer. I don't think I've
every tried wisent and the default lexer together, so I can't say if it
works or not. No worries though, it is pretty easy.
I've attached new versions of wisent-vhdl.wy and .el which produced a
variable tag. Variable is obviously the wrong thing for your report,
but it should get the right idea across.
Enjoy
Eric
On 05/28/2012 04:51 AM, Lars Petter Mostad wrote:
> ---------- Forwarded message ----------
> From: Lars Petter Mostad<larspm@...>
> Date: Mon, May 28, 2012 at 10:48 AM
> Subject: Re: [CEDET-devel] VHDL Support
> To: "Eric M. Ludlam"<ericludlam@...>
>
>
> I have now started looking at adding vhdl support.
>
> Exuberant ctags does have support for vhdl, but not the ctags version
> that comes with the windows distribution of emacs does not. So, to add
> "self contained" vhdl support, I will use wisent.
>
> I'm hoping that I don't have to add my own lexer. Emacs has a good
> vhdl-mode, so running (semantic-lex (point-min) (point-max)) on a vhdl
> file gives me something like this:
>
> ((symbol 1 . 7)
> (symbol 8 . 15)
> (symbol 16 . 18)
> (symbol 21 . 25)
> (semantic-list 26 . 76)
> (punctuation 76 . 77)
> ...)
>
> I will base my grammar file on this BNF:
> http://www.iis.ee.ethz.ch/~zimmi/download/vhdl93_syntax.html
>
> I'm having some problems with the basic plumbing. To get started I
> wrote wisent-vhdl.wy like this:
>
> %languagemode vhdl-mode
> %start goal
>
> %keyword ENTITY "entity"
> %keyword REPORT "report"
>
> %%
>
> goal
> : REPORT ENTITY
> (message "this is an action")
> ;
>
> %%
>
> entity and report are just random vhdl keywords, but i was expecting
> to see "this is an action" when opening a nonsensical vhdl file like
> this:
>
> report entity
>
> I can see that wisent-vhdl-wy--install-parser runs every time i open a
> new vhdl file, and semantic-lex now gives ((REPORT 1 . 7) (ENTITY 8 .
> 14)) instead of ((symbol 1 . 7) (symbol 8 . 14)), but the parser code
> never runs. I have tested this by adding (message "this is
> wisent-vhdl-wy--parse-table") to the progn in
> wisent-vhdl-wy--parse-table in the generated wisent-vhdl-wy.el.
>
> This is my wisent-vhdl.el:
>
> (require 'vhdl-mode) ;; major mode definition for FOO
> (require 'wisent-vhdl-wy) ;; The parser
>
> ;;;###autoload
> (defun semantic-default-vhdl-setup ()
> "Set up a buffer for semantic parsing of the VHDL language."
> (message "setting up vhd mode")
> (wisent-vhdl-wy--install-parser)
> )
>
> ;;;###autoload
> (add-hook 'vhdl-mode-hook 'semantic-default-vhdl-setup)
>
> (provide 'wisent-vhdl)
>
> Can you see whats missing?
>
> I'm using CEDET 1.1 with emacs 24.0.97.
>
> When trying the bzr trunk (with both emacs 23.4 and emacs bzr trunk) i
> got "bad input grammar" when compiling the grammar files (even the
> existing ones for python, java, etc.) with "C-c C-c", even though they
> compile fine with the makefile.
>
> - Lars Petter
>
> On Sat, Jan 21, 2012 at 4:55 AM, Eric M. Ludlam<ericludlam@...> wrote:
>> On 01/18/2012 06:35 AM, Lars Petter Mostad wrote:
>>>
>>> Hi!
>>>
>>> Has anybody ever worked on support for VHDL?
>>>
>>> If not, I might look into it (don't hold your breath, though).
>>>
>>> I would appreciate any comments from people that have tried before!
>>>
>>> - Lars Petter
>>
>>
>> There is no explicit VHDL support in CEDET, nor externally that I know of.
>> If VHDL is supported well by exuberant ctags, then you can probably
>> configure the ctags support for vhdl pretty quickly, using one of the other
>> languages as a template. (It's a 1 liner).
>>
>> See /semantic/ctags/semantic-ectag-lang.el
>>
>> If you develop something that works well, let the list know.
>>
>> Thanks
>> Eric
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Cedet-devel mailing list
> Cedet-devel@...
> https://lists.sourceforge.net/lists/listinfo/cedet-devel
|