I've started building my first wisent parser for graphviz-dot
language. This goes along a little bit with the new code in
semantic-cb that creates .dot files.
Anyway, I got stuck with EXPANDFULL/EXPAND for a little bit till I
read that I needed to have a %start declaration for each nonterminal
used in %start. The below patch throws an error so I won't forget
this in the future.
I had some trouble building a wisent happy lexer too. I think there
is some more error checking to do there too which I will investigate.
Have fun
Eric
*** wisent-grammar.el.~1.8.~ Thu Mar 20 07:38:24 2003
--- wisent-grammar.el Sun Mar 23 12:38:53 2003
***************
*** 47,53 ****
"Return expansion of built-in EXPAND expression.
$I is the placeholder value to expand.
NONTERM is the nonterminal symbol to start with."
! (let (($ri (wisent-grammar-region-placeholder $i)))
(if $ri
`(semantic-bovinate-from-nonterminal
(car ,$ri) (cdr ,$ri) ',nonterm)
--- 47,57 ----
"Return expansion of built-in EXPAND expression.
$I is the placeholder value to expand.
NONTERM is the nonterminal symbol to start with."
! (let ((start (semantic-grammar-start))
! ($ri (wisent-grammar-region-placeholder $i)))
! (if (not (member nonterm start))
! (error "EXPANDFULL macro called with %s, but not used with %%start."
! nonterm))
(if $ri
`(semantic-bovinate-from-nonterminal
(car ,$ri) (cdr ,$ri) ',nonterm)
***************
*** 57,63 ****
"Return expansion of built-in EXPANDFULL expression.
$I is the placeholder value to expand.
NONTERM is the nonterminal symbol to start with."
! (let (($ri (wisent-grammar-region-placeholder $i)))
(if $ri
`(semantic-parse-region
(car ,$ri) (cdr ,$ri) ',nonterm 1)
--- 61,71 ----
"Return expansion of built-in EXPANDFULL expression.
$I is the placeholder value to expand.
NONTERM is the nonterminal symbol to start with."
! (let ((start (semantic-grammar-start))
! ($ri (wisent-grammar-region-placeholder $i)))
! (if (not (member nonterm start))
! (error "EXPANDFULL macro called with %s, but not used with %%start."
! nonterm))
(if $ri
`(semantic-parse-region
(car ,$ri) (cdr ,$ri) ',nonterm 1)
--
Eric Ludlam: zappo@..., eric@...
Home: http://www.ludlam.net Siege: http://www.siege-engine.com
Emacs: http://cedet.sourceforge.net GNU: http://www.gnu.org
|