[antlr-interest] [Newbie] What do you think of my grammar? (sql-like, for downloading websites)

Timmy Turner timm.turn at gmail.com
Fri Feb 15 16:02:36 PST 2008


Hi there!

I have created a little sql-like language for downloading websites, and used
antlr to generate the parser/lexer.

To keep the post short, I put the grammar-definition on this page:
http://nopaste.php-quake.net/17078

It's used like: select pages, images from '
http://en.wikipedia.org/wiki/Main_Page' where url like '(.*)en\.(.*)'

This works great so far (Terence Parr's book was a great help), but i'm
still looking for a way of ignoring comments during a statement:

select
  pages, images
from
  'http://en.wikipedia.org/wiki/Main_Page'
--This is a comment that should be ignored
where url like '(.*)en\.(.*)'


do you have any idea how to implement this?

Also, since this is the first language i have ever designed, I'd like to ask
you what you think of it - have I made any common mistakes, or are there
maybe any best practices I should stick with?

I'm also looking for some sort of a java-gui-component capable of basic
syntax-highlighting for my language. I tried JEdit-Syntax (
http://syntax.jedit.org/ ) and adapting the syntax-highlighting to my needs
was very easy, as there was alread tsql support, but unfortunately this
component has by far too many bugs - I tried fixing them and got most of it
working but i can't seem to figure out a way to fix the horizontal
scrollbar. Maybe anyone of you knows a component suitable for me?

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20080216/80ad7383/attachment.html 


More information about the antlr-interest mailing list