|Page Template Language -- help with the grammar ! firstname.lastname@example.org (java) (2005-03-25)|
|Re: Page Template Language -- help with the grammar ! email@example.com (Nathan Moore) (2005-03-27)|
|From:||Nathan Moore <firstname.lastname@example.org>|
|Date:||27 Mar 2005 12:50:02 -0500|
|Posted-Date:||27 Mar 2005 12:50:02 EST|
Easy fix is to differentiate between the "[", "[[", "\[", and "\[[" in
the lexical analysis phase so that each is assigned a representative
symbol (and ditto that for their partners).
then you have
exp -> LEFT_BRACKET exptext RIGHT_BRACKET
code -> DBL_LEFT_BRACKET codetext DBL_RIGHT_BRACKET
You could do it with the gramatic syntax, but it would be trickier.
What tools are you using? Are you hand coding? Is your parser
recursive decent? Is this a homework assignment?
> But I want to specify that \[ does not start an exp
> and \[[ does not start code. How to do that in the grammar ?
> I also want to specify that \] does not end an exp
> and \]] does not end code. How to do that in the grammar ?
Return to the
Search the comp.compilers archives again.