Document for SableCC v4

87 views
Skip to first unread message

Phuc Luoi

unread,
Jul 8, 2012, 6:06:13 AM7/8/12
to sab...@googlegroups.com
Hi,
is there any up to date document for SableCC 4? I took a look in the
examples in the distribution of SableCC v4. It's quite more complex
than
SableCC 3. I found the page http://sablecc.org/wiki/LexerDetails but
it says "NOTE: This page contains deprecated information."

Thanks for any help.
Hong Phuc

Etienne Gagnon

unread,
Jul 8, 2012, 8:38:30 AM7/8/12
to sab...@googlegroups.com
Hi Hong Phuc,

The short answer is "no, there isn't"; the wiki documentation is really
out of date because the design and syntax has much evolved since I wrote
it. But, the main reason for the evolution was to simplify things (a
lot), so that normal SableCC 4 use would be very intuitive. Note that
many programmers don't want to have to read tons of documentation to be
able to use a product; they'd rather have some easy to understand
examples they can cut & paste from or adapt for their solution.

At the current time, my first priority is getting the code out. Yet, I
would be glad to answer any question you have and walk you through a
small tutorial covering basic usage on this list. That could probably
replace your need for documentation, on the shorter term, and help
others at the same time.

Warning: The current SableCC 4 beta syntax is not final. Same applies to
the generated code. So, you shouldn't use it for any serious work.

Etienne

Etienne Gagnon, Ph.D.
http://sablecc.org

Phuc Luoi

unread,
Jul 8, 2012, 3:04:00 PM7/8/12
to sab...@googlegroups.com
Hi Etienne

Since I'm writing a new plugin for SableCC version 4, I would like to
know which tokens
in SableCC is for which. So I can make the syntax highlight useful.
E.g. the semicolon
is not so important, it does not need to be colored.

I think as long as I get the grammar
of Sablecc 4 in sablecc 3, it is not so trouble for the plugin to
color the token,
if the grammar changes. Because if the grammar change, I must only let
the sablecc
generate the parser and lexer, update token coloring, and the plugin will work.

More trouble is about the dependen graph. But I'm not so far.
> -- You received this message because you are subscribed to the SableCC
> group. To post to this group, send email to sab...@googlegroups.com. To
> unsubscribe from this group, send email to
> sablecc+u...@googlegroups.com. For more options, visit this group at
> https://groups.google.com/d/forum/sablecc?hl=en

Etienne Gagnon

unread,
Jul 8, 2012, 9:07:07 PM7/8/12
to sab...@googlegroups.com
Hi Hong Phuc,

That one is easy! You'll find the current (near final) SableCC 4 grammar
written in SableCC 3 syntax in the repository. Here's a link to the
GitHub copy:
https://github.com/egagnon/sablecc/blob/master/grammars/sablecc4.sablecc3

Have fun!

Etienne

Etienne Gagnon, Ph.D.
http://sablecc.org

On 2012-07-08 15:04, Phuc Luoi wrote:
> [...]
> I think as long as I get the grammar
> of Sablecc 4 in sablecc 3, it is not so trouble for the plugin to
> color the token,
> if the grammar changes. Because if the grammar change, I must only let
> the sablecc
> generate the parser and lexer, update token coloring, and the plugin will work.
> [...]

Phuc Luoi

unread,
Jul 9, 2012, 2:08:27 PM7/9/12
to sab...@googlegroups.com
Hi Etienne,

I have checked it. It is also not like the version distributed in the
zip file (beta.4) isn't it? No problem, I just
have to recall sablecc to generate lexer and parser.

Thank you for your very fast answer.
Hong Phuc

Etienne Gagnon

unread,
Jul 9, 2012, 2:44:52 PM7/9/12
to sab...@googlegroups.com
Hi Hong Phuc,

It think that you should probably use the grammar in the zip file. The
repository head version is a moving target. :)

I was simply trying to tell you that, currently, SableCC 4's parser is
still generated using SableCC 3.

Have fun!

Etienne

Etienne Gagnon, Ph.D.
http://sablecc.org

Reply all
Reply to author
Forward
0 new messages