Parsing - What am I doing wrong?

I have written the following program which should simply respond with

yes if an expression can be parsed, and no if it can. I cannot see

what is wrong with the program, and believe that it is basically

correct. The program should respond with yes for the following

expression :

parse([a,':=',1],[n(block]).

and no for :

parse([a,':=',1,';',while,a,'<',3,do,a,':=',a,'+',1],[n(block)]).

As I'm fairly new to this language, I'm unsure of what is going wrong

with the following program which will always respond with no. Any

advice that you may be able to give, or hints as to where the program

is failing would be most appreciated.

The Program :

rule(n(block),[t(begin),n(stmts),t(end)]).

rule(n(block),[n(stmt)]).

rule(n(stmts),[n(stmt),t(';'),n(stmts)]).

rule(n(stmts),[n(stmt)]).

rule(n(stmt),[t(while),n(expr),t(do),n(block)]).

rule(n(stmt),[n(ident),t(':='),n(expr)]).

rule(n(stmt),[t(iff),n(expr),t(then),n(block)]).

rule(n(stmt),[t(iff),n(expr),t(then),n(block),t(else),n(block)]).

rule(n(expr),[n(ident),n(op),n(expr)]).

rule(n(expr),[n(ident)]).

rule(n(op),[t('+')]).

rule(n(op),[t('*')]).

rule(n(op),[t('=')]).

rule(n(op),[t('<')]).

rule(n(ident),[t(a)]).

rule(n(ident),[t(b)]).

rule(n(ident),[t(c)]).

rule(n(ident),[t(0)]).

rule(n(ident),[t(1)]).

rule(n(ident),[t(2)]).

rule(n(ident),[t(3)]).

append([],L2,L2).

append([Hdl1|Tll1],L2,[Hdl1|Result]):-

append(Tll1,L2,Result).

parse([Hd1|Tl1],[Hd2|Tl2]):-

Hd2=t(x),

Hd1=x,

parse(Tl1,Tl2).

parse(Phrase,[Hd4|Tl4]):-

Hd4=n(x),

rule(Hd4,Listbody),

append(Listbody,Tl4,Newlist),

parse(Phrase,Newlist).

Thanks in advance,

Gavin