[Ctool-users] Parsing error
Brought to you by:
flisakow
|
From: Kwanghoon C. <cho...@ya...> - 2006-10-04 01:02:48
|
Hi there,=0A=0AWhen I tried to apply CTool to a C source code including=0A=
=0A> extern int fun_name (=0A> float f ( int a )=0A> );=0A=0AI go=
t an error message as=0A=0A> test.c:4: Function type not allowed:=0A> =
);=0A> ^=0A=0Awhere the caret points to the closed paranthesis.=0A=0A=
=0AThe error message comes from the rule param_decl_bis in=0Agram.y, which =
is a parser specification of CTool, as follows:=0A=0A> param_decl_bis: dec=
l_specs_reentrance_bis declarator=0A> {=0A> assert (gProj=
ect->Parse_TOS->err_top_level ||=0A> $1 =3D=3D gProject-=
>Parse_TOS->parseCtxt->curCtxt->decl_specs);=0A> gProject->Parse=
_TOS->possibleType =3D true;=0A> $$ =3D $2;=0A> Type =
* decl =3D gProject->Parse_TOS->parseCtxt->UseDeclCtxt();=0A> Ty=
pe * extended =3D $$->extend(decl); =0A> if ($$->for=
m &&=0A> $$->form->isFunction())=0A> {=0A> =
if(yyerr ("Function type not allowed"))=0A> YYER=
ROR;=0A> }=0A> else if (extended && =0A=0A=0AI am cu=
rious about the reason on the ban imposed by CTool.=0AI thought the ban com=
es from the definition of ANSI C standard,=0Aso I looked at the K&R C book =
to find the reason of the ban =0Abut in vain. =0A=0A=0AWould anybody give m=
e any explanation for my curiosity?=0A=0AThanks in advance.=0A=0A=0A=0ABest=
regards,=0A=0A=0AKwanghoon Choi=0A=0A=0A=09=09=0A_________________________=
_______________________________ =0A180=B5=B5 =B4=DE=B6=F3=C1=F8 =BE=DF=C8=
=C4! =B8=DE=C0=CF - =C4=C4=C7=BB=C5=CD=BF=CD =C8=DE=B4=EB=C6=F9=C0=B8=B7=CE=
=BE=F0=C1=A6 =BE=EE=B5=F0=BC=AD=B3=AA =BB=F5=B7=CE=BF=EE =BE=DF=C8=C4! =B8=
=DE=C0=CF=C0=BB =C8=AE=C0=CE=C7=D8=BA=B8=BC=BC=BF=E4.=0Ahttp://kr.content.m=
ail.yahoo.com/cgland
|