Re: Page Template Language -- help with the grammar !

Nathan Moore <nathan.moore@sdc.cox.net>
27 Mar 2005 12:50:02 -0500

          From comp.compilers

Related articles
Page Template Language -- help with the grammar ! javadesigner@yahoo.com (java) (2005-03-25)
Re: Page Template Language -- help with the grammar ! nathan.moore@sdc.cox.net (Nathan Moore) (2005-03-27)
| List of all articles for this month |

From: Nathan Moore <nathan.moore@sdc.cox.net>
Newsgroups: comp.compilers
Date: 27 Mar 2005 12:50:02 -0500
Organization: Cox Communications
References: 05-03-096
Keywords: parse, design
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 ?


Nathan Moore



Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.