all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Getting the Bovinator off the ground
@ 2017-03-25 19:07 Eric Abrahamsen
  2017-03-25 21:29 ` Eric Abrahamsen
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Abrahamsen @ 2017-03-25 19:07 UTC (permalink / raw)
  To: help-gnu-emacs

[I was trying to send this to emacs.cedet, but haven't figured out how
to post there. Hoping someone here can help.]

I'm running emacs from git, and have installed CEDET from git as well.

I'm trying to figure out how to use language grammars, and am obviously
misunderstanding something fairly basic. I'm just trying to get a super
barebones Bovine grammar set up, and then trying to use
`semantic-parse-region' to see what it returns, and start playing with
it.

I'm probably misunderstanding something fairly basic here.
`semantic-parse-region' is supposed to return some kind of structure,
right?

Here's my basic grammar:

%package helloworld
%start         test
%keyword BEGINTEST "THISISATEST"
%token COLON     "\\`[:]\\'"

%%
test : bol BEGINTEST COLON value
       ( $1 )
     ;
value : string
        ( $1 )
      ;
%%

I compile and load the el file, then go into a buffer containing this
text:

THISISATEST:hello world

Run (helloworld--install-parser), and then (semantic-parse-region
(point-min) (point-max)).

First of all it tells me that `semantic-lex' is an obsolete function,
then returns nil.

What's it supposed to return? How do I get at the parsed results?

Thanks,
Eric




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Getting the Bovinator off the ground
  2017-03-25 19:07 Getting the Bovinator off the ground Eric Abrahamsen
@ 2017-03-25 21:29 ` Eric Abrahamsen
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Abrahamsen @ 2017-03-25 21:29 UTC (permalink / raw)
  To: help-gnu-emacs

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> [I was trying to send this to emacs.cedet, but haven't figured out how
> to post there. Hoping someone here can help.]
>
> I'm running emacs from git, and have installed CEDET from git as well.
>
> I'm trying to figure out how to use language grammars, and am obviously
> misunderstanding something fairly basic. I'm just trying to get a super
> barebones Bovine grammar set up, and then trying to use
> `semantic-parse-region' to see what it returns, and start playing with
> it.

Actually, what I'm really after is just a way of parsing regular textual
input into a regular lisp structure. I feel like I'm continually
shooting myself in the foot with regular expressions, and wanted
something a little "stricter". I really like how grammars are defined in
the Bovinator's *.by files -- that feels like the right approach -- but
it may also be bringing in a bunch of of unneeded complexity: I don't
need tags or completion or anything.

Are there any lighter-weight approaches to this problem?

Thanks,
Eric




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-25 21:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-25 19:07 Getting the Bovinator off the ground Eric Abrahamsen
2017-03-25 21:29 ` Eric Abrahamsen

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.