problem with coding BNF
Posted on 2003-10-23
i have problem with coding BNF, so can any body help me with that
i want just small subprogram that chech the syntax error
example of BNF rule:
<stmts> -> <stmt>|<stmt>;<stmt>
<stmt> -> <var>=<expr>
<var> -> a | b | c | d
<expr> -> <term>+<term>|<term>-<term>
<term> -> <var> | const
where the symbol between< > represent non-terminal rule and other like +, -, = , ;, a, b, c, and d represent terminal symbols and | means OR option.......
this BNF could give such statement like a=b+const
the program should check whether the statement correct or not?