[antlr-interest] Mixing PHP and HTML --> error

Ruben Fonseca rubenfonseca at di.uminho.pt
Fri May 4 02:14:06 PDT 2007


On Wed, 2007-05-02 at 18:35 +0200, Bernhard Schmalhofer wrote:
> Ruben Fonseca schrieb:
> > Hi to all!
> >
> > I'm writting a PHP grammar. As you know, PHP can be used in the middle
> > of HTML code. I'm having an hard time to ignore the HTML part. The
> > parser always give me errors when I mix PHP and HTML.
> >   
> In Plumhead, http://rakudo.org/parrot/index.cgi?plumhead, I'm using a 
> syntactic predicate
> in order to keep track whether I'm in HTML of PHP.
> See 
> http://svn.perl.org/viewcvs/parrot/trunk/languages/plumhead/src/antlr3/Plumhead.g?view=markup.
> I don't know whether this is the best approach.

Great to see Parrot is still alive!!

Your idea is *great*. But as soon as I implemented it in my code, the
Java generated code from AntLR3 gave me an error saying that
specialStateTransition exceeds the Java limit of 64Kb :( It seems to be
a Java limitation. I've wrote to the mailling list about this issue, and
I hope someone has a solution :)

Anyway, THANK YOU for your code!

Ruben



More information about the antlr-interest mailing list