all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Using semantic lexers together with Wisent
@ 2015-06-16 13:53 Philipp Stephani
  0 siblings, 0 replies; only message in thread
From: Philipp Stephani @ 2015-06-16 13:53 UTC (permalink / raw
  To: help-gnu-emacs

Hi,

consider the following lexer/parser combination:

(with-temp-buffer
  (emacs-lisp-mode)
  (insert ".")
  (semantic-lex-init)
  (let ((wisent-lex-istream (semantic-simple-lexer (point-min) (point-max))))
    (wisent-parse
     (wisent-compile-grammar
      '((symbol)
        nil
        (dot ((?.)))))
     #'wisent-lex)))

This returns 'nil' because ?. doesn't actually match a dot.  I need to
explicitly specify 'symbol', which of course matches too much.  Is there
a way to match a specific character without defining my own lexer or
writing a wrapper around `wisent-lex'?  The Wisent examples are full of
such constructs, but they don't seem to work.

Another problem occurs with the following combination:

(with-temp-buffer
  (emacs-lisp-mode)
  (insert "-2.3")
  (semantic-lex-init)
  (semantic-simple-lexer (point-min) (point-max)))

This analyzes -2.3 as a symbol instead of a number (or punctuation +
number).  Is there a simple way to match negative numbers, again without
defining a custom lexer?

Thanks,
Philipp

-- 
Google Germany GmbH
Dienerstraße 12
80331 München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Graham Law, Christine Elizabeth Flores

Diese E-Mail ist vertraulich.  Wenn Sie nicht der richtige Adressat sind,
leiten Sie diese bitte nicht weiter, informieren Sie den Absender und löschen
Sie die E-Mail und alle Anhänge.  Vielen Dank.
       
This e-mail is confidential.  If you are not the right addressee please do not
forward it, please inform the sender, and please erase this e-mail including
any attachments.  Thanks.



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-06-16 13:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-16 13:53 Using semantic lexers together with Wisent Philipp Stephani

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.