Wisent vs. Bison

hector <[email protected]> Thu, 18 May 2017 11:24:54 +0200
Newsgroups gmane.emacs.semantic
Message-ID <20170518092454.GA3770@workstation>
I am trying to know if Wisent is suited for my purposes.

I'd like to know in what aspects it differs from Bison. Logically its
internals are different.

I think one important difference (and perhaps this makes it not
suitable) is the parser-lexer interface. This is defined by
the definition of a token.

The tokens that Wisent takes as input are of the form:

 type start end

while in Bison they are (correct me if I'm wrong):

 type val

One consequence of this is that the bison lexer (flex)
can do more work and give the parser something of higher
level.

For example,

--------------------------------------------------------------------------------
Parsing a NUMBER, with input:
 -23

the Wisent form would be:
integer 1 3 (toksym start end)

while Bison would take:
integer -23 (toksym val)
--------------------------------------------------------------------------------
Parsing a STRING with input:
 "A string with \"quotes\""

Wisent:
string 2 25

Bison:
string (A string with "quotes")
--------------------------------------------------------------------------------

With Bison/Flex I can pass the string with backslashes removed.

The key here is that while bison takes a value (the type
depends on toksym) Wisent takes a string.

So my general impression is that in Wisent the lexer is
less powerful. Am I right?

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot