shebelaw
shebelaw

Reputation: 4172

productions for Sable CC parser generator

it looks pretty basic, but for the last half hour I couldnt find out why we say {zero} or {one} in the following productions what does the {} indicate?

bit
= {zero} zero            
| {one} one                
;

Upvotes: 0

Views: 528

Answers (1)

Matthew Marlin
Matthew Marlin

Reputation: 318

I have also searched far and wide for this answer, but what i have found is that the words in the curly braces of your production simply name that particular variation.

For example, when your production is run there are two methods that will be created for it when it is parsed, AZeroBit and AOneBit, thus the user can take specific actions for those two different variatons in his/her java working classes code.

Forgive me if i am way off point here, as there is not much to go by in terms of good beginner tutorials. Try reading the sableCC thesis chapter 3.

Upvotes: 1

Related Questions