tags:

views:

73

answers:

1

I want to make a simple JSP parser by using Treetop. Now, I have the following problem:

My basic grammar for starting is:

grammar Jspgrammar
     rule jspToken
       '<%'
     end

     rule jspPageToken
        jspToken '@page' 
     end

jspToken should match '<%' while jspPageToken should match '<%@page'

When I try this in irb:

load 'jspgrammar.rb' parser=JspgrammarParser.new tree=parser.parse("<%") => SyntaxNode offset=0, "<%"

But when I try tree=parser.parse("<%@page") => nil

What am I missing?

+1  A: 

see:

[google groups on Treetop] : http://groups.google.com/group/treetop-dev/browse%5Fthread/thread/3fecfa42a76e0034?pli=1

poseid