|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
Need help with writing a grammarHello,
It has been a while since I was on this list. I've run into a problem that can only be solved with SableCC, sanely, which involves translating a 3D object from VRML 1.0 (WRL specification) to native C. I attached the grammar I'm developing as the file wrl.grammar. On line 68, I have the following production: point_elem = float float float point_elem_tail*; when I process it, I get this message: java.lang.RuntimeException: [68,23] Redefinition of APointElem.Float. Would someone explain to me why this isn't a valid production? Feel free to remind me something I may have forgotten in my language theory class. Thank you for your assistance on this. -- -- Joe Solinsky Plymouth, MN _______________________________________________ SableCC-Discussion mailing list SableCC-Discussion@... http://lists.sablecc.org/listinfo/sablecc-discussion |
|
|
RE: Need help with writing a grammarI
belive that you need to give each of the float terms a separate name, like
this:
point_elem = [float1]:float [float2]:float [float3]:float
[tail]:point_elem_tail*;
_______________________________________________ SableCC-Discussion mailing list SableCC-Discussion@... http://lists.sablecc.org/listinfo/sablecc-discussion |
|
|
Re: Need help with writing a grammarHi Joe,
> java.lang.RuntimeException: [68,23] Redefinition of APointElem.Float. If Sablecc could output CST from this rule, the node class APointElem corresponding to point_elem would have three same name methods. class APointElem { PFloat getFloat() { .. } /* confrict! */ PFloat getFloat() { .. } /* confrict! */ PFloat getFloat() { .. } /* confrict! */ LinkedList getPointElemTail() { .. } } So you should rewrite: point_elem = [f1]:float [f2]:float [f3]:float point_elem_tail*; The APointElem class will be: class APointElem { PFloat getF1() { .. } PFloat getF2() { .. } PFloat getF3() { .. } LinkedList getAPointElemTail() { .. } } regards Taketoshi Nishimori -- Taketoshi Nishimori <nis@...> <nistake@...> _______________________________________________ SableCC-Discussion mailing list SableCC-Discussion@... http://lists.sablecc.org/listinfo/sablecc-discussion |
|
|
Re: Need help with writing a grammarThank you everyone. I knew it was something I didn't understand!
On Fri, May 23, 2008 at 1:46 AM, Christopher Van Kirk <chris.vankirk@...> wrote:
-- -- Joe Solinsky Plymouth, MN _______________________________________________ SableCC-Discussion mailing list SableCC-Discussion@... http://lists.sablecc.org/listinfo/sablecc-discussion |
| Free Forum Powered by Nabble | Forum Help |